Commit graph

183 commits

Author SHA1 Message Date
Alex Henrie
f8f015b22e Bug 1649187 - Fix diacritic stripping for characters outside the BMP. r=jfkthame
Due to an unfortunate typo I made in base_chars.py, I thought that there
were no mappings we care about outside of the basic multilingual plane.
This patch adds back the non-BMP mappings that we do care about.

Differential Revision: https://phabricator.services.mozilla.com/D107404
2021-03-10 12:08:49 +00:00
Alex Henrie
0686831376 Bug 1649187 - Use a fallback table to strip diacritics from non-decomposable characters. r=jfkthame
Implement the design suggested at
https://bugzilla.mozilla.org/show_bug.cgi?id=1652910#c5

Differential Revision: https://phabricator.services.mozilla.com/D106674
2021-03-07 16:17:41 +00:00
Kagami Sascha Rosylight
717d5d2aa5 Bug 1671768 - Part 4: Use MOZ_CAN_RUN_SCRIPT for Selection::RemoveAllRanges r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D103780
2021-02-03 21:52:48 +00:00
Kagami Sascha Rosylight
9fc2fee9e3 Bug 1680167 - Part 8: MOZ_CAN_RUN_SCRIPT_BOUNDARY in toolkit r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D98631
2020-12-03 22:58:14 +00:00
Simon Giesecke
971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Ricky Stewart
02a7b4ebdf Bug 1654103: Standardize on Black for Python code in mozilla-central.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Bogdan Tara
da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart
c0cea3b0fa Bug 1654103: Standardize on Black for Python code in mozilla-central. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Dorel Luca
1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart
50762dacab Bug 1654103: Standardize on Black for Python code in mozilla-central. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Emilio Cobos Álvarez
29b27e6d30 Bug 389651 - Make find-in-page ignore non-matching default-ignorable characters. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D90461
2020-09-16 22:54:38 +00:00
Emilio Cobos Álvarez
4efeec4b9d Bug 1663411 - Improve the speed of find-in-page when ending a pseudo-element mid-match. r=jfkthame
So what's going on here is that there are pseudo-elements that contain
stuff like content: "Note" or content: "Example".

So when you're searching for "entry", we find the `e`, and then all the
text nodes afterwards are of course in a different subtree... So we end
up ignoring them, but after having iterated through all the DOM first.

To avoid this, change a bit the code so that we check for different
blocks _before_ checking for different subtrees. There's no point to
keep matching once you're done with a block.

Differential Revision: https://phabricator.services.mozilla.com/D89365
2020-09-07 13:40:36 +00:00
Emilio Cobos Álvarez
b595041e81 Bug 1659897 - Rewind if needed when hitting a forced break in find-in-page. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D87584
2020-08-28 09:46:15 +00:00
Razvan Maries
695a7a469b Backed out changeset 0d8222cd72dc (bug 1659897) for perma failures on browser_ext_find.js. CLOSED TREE 2020-08-20 22:59:03 +03:00
Emilio Cobos Álvarez
920d957119 Bug 1659897 - Rewind if needed when hitting a forced break in find-in-page. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D87584
2020-08-20 17:52:16 +00:00
Emilio Cobos Álvarez
36cd507c54 Bug 1654683 - Avoid failing to set the search range for find due to nsRange security checks. r=smaug
We should probably switch nsRange to use CallerType instead of implicit
JSContext checks?

Differential Revision: https://phabricator.services.mozilla.com/D84803
2020-07-24 16:52:33 +00:00
Emilio Cobos Álvarez
388222cf6a Bug 1654270 - Properly restart after a partial match if we reach the end of the document. r=jfkthame
This was kind of a pre-existing bug, though not surfaced because we
didn't have conditionally-appearing text nodes I guess.

If we are doing a match in a non-anonymous subtree, we'd skip the
anonymous text (that's alright). But if we actually reach the end of the
document (as it is the case on the test that starts failing with the
other patch in this bug), we'd just early-return, rather than restarting
where we left off, which is not fine and means that potential matches in
anonymous subtrees that were skipped won't show up.

This fixes the bug... Eventually we should probably come up with a
better structure than this gigantic while (true), probably moving all
these variables into their own struct, but today is not that day :)

Differential Revision: https://phabricator.services.mozilla.com/D84425
2020-07-22 15:32:44 +00:00
Emilio Cobos Álvarez
c21099505b Bug 1654270 - When an ongoing match crosses an anonymous boundary, ignore it instead of forcing the end of the match. r=jfkthame
This restores our previous behavior when matching across anonymous
boundaries, as that's not something we currently can support because DOM
ranges can't represent that.

Differential Revision: https://phabricator.services.mozilla.com/D84397
2020-07-22 15:32:44 +00:00
Dorel Luca
d5bec2cd58 Backed out changeset f91b6b609218 (bug 1654270) for Mochitest failure in chrome/test_bug451540.xhtml. CLOSED TREE 2020-07-21 22:28:09 +03:00
Emilio Cobos Álvarez
b77f0756a2 Bug 1654270 - When an ongoing match crosses an anonymous boundary, ignore it instead of forcing the end of the match. r=jfkthame
This restores our previous behavior when matching across anonymous
boundaries, as that's not something we currently can support because DOM
ranges can't represent that.

Differential Revision: https://phabricator.services.mozilla.com/D84397
2020-07-21 17:32:39 +00:00
Emilio Cobos Álvarez
69bd04067f Bug 1650444 - Explicitly disallow finding in <input type=password>. r=jfkthame
Maybe if / when we have a native way to allow showing the password we
can lift this if the password is visible or what not. Until then this is
just confusing.

Differential Revision: https://phabricator.services.mozilla.com/D82296
2020-07-06 15:05:47 +00:00
Emilio Cobos Álvarez
77e8fe49d3 Bug 1650444 - Remove browser.find.anonymous_content.enabled. r=jfkthame
Other than this, there hasn't been any other major regression since we
introduced that switch. I don't think there's a point in keeping it
around.

Differential Revision: https://phabricator.services.mozilla.com/D82297
2020-07-06 15:05:49 +00:00
Tilden Windsor
6f2e45cfda Bug 1629604 - Fixed phrase not found in visible <script> and added a test for visible <script>. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D75824
2020-05-18 21:28:46 +00:00
Mirko Brodesser
b547d18451 Bug 1634663: part 5) Declare callers of Selection::GetRangeAt around toolkit/components/find const. r=masayuki
Depends on D73447

Differential Revision: https://phabricator.services.mozilla.com/D73448
2020-05-02 23:48:06 +00:00
Emilio Cobos Álvarez
5ab0ed1477 Bug 1633828 - Check for empty text nodes in nsFind::PeekNextChar. r=jfkthame
This check was done in GetNextNonEmptyTextFragmentInSameBlock which I
removed in bug 1627643.

Hopefully the fuzzer finds an easy reduced test-case to land as a
crashtest, otherwise I can try to construct one.

Differential Revision: https://phabricator.services.mozilla.com/D72926
2020-05-01 14:26:25 +00:00
Emilio Cobos Álvarez
5bb31e3f1d Bug 1633195 - Make sure <br> forces a break even if there's no whitespace in between. r=jfkthame
Wrote this on top of bug 1627643. Should be easy to rebase if needed,
though.

Differential Revision: https://phabricator.services.mozilla.com/D72541
2020-04-28 10:31:22 +00:00
Emilio Cobos Álvarez
8cfb840466 Bug 1627643 - Allow to find and display selection native anonymous content. r=jfkthame
The check for generated content in nsTextFrame is to the best of my
knowledge useless: We don't display generated content as selected when
the parent is selected anyhow, and the offsets would be wrong.

We special-case text inputs and textarea because of ::placeholder, see
the comment, but otherwise there's no reason you shouldn't be able to
find-in-page generated content / fallback / etc.

I added ForceBreakBetween so as to not create ranges that span across
shadow / anonymous content boundaries. They don't work anyway (see the
TODO in test_find.html), so it seems better to make that explicit until
we properly handle them (bug 1590379).

I added a pref just to be safe since this is long-standing behavior, but
I think it should be uncontroversial.

Differential Revision: https://phabricator.services.mozilla.com/D72447
2020-04-27 13:56:04 +00:00
Sylvestre Ledru
34acbb653a Bug 1619165 - Reformat recent changes to the Google coding style r=andi
First reformat with clang-format 10

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D68802
2020-04-25 09:40:08 +00:00
Emilio Cobos Álvarez
142b7d3c57 Bug 1629096 - Always honor scroll-margin / scroll-padding from nsFocusManager. r=masayuki
We should always do this, otherwise stuff may not end up being visible which is
not acceptable for focus navigation.

Differential Revision: https://phabricator.services.mozilla.com/D70541

--HG--
extra : moz-landing-system : lando
2020-04-13 11:34:48 +00:00
Mirko Brodesser
ec9cb4d8ef Bug 1622199: annotate Selection::AddRangeAndSelectFramesAndNotifyListeners with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D66759

--HG--
extra : moz-landing-system : lando
2020-03-13 15:46:13 +00:00
Simon Giesecke
8ad76c7e47 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in toolkit. r=mossop
Depends on D66008

Differential Revision: https://phabricator.services.mozilla.com/D66010

--HG--
extra : moz-landing-system : lando
2020-03-10 08:48:24 +00:00
Simon Van Accoleyen
3006ffb76d Bug 1619619 - DeCOMtaminate accesses to nsFocusManager r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D65884

--HG--
extra : moz-landing-system : lando
2020-03-09 09:51:46 +00:00
Sylvestre Ledru
ca6530131a Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan,kvark
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D63787

--HG--
extra : moz-landing-system : lando
2020-02-24 15:33:38 +00:00
Emilio Cobos Álvarez
7ee58cb469 Bug 1601118 - Fix nsFind state initialization logic. r=smaug
We should start seeking from the child-at-start/end-offset, rather than the
selection container.

The logic to select the starting node was backwards too...

If we're finding backwards we want to start looking from the beginning of the
range and vice versa. But I think that doesn't really matter since
nsWebBrowserFind always gives us a start range with start == end.

Differential Revision: https://phabricator.services.mozilla.com/D63553

--HG--
extra : moz-landing-system : lando
2020-02-21 17:41:34 +00:00
Mihai Alexandru Michis
1c3183cf0a Backed out changeset 9a03944aff45 (bug 1601118) for causing AssertionError in geckoview.test.FinderTest
CLOSED TREE
2020-02-21 16:14:06 +02:00
Emilio Cobos Álvarez
aa5e974d27 Bug 1601118 - Fix nsFind state initialization logic. r=smaug
We should start seeking from the child-at-start/end-offset, rather than the
selection container.

The logic to select the starting node was backwards too...

If we're finding backwards we want to start looking from the beginning of the
range and vice versa. But I think that doesn't really matter since
nsWebBrowserFind always gives us a start range with start == end.

Differential Revision: https://phabricator.services.mozilla.com/D63553

--HG--
extra : moz-landing-system : lando
2020-02-21 13:19:37 +00:00
Alex Henrie
d346ee224f Bug 1611568 - Ignore combining diacritic characters when "Match Diacritics" is off. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D61081

--HG--
extra : moz-landing-system : lando
2020-02-10 18:09:05 +00:00
Masayuki Nakano
450b71f763 Bug 1612085 - part 1: Hide constructor of nsRange r=smaug
`nsRange` instances are allocated a lot in the heap especially by editor and
spellchecker.  The allocation cost is too bad for benchmarks.  Therefore,
we should reuse released instances as far as possible.  For managing it in
static factory methods of `nsRange`, we need to hide `nsRange` constructor.

Differential Revision: https://phabricator.services.mozilla.com/D61237

--HG--
extra : moz-landing-system : lando
2020-01-30 13:23:35 +00:00
Alex Henrie
00867c4809 Bug 202251 - Add an option to ignore diacritics when searching. r=fluent-reviewers,mikedeboer,jfkthame,flod
Differential Revision: https://phabricator.services.mozilla.com/D51841

--HG--
extra : moz-landing-system : lando
2019-12-09 19:26:40 +00:00
Gabriele Svelto
5dc21d568c Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55444

--HG--
extra : moz-landing-system : lando
2019-12-06 09:17:57 +00:00
Brindusan Cristian
4b11b63400 Backed out changeset b89936db7178 (bug 202251) for bc failures at browser_misused_characters_in_strings.js. CLOSED TREE 2019-12-05 23:10:09 +02:00
Alex Henrie
ca467c4b3f Bug 202251 - Add an option to ignore diacritics when searching. r=fluent-reviewers,mikedeboer,jfkthame,flod
Differential Revision: https://phabricator.services.mozilla.com/D51841

--HG--
extra : moz-landing-system : lando
2019-12-05 18:08:20 +00:00
Ehsan Akhgari
dc998c5c5a Bug 1592599 - Switch nsIDocShell.getDocShellEnumerator() away from using nsISimpleEnumerator; r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D51100

--HG--
extra : moz-landing-system : lando
2019-11-18 20:11:58 +00:00
Emilio Cobos Álvarez
f36874d798 Bug 1596445 - Add some supporting code to nsINode to deal with NAC and shadow DOM separately. r=bzbarsky
We'll use these to remove GetBindingParent.

Differential Revision: https://phabricator.services.mozilla.com/D53029

--HG--
extra : moz-landing-system : lando
2019-11-15 15:10:45 +00:00
Alex Henrie
4e325c4480 Bug 969980 - Use case folding for case-insensitive searches. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D50940

--HG--
extra : moz-landing-system : lando
2019-10-29 19:56:56 +00:00
Alex Henrie
599d6a6962 Bug 1589786 - Handle surrogate pairs in nsFind. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D49822

--HG--
extra : moz-landing-system : lando
2019-10-25 01:15:07 +00:00
Mihai Alexandru Michis
a5cac4d597 Backed out changeset 0063a5b2f5b3 (bug 1589786) for causing bustages in TestDLLBlocklist.obj and sandboxBroker.i_o CLOSED TREE 2019-10-24 19:41:56 +03:00
Alex Henrie
26a3356957 Bug 1589786 - Handle surrogate pairs in nsFind. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D49822

--HG--
extra : moz-landing-system : lando
2019-10-24 13:38:32 +00:00
Emilio Cobos Álvarez
e57b14dc52 Bug 1576817 - Fix a regression from bug 1490974 where we'll fail to find visibility: visible descendants of visibility: hidden nodes. r=bradwerth
The split between IsDisplayedNode and IsVisibleNode is pretty intentional, since
visibility: visible descendants of visiblity: hidden ancestors are in fact
visible.

We skip fully-invisible ranges in here instead:

https://searchfox.org/mozilla-central/rev/325c1a707819602feff736f129cb36055ba6d94f/toolkit/components/find/nsFind.cpp#776

Differential Revision: https://phabricator.services.mozilla.com/D43745

--HG--
extra : moz-landing-system : lando
2019-08-28 15:15:23 +00:00
Emilio Cobos Álvarez
ed9f59952f Bug 1576817 - Only allow finding editable anonymous nodes in form controls. r=bradwerth
We want to find the text inside the input that the user types, but not stuff
like the placeholder. So check that the anonymous subtree is editable, or skip
it otherwise.

Differential Revision: https://phabricator.services.mozilla.com/D43744

--HG--
extra : moz-landing-system : lando
2019-08-28 15:35:48 +00:00