Граф коммитов

154 Коммитов

Автор SHA1 Сообщение Дата
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
Emilio Cobos Álvarez dd3b1b3b40 Bug 1576817 - Simplify some code added in bug 1490974. r=bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D43743

--HG--
extra : moz-landing-system : lando
2019-08-28 15:11:55 +00:00
Sylvestre Ledru d264b841c9 Bug 1576502 - Fix some wording issues r=mhoye
Differential Revision: https://phabricator.services.mozilla.com/D43363

--HG--
extra : moz-landing-system : lando
2019-08-27 15:38:58 +00:00
Mirko Brodesser 63b4627d28 Bug 1562876: rename `Selection::AddRange` to `Selection::AddRangeAndSelectFramesAndNotifyListeners`. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D36602
2019-07-03 13:26:13 +02:00
Sylvestre Ledru 993c03acb1 Bug 1552795 - Remove all trailing whitespaces in idl files r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D31769

--HG--
extra : moz-landing-system : lando
2019-05-22 22:37:14 +00:00
Sylvestre Ledru e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

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

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00:00
Brad Werth 0d0e308cbb Bug 1542324 Part 1: Make nsFind::Find handle empty string searches. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D28908

--HG--
extra : moz-landing-system : lando
2019-04-25 21:37:09 +00:00
Hiroyuki Ikezoe 700ec53c21 Bug 1535232 - Take account the scroll-snap-margin and scroll-snap-padding into the position where we scroll to on Element.focus() call. r=masayuki,botond
We also take account those values in the case of `Find in page`.

The corresponding web platform tests will be coming from this PR.
https://github.com/web-platform-tests/wpt/pull/8575

Though some of them will not be passed, the failure reason is not related
to this change, I will take a look when the PR gets merged into mozilla-central.

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

--HG--
extra : moz-landing-system : lando
2019-04-11 06:22:38 +00:00
Brad Werth 3e8325f6fb Bug 1538042 Part 1: Change nsIFind::Find to have access to text length. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D25005

--HG--
extra : moz-landing-system : lando
2019-03-29 15:55:57 +00:00
Masayuki Nakano de2d589e58 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.

Additonally, "shell" is unclear ("docshell" vs. "presshell").  Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.

Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 15:12:47 +00:00
Dorel Luca 5a0fa68b78 Backed out 3 changesets (bug 1540015) for build bustage. CLOSED TREE
Backed out changeset 7b71c9da0214 (bug 1540015)
Backed out changeset 5723ddbc5c44 (bug 1540015)
Backed out changeset 9561d2c36fa5 (bug 1540015)
2019-03-29 16:14:26 +02:00
Masayuki Nakano 9273f25ce2 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.

Additonally, "shell" is unclear ("docshell" vs. "presshell").  Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.

Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 13:09:26 +00:00
Brad Werth 5afd6194db Bug 1490974 Part 1: For find-in-page, prevent invisible nodes and option nodes from being included in find results. r=mikedeboer
Differential Revision: https://phabricator.services.mozilla.com/D10631

--HG--
extra : moz-landing-system : lando
2019-02-27 21:23:55 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Masayuki Nakano f8844f0d9b Bug 181137 - part 7: Get rid of nsIContentIterator interface r=smaug
Now, nobody requires nsIContentIterator interface.  So, we can get rid of it.

Unfortunately, there is no macro to keep the inherited class,
ContentSubtreeIterator, in the cycle collection to make it keep managing
ContentSubtreeIterator::mRange without nsISupports interface.  Therefore, this
patch moves it into ContentIteratorBase temporarily.  Anyway, the following
patch makes those classes not refcountable.  At that time, this issue will be
fixed.

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

--HG--
extra : moz-landing-system : lando
2019-01-11 01:51:42 +00:00
Csoregi Natalia 13506c036a Backed out 8 changesets (bug 181137) for bustage on FragmentOrElement.cpp:1751. CLOSED TREE
Backed out changeset 99a977d519a0 (bug 181137)
Backed out changeset 65a4b245e851 (bug 181137)
Backed out changeset 5385d5fd9b8b (bug 181137)
Backed out changeset 83bec02c21d9 (bug 181137)
Backed out changeset b7ab59bf545e (bug 181137)
Backed out changeset b6fc7a332db7 (bug 181137)
Backed out changeset 654fdbad67db (bug 181137)
Backed out changeset 90a1ff49b6b1 (bug 181137)

--HG--
rename : dom/base/ContentIterator.h => dom/base/nsContentIterator.cpp
rename : editor/spellchecker/FilteredContentIterator.cpp => editor/spellchecker/nsFilteredContentIterator.cpp
rename : editor/spellchecker/FilteredContentIterator.h => editor/spellchecker/nsFilteredContentIterator.h
2019-01-10 11:42:27 +02:00
Masayuki Nakano 91a9670801 Bug 181137 - part 7: Get rid of nsIContentIterator interface r=smaug
Now, nobody requires nsIContentIterator interface.  So, we can get rid of it.

Unfortunately, there is no macro to keep the inherited class,
ContentSubtreeIterator, in the cycle collection to make it keep managing
ContentSubtreeIterator::mRange without nsISupports interface.  Therefore, this
patch moves it into ContentIteratorBase temporarily.  Anyway, the following
patch makes those classes not refcountable.  At that time, this issue will be
fixed.

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

--HG--
extra : moz-landing-system : lando
2019-01-10 08:47:54 +00:00
Emilio Cobos Álvarez d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Emilio Cobos Álvarez b6deca5eb0 Bug 1442466 - Fix bogus IsInNativeAnonymousSubtree function in nsWebBrowserFind. r=bzbarsky
This is ultimately the root cause of the issue. I'm landing a test to ensure we
notice the behavior change if we make it, in addition to a test for this issue
itself, to ensure that we don't get stuck, since after bug 1510485 we don't
return such nodes from nsFind when window.find is called anyway.

This code made no sense, it only returned true if the binding parent is the node
itself, which as far as I can tell cannot happen, so it was just a very
expensive way to return false.

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

--HG--
extra : moz-landing-system : lando
2018-12-11 04:18:11 +00:00
Emilio Cobos Álvarez 1288b871bf Bug 1510485 - Properly handle errors in nsFind when returning a range. r=bzbarsky
Bug 1505887 changed the behavior here from content calling into nsFind via
window.find(), by making the SetStart and SetEnd calls here fail instead of
succeed for NAC (like the text in textareas).

This patch makes us handle that error gracefully moving on to the next match,
instead of trying to preserve the previous behavior.

This means that we'll fail to highlight textarea content and such from
window.find, which Chromium does, looks like. Though Chromium doesn't expose
the ranges as selection either. In any case I don't think that this is a very
common thing given bugs like bug 1442466, which this bug fixes.

I haven't found anything close to a spec for what window.find() should do... If
we decide to go with this patch then I'll add a crashtest for this and a test
for bug 1442466 as well. Otherwise I'll add a way to skip the security check in
nsFind somehow for NAC, or relax the security restrictions in SetStart /
SetEnd, I guess.

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

--HG--
extra : moz-landing-system : lando
2018-12-11 01:06:32 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Kyle Machulis c241567f0f Bug 1505601 - Turn nsIDocShell XPIDL const lists into cenums; r=bzbarsky
Turn all const lists and related attributes into cenums, to provide a
vague sense of type safety.

Depends on D11715

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

--HG--
extra : moz-landing-system : lando
2018-11-28 03:30:56 +00:00
Gabriele Svelto 266ef73c96 Bug 1503207 - Remove nsWeakPtr.h and cleanup all files including weak reference-related headers r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D10251

--HG--
extra : moz-landing-system : lando
2018-10-31 20:39:03 +00:00
Andrew McCreight ea6021b769 Bug 1494127 - Fix trivial calls to do_QueryInterface that return an nsresult r=smaug
Calls to do_QueryInterface to a base class can be replaced by a static
cast, which is faster.

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

--HG--
extra : moz-landing-system : lando
2018-10-01 21:38:43 +00:00
Ehsan Akhgari 6c19b5c6fd Bug 1491735 - Remove the XPCOM registration for nsWebBrowserFind; r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D5993
2018-09-17 19:48:13 -04:00
Nicholas Nethercote 534cc02919 Bug 1488628 - Change nsIWebBrowsing.searchString to an AString. r=froydnj
--HG--
extra : rebase_source : b7c2bdded7dbd278bfbb2297c0d1ea6c4ca4934c
2018-09-05 13:38:51 +10:00
Emilio Cobos Álvarez d88bf18c3f Bug 1455891: Use GetFlattenedTreeParent more in nsFind. r=mats
This is the right thing to use for this kind of stuff.

MozReview-Commit-ID: FrgD48LjRSG
2018-07-06 06:53:22 +02:00
Emilio Cobos Álvarez d35cc30c13 Bug 1455891: Remove nsFindContentIterator. r=mats
MozReview-Commit-ID: 58AFqqaSLcC
2018-07-06 06:53:22 +02:00
Emilio Cobos Álvarez a7404f40c6 Bug 1455891: Use TreeIterator in nsFind. r=mats
MozReview-Commit-ID: GSY5w6NYRS
2018-07-06 06:53:22 +02:00
Emilio Cobos Álvarez 312b570c68 Bug 1472529: More nsFind cleanup. r=mats
The general setup is that the State struct is used to iterate over text nodes
explicitly, and keeps references to the ranges so that we don't need to pass all
them around everywhere.

We need to teach nsFindContentIterator to rewind into NAC to be able to get rid
of mIterNode, which was getting out of sync when we failed to rewind to the
anchor node.

MozReview-Commit-ID: 5czYADrm1WX
2018-07-03 02:07:48 +02:00