Commit Graph

295 Commits

Author SHA1 Message Date
Mirko Brodesser
b845b4e662 Bug 1593222: part 1) Move nsNodeUtils::IsTemplateElement to nsINode. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D51606

--HG--
extra : moz-landing-system : lando
2019-11-05 14:05:36 +00:00
Emilio Cobos Álvarez
2ec3bb2b4f Bug 998590 - Cleanup HTMLHeadingElement, and add HTMLHeadingElement::FromNode. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D49406

--HG--
extra : moz-landing-system : lando
2019-10-16 14:25:05 +00:00
Emilio Cobos Álvarez
68daa729f5 Bug 1585823 - Make ShadowRoot use consistent DOM binding wrapping, and make nsINode::WrapObject final. r=smaug
Looks like an oversight from all the way back to bug 806506.



Depends on D48538

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

--HG--
extra : moz-landing-system : lando
2019-10-09 11:53:24 +00:00
Emilio Cobos Álvarez
678c18063d Bug 1583203 - Annotate nsINode::OwnerDoc() as MOZ_NONNULL_RETURN. r=smaug
People keep adding useless null-checks and it was not clear what the consensus
was from bug 1441165, but this should be unobjectionable I guess.

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

--HG--
extra : moz-landing-system : lando
2019-09-23 18:12:19 +00:00
Andreea Pavel
7d9c945b30 Backed out 3 changesets (bug 1583203) build bustages on a CLOSED TREE
Backed out changeset ca89485fedf8 (bug 1583203)
Backed out changeset 8bc17415ff25 (bug 1583203)
Backed out changeset 3e3eebe862e5 (bug 1583203)
2019-09-23 18:16:49 +03:00
Emilio Cobos Álvarez
1a26094a08 Bug 1583203 - Annotate nsINode::OwnerDoc() as MOZ_NONNULL_RETURN. r=smaug
People keep adding useless null-checks and it was not clear what the consensus
was from bug 1441165, but this should be unobjectionable I guess.

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

--HG--
extra : moz-landing-system : lando
2019-09-23 14:23:17 +00:00
Olli Pettay
9978173b32 Bug 1517880 - Add a flag for l10n elements created from prototype. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D36067

--HG--
extra : moz-landing-system : lando
2019-07-26 20:16:37 +00:00
Gurzau Raul
776258cda0 Backed out 5 changesets (bug 1517880) on request from gandalf on a CLOSED TREE.
Backed out changeset 39c3063994bf (bug 1517880)
Backed out changeset 45bf070f451b (bug 1517880)
Backed out changeset d2b9e6bbb4cb (bug 1517880)
Backed out changeset 3bd43f3e288a (bug 1517880)
Backed out changeset 3b54c85a747b (bug 1517880)
2019-07-26 23:09:57 +03:00
Olli Pettay
ebcd546db9 Bug 1517880 - Add a flag for l10n elements created from prototype. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D36067

--HG--
extra : moz-landing-system : lando
2019-07-26 16:11:42 +00:00
Mirko Brodesser
de74655cfa Bug 1566751: update description of nsINode::ComputeIndexOf about anonymous content. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D38288
2019-07-17 12:59:08 +02:00
Mirko Brodesser
8135a5859f Bug 1566046: move nsContentUtils::ContentIsShadowIncludingDescendantOf to nsINode::IsShadowIncludingInclusiveDescendantOf. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D38079
2019-07-16 09:25:02 +02:00
Mirko Brodesser
1669cc6770 Bug 1566046: rename GetParentOrHostNode to GetParentOrShadowHostNode. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D38078
2019-07-16 09:25:02 +02:00
Noemi Erli
2f99f5d875 Merge mozilla-central to autoland. a=merge CLOSED TREE 2019-07-16 00:48:17 +03:00
Mirko Brodesser
2f40f072ab Bug 1565584: move nsIContentUtils::ContentIsDescendantOf to nsINode::IsInclusiveDescendantOf. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D37880
2019-07-15 10:02:21 +02:00
Boris Zbarsky
dfc54dca0e Bug 1565767 part 1. Stop returning addrefed URIs from GetBaseURI(). r=peterv
We only needed this for xml:base.

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

--HG--
extra : moz-landing-system : lando
2019-07-15 17:22:30 +00:00
Logan Smyth
a1de03c27b Bug 1529345 - Part 2: Add Gecko infrastructure for receiving notifications about debugger-related events. r=jimb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D30565

--HG--
extra : moz-landing-system : lando
2019-06-17 04:36:29 +00:00
Dorel Luca
e12ad70ab7 Backed out 2 changesets (bug 1529345) for Windows 2012 build bustages
Backed out changeset 87aa4894b4a1 (bug 1529345)
Backed out changeset cf6f6281cb44 (bug 1529345)

--HG--
extra : rebase_source : b19274a3d20d3a1ea92f0fe1224ef30910e10916
2019-06-14 23:34:36 +03:00
Logan Smyth
77f27aa54c Bug 1529345 - Part 2: Add Gecko infrastructure for receiving notifications about debugger-related events. r=jimb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D30565

--HG--
extra : moz-landing-system : lando
2019-06-14 18:25:47 +00:00
Dorel Luca
6b40527932 Backed out 2 changesets (bug 1529345) for Build Bustage. CLOSED TREE
Backed out changeset 63f80a49839e (bug 1529345)
Backed out changeset 15bac42cc73a (bug 1529345)
2019-06-14 20:55:52 +03:00
Logan Smyth
c09e533d0e Bug 1529345 - Part 2: Add Gecko infrastructure for receiving notifications about debugger-related events. r=jimb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D30565

--HG--
extra : moz-landing-system : lando
2019-06-14 17:14:13 +00:00
Emilio Cobos Álvarez
c4dbe4893c Bug 1505489 - Keep track of elements with part attributes in a shadow tree. r=bzbarsky
I need this to make style invalidation work with Shadow Parts in a way that's
fast. If something in the ancestor shadow root or any of its ancestor changes,
that makes a ::part() selector change, I don't want to walk the whole shadow
tree over and over in order to find the parts that I need to restyle.

Unfortunately we cannot just use the mutation observer setup from ShadowRoot
since, unlike for slotted elements, there's no restriction of where a part can
appear in the shadow tree.

That means that the regular nsIMutationObserver notifications don't quite cut
it, since we'd get notified only of subtree roots and we'd need to tree-walk
around in order to figure out if we have any new part.

I thought that I was going to be able to share more code with other bits if I
moved them away from nsIMutationObserver, thus bug 1554498, but in the end it
was not the case, so here's the "without bug 1554498" version of the patch.

The patch on top of that bug (that as I mention in the commit message I'm
ambivalent about whether we should land or not) should be pretty similar either
way.

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

--HG--
extra : moz-landing-system : lando
2019-06-11 17:41:37 +00:00
Christoph Kerschbaumer
b633427366 Bug 965637: Move CSP from Principal into Client, part 1: backend changes. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D27654

--HG--
extra : moz-landing-system : lando
2019-05-21 23:14:27 +00:00
Mirko Brodesser
0c5556605c Bug 1552490: rename nsCopySupport::HTMLCopy, change nsDocumentEncoder::IsVisible, add unit to buffer size name. r=hsivonen
Because it states more clearly what the functions and the constant are
about.

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

--HG--
extra : moz-landing-system : lando
2019-05-20 07:43:43 +00:00
Masayuki Nakano
663f37d827 Bug 1547618 - Make dom use mozilla::PresShell rather than via nsIPresShell r=smaug
Additionally, this patch makes `nsContentUtils::DispatchXULCommand()` because
it guarantees the lifetime of **only** `PresShell` in it.  So, we need to check
the lifetime of each argument at each caller here.

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

--HG--
extra : moz-landing-system : lando
2019-04-30 01:35:30 +00:00
Zibi Braniecki
0e59a5d8f4 Bug 1544118 - Move nsINode::localize to use DocumentL10n::TranslateFragment. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D28269

--HG--
extra : moz-landing-system : lando
2019-04-24 10:35:37 +00:00
Boris Zbarsky
e5e9a70cac Bug 1541094. Mark PostHandleEvent as MOZ_CAN_RUN_SCRIPT. r=smaug
The change to the EventTargetChainItem constructor is because we're changing mTarget to be const (to avoid taking extra stack refs to the EventTarget), so have to set it in the constructor instead of setting it after creating the object.

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

--HG--
extra : moz-landing-system : lando
2019-04-02 19:06:11 +00:00
Boris Zbarsky
1c3e10afc5 Bug 1535384 part 1. Eliminate some easy cases of MOZ_CAN_RUN_SCRIPT_BOUNDARY on webidl callbacks. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D23771

--HG--
extra : moz-landing-system : lando
2019-03-19 05:24:39 +00:00
Sylvestre Ledru
4aa92e3091 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D22514
2019-03-13 10:19:06 +01:00
Emilio Cobos Álvarez
d073df2e6e Bug 1528675 - Rename NODE_CHROME_ONLY_ACCESS to NODE_HAS_BEEN_IN_UA_WIDGET, and use that to determine our wrapper scope. r=bzbarsky
It won't change then, even when removed from the UA Widget. It also gives us an
extra node bit.

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

--HG--
extra : moz-landing-system : lando
2019-02-21 18:39:28 +00:00
Brad Werth
81b95a3014 Bug 1521604 Part 2: Create a Node chrome-only parentFlexElement property, for use by devtools. r=dholbert,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D17308

--HG--
extra : moz-landing-system : lando
2019-02-01 22:29:34 +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
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
Peter Van der Beken
a17049feac Bug 1353867 - Change WindowProxy type. r=bzbarsky
Add a WindowProxyHolder type and generate binding code that takes or returns it whenever
the WebIDL refers to the WindowProxy type. This patch just makes the WindowProxyHolder
hold a strong reference to a nsPIDOMWindowOuter.

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

--HG--
extra : moz-landing-system : lando
2019-01-02 13:26:56 +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
Emilio Cobos Álvarez
5bc587436c Bug 1505887 - Fix FindChromeAccessOnlySubtreeOwner so that we handle UA widget being ChromeOnlyAccess root. r=smaug
A single video controls test crashed without this, while dereferencing
a null anonOwnerRelated in:

  https://searchfox.org/mozilla-central/rev/c0b26c40769a1e5607a1ae8be37fe64df64fc55e/dom/base/FragmentOrElement.cpp#964

I think this is the right fix for it, but the code that uses this is kind of
complex, so worth double-checking... :)
2018-11-27 13:26:20 +01:00
Razvan Maries
1a6559c239 Backed out 4 changesets (bug 1505887, bug 1509989) for failing crashtests on tests/layout/style/crashtests/1509989.html on a CLOSED TREE.
Backed out changeset dc6c022e9fe1 (bug 1509989)
Backed out changeset 490a99122a7f (bug 1505887)
Backed out changeset 7b9afff4ff11 (bug 1505887)
Backed out changeset 15da6e919d80 (bug 1505887)
2018-11-27 14:10:30 +02:00
Jonathan Watt
181d407b43 Bug 1510167. Mark some nsGkAtom* arguments as const in DOM code. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D13049

--HG--
extra : rebase_source : 66db700ce58e88ab95c24e9dbc70ba4815e94df1
2018-11-13 12:48:21 +00:00
Emilio Cobos Álvarez
3b96bec450 Bug 1505887 - Fix FindChromeAccessOnlySubtreeOwner so that we handle UA widget being ChromeOnlyAccess root. r=smaug
A single video controls test crashed without this, while dereferencing
a null anonOwnerRelated in:

  https://searchfox.org/mozilla-central/rev/c0b26c40769a1e5607a1ae8be37fe64df64fc55e/dom/base/FragmentOrElement.cpp#964

I think this is the right fix for it, but the code that uses this is kind of
complex, so worth double-checking... :)
2018-11-27 11:41:16 +01:00
Emilio Cobos Álvarez
9ed36d7ba6 Bug 1506547 - Align user-select behavior more with other UAs. r=mats
There's a few subtle behavior changes here, which I'll try to break down in the
commit message.

The biggest one is the EditableDescendantCount stuff going away. This
was added in bug 1181130, to prevent clicking on the non-editable div from
selecting the editable div inside. This is problematic for multiple reasons:

 * First, I don't think non-editable regions of an editable element should
   be user-select: all.

 * Second, it just doesn't work in Shadow DOM (the editable descendant count is
   not kept up-to-date when not in the uncomposed doc), so nested
   contenteditables behave differently inside vs. outside a Shadow Tree.

 * Third, I think it's user hostile to just entirely disable selection if you
   have a contenteditable descendant as a child of a user-select: all thing.

   WebKit behaves like this patch in the following test-case (though not Blink):

     https://crisal.io/tmp/user-select-all-contenteditable-descendant.html

   Edge doesn't seem to support user-select: all at all (no pun intended).

   But we don't allow to select anything at all which looks wrong.

 * Fourth, it's not tested at all (which explains how we broke it in Shadow DOM
   and not even notice...).

In any case I've verified that this doesn't regress the editor from that bug. If
this regresses anything we can fix it as outlined in the first bullet point
above, which should also make us more compatible with other UAs in that
test-case.

The other change is `all` not overriding everything else. So, something like:

  <div style="-webkit-user-select: all">All <div style="-webkit-user-select: none">None</div></div>

Totally ignores the -webkit-user-select: none declaration in Firefox before this
change. This doesn't match any other UA nor the spec, and this patch aligns us
with WebKit / Blink.

This in turn makes us not need -moz-text anymore, whose only purpose was to
avoid this.

This also fixes a variety of bugs uncovered by the previous changes, like the
SetIgnoreUserModify(false) call in editor being completely useless, since
presShell->SetCaretEnabled ended in nsCaret::SetVisible, which overrode it.

This in turn uncovered even more bugs, from bugs in the caret painting code,
like not checking -moz-user-modify on the right frame if you're the last frame
of a line, to even funnier bits where before this patch you show the caret but
can't write at all...

In any case, the new setup I came up with is that when you're editing (the
selection is focused on an editable node) moving the caret forces it to end up
in an editable node, thus jumping over non-editable ones.

This has the nice effect of not completely disabling selection of
-moz-user-select: all elements that have editable descendants (which was a very
ad-hoc hack for bug 1181130, and somewhat broken per the above), and also
not needing the -moz-user-select: all for non-editable bits in contenteditable.css
at all.

This also fixes issues with br-skipping like not being able to insert content in
the following test-case:

  <div contenteditable="true"><span contenteditable="false">xyz </span><br>editable</div>

If you start moving to the left from the second line, for example.

I think this yields way better behavior in all the relevant test-cases from bug
1181130 / bug 1109968 / bug 1132768, shouldn't cause any regression, and the
complexity is significantly reduced in some places.

There's still some other broken bits that this patch doesn't fix, but I'll file
follow-ups for those.

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

--HG--
extra : moz-landing-system : lando
2018-11-26 09:21:37 +00:00
Brindusan Cristian
31f0c21cca Backed out changeset 1575904619b5 (bug 1506547) for mochitest failures on test_reftests_with_caret.html. 2018-11-26 03:03:14 +02:00
Emilio Cobos Álvarez
b74c31e4d9 Bug 1506547 - Align user-select behavior more with other UAs. r=mats
There's a few subtle behavior changes here, which I'll try to break down in the
commit message.

The biggest one is the EditableDescendantCount stuff going away. This
was added in bug 1181130, to prevent clicking on the non-editable div from
selecting the editable div inside. This is problematic for multiple reasons:

 * First, I don't think non-editable regions of an editable element should
   be user-select: all.

 * Second, it just doesn't work in Shadow DOM (the editable descendant count is
   not kept up-to-date when not in the uncomposed doc), so nested
   contenteditables behave differently inside vs. outside a Shadow Tree.

 * Third, I think it's user hostile to just entirely disable selection if you
   have a contenteditable descendant as a child of a user-select: all thing.

   WebKit behaves like this patch in the following test-case (though not Blink):

     https://crisal.io/tmp/user-select-all-contenteditable-descendant.html

   Edge doesn't seem to support user-select: all at all (no pun intended).

   But we don't allow to select anything at all which looks wrong.

 * Fourth, it's not tested at all (which explains how we broke it in Shadow DOM
   and not even notice...).

In any case I've verified that this doesn't regress the editor from that bug. If
this regresses anything we can fix it as outlined in the first bullet point
above, which should also make us more compatible with other UAs in that
test-case.

The other change is `all` not overriding everything else. So, something like:

  <div style="-webkit-user-select: all">All <div style="-webkit-user-select: none">None</div></div>

Totally ignores the -webkit-user-select: none declaration in Firefox before this
change. This doesn't match any other UA nor the spec, and this patch aligns us
with WebKit / Blink.

This in turn makes us not need -moz-text anymore, whose only purpose was to
avoid this.

This also fixes a variety of bugs uncovered by the previous changes, like the
SetIgnoreUserModify(false) call in editor being completely useless, since
presShell->SetCaretEnabled ended in nsCaret::SetVisible, which overrode it.

This in turn uncovered even more bugs, from bugs in the caret painting code,
like not checking -moz-user-modify on the right frame if you're the last frame
of a line, to even funnier bits where before this patch you show the caret but
can't write at all...

In any case, the new setup I came up with is that when you're editing (the
selection is focused on an editable node) moving the caret forces it to end up
in an editable node, thus jumping over non-editable ones.

This has the nice effect of not completely disabling selection of
-moz-user-select: all elements that have editable descendants (which was a very
ad-hoc hack for bug 1181130, and somewhat broken per the above), and also
not needing the -moz-user-select: all for non-editable bits in contenteditable.css
at all.

This also fixes issues with br-skipping like not being able to insert content in
the following test-case:

  <div contenteditable="true"><span contenteditable="false">xyz </span><br>editable</div>

If you start moving to the left from the second line, for example.

I think this yields way better behavior in all the relevant test-cases from bug
1181130 / bug 1109968 / bug 1132768, shouldn't cause any regression, and the
complexity is significantly reduced in some places.

There's still some other broken bits that this patch doesn't fix, but I'll file
follow-ups for those.

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

--HG--
extra : moz-landing-system : lando
2018-11-25 20:01:07 +00:00
Boris Zbarsky
0b6d8f10c9 Bug 1503078. Simplify the Node event handler macros. r=smaug
The old setup made more sense when these were in fact NS_IMETHODs.
2018-10-31 14:19:50 -04:00
Boris Zbarsky
ba8cc6ef72 Bug 1500956 part 2. Change our EnsurePreInsertionValidity implementation to follow the spec more closely. r=smaug
This is basically putting in
https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity step 3
and moving step 4 to the right place in the order of steps.  This matters,
because step 3 throws a different exception from all the other steps.
2018-10-23 00:32:00 +02:00
Nathan Froyd
846d8789ee Bug 1492894 - part 1 - make the node hierarchy consistently constructed with NodeInfo&&; r=mccr8
Various places in dom/ use the pattern:

  already_AddRefed<NodeInfo> ni = ...;

which is supposed to be disallowed by our static analysis code, but
isn't, for whatever reason.  To fix our static analysis code, we need to
eliminate instances of the above pattern.

Unfortunately, eliminating this pattern requires restructuring how Nodes
are created.  Most Node subclasses take `already_AddRefed<NodeInfo>&` in
their constructors, and a few accept `already_AddRefed<NodeInfo>&&`.  We
need to enforce the latter pattern consistently, which requires changing
dozens of source files.
2018-09-21 16:45:49 -04:00
Olli Pettay
57b81277a0 bug 1483963, cache the index of a child node when ordering animations for event dispatch, r=hiro,ehsan
--HG--
extra : rebase_source : f98586625b199e7b2d0eb7db8dc9c1c5235289fe
2018-09-05 00:31:57 +03:00
Olli Pettay
e520af2423 Bug 1488359 - Inline GetPrevious/NextElementSibling, r=emilio 2018-09-04 13:35:16 +03:00
Emilio Cobos Álvarez
3b61137a4b Bug 1484478 - Use a node bit for connectedness. r=smaug
While trying to repro bug 1484293 I noticed that this assertion failed:

https://searchfox.org/mozilla-central/rev/ef8b3886cb173d5534b954b6fb7eb2d94a9473d0/dom/base/ShadowRoot.cpp#160

(during unlink, while unbinding the kids)

We rely on GetComposedDoc returning the right thing during unbind to cleanup
some stuff (see bug 1473637 for example), so it should probably be correct all
the time, regardless of whether something is unlinked or not.

Also this makes GetComposedDoc() much faster, which is nice too, since we call
it somewhat often.

I removed NodeHasRelevantHoverRules, since it's unused (was used by the old
style system).

I moved the SetIsConnected(false) call for the shadow root to before unbinding
the kids for consistency with what Element does with the uncomposed doc flag,
now that the children's connectedness doesn't depend on the shadow root's.

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

--HG--
extra : moz-landing-system : lando
2018-08-20 11:56:27 +00:00
shindli
b158b60c25 Backed out changeset 39f61de4e7bb (bug 1484478) for bustages in /builds/worker/workspace/build/src/dom/base/ShadowRoot.cpp:526:20 2018-08-20 14:21:08 +03:00
Emilio Cobos Álvarez
ac923a49c1 Bug 1484478 - Use a node bit for connectedness. r=smaug
While trying to repro bug 1484293 I noticed that this assertion failed:

https://searchfox.org/mozilla-central/rev/ef8b3886cb173d5534b954b6fb7eb2d94a9473d0/dom/base/ShadowRoot.cpp#160

(during unlink, while unbinding the kids)

We rely on GetComposedDoc returning the right thing during unbind to cleanup
some stuff (see bug 1473637 for example), so it should probably be correct all
the time, regardless of whether something is unlinked or not.

Also this makes GetComposedDoc() much faster, which is nice too, since we call
it somewhat often.

I removed NodeHasRelevantHoverRules, since it's unused (was used by the old
style system).

I moved the SetIsConnected(false) call for the shadow root to before unbinding
the kids for consistency with what Element does with the uncomposed doc flag,
now that the children's connectedness doesn't depend on the shadow root's.

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

--HG--
extra : moz-landing-system : lando
2018-08-19 18:22:48 +00:00
Timothy Guan-tin Chien
dab48182aa Bug 1431255 - Part V, Set the reflectors of the UA Widget DOM to UA Widget Scope r=bholley
The DOM elements within the UA Widget Shadow DOM should have its reflectors in
the UA Widget Scope. This is done by calling nsINode::IsInUAWidget() which
would check its containing shadow and its UA Widget bit.

To prevent JS access of the DOM element before it is in the
UA Widget Shadom DOM tree, various DOM methods are set to inaccessible to
UA Widget script. It would need to use the two special methods in ShadowRoot
instead to insert the DOM directly into the shadow tree.

MozReview-Commit-ID: Jz9iCaVIoij

--HG--
extra : rebase_source : b7b17be68dcde00cfeb207cb39cf16b486f2ab02
2018-06-29 13:39:46 -07:00