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

78 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 2988d4e66d Bug 1442207: Remove unneeded arguments to nsIMutationObserver. r=smaug
aDocument is always content->OwnerDoc().
aContainer is always content->GetParent().

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

MozReview-Commit-ID: 4xwPCOnhyIL
2018-03-01 22:45:17 +01:00
Emilio Cobos Álvarez 6c417367d6 Bug 1425759: Make Shadow DOM not use XBL anymore. r=smaug,xidorn
More improvements to come. In particular, this still iterates through Shadow DOM
in each_xbl_cascade_data, but that should be changed later. That allows to
cleanup a bunch of stuff and finally fix Shadow DOM cascade order.

We still rely on the binding parent to be setup properly in the shadow tree, but
that requirement can go away later (we can walk the containing shadow chain
instead).

This mostly focuses on removing the XBL binding from the Shadow host.

It'd be nice to do EnumerateShadowRoots faster. I think that should also be a
followup, if needed.

MozReview-Commit-ID: Jf2iGvLC5de
2018-02-27 12:39:35 +01:00
Emilio Cobos Álvarez 02b71da95a Bug 1441014: Deindent / Simplify some code for slot removal. r=smaug
MozReview-Commit-ID: LcbZSXnbVLL

--HG--
extra : rebase_source : 4837bad53294892b7b625f565e99b14a75cb3a5c
2018-02-25 17:33:28 +01:00
Emilio Cobos Álvarez 30b133d3c7 Bug 1439223: Stop ShadowRoot::Host from being a useless function call. r=smaug
Also, change DocumentFragment to use RefPtr, since that's the usual style.

MozReview-Commit-ID: 4PQ19nbmhUh

--HG--
extra : rebase_source : 2afb214b764ba48a4a8718190a6853ae6d6ea80b
2018-02-18 14:33:14 +01:00
Emilio Cobos Álvarez 6dd24e93ac Bug 1439016: Remove dead code from Shadow DOM v0. r=bholley
Could do that on a different bug but...

MozReview-Commit-ID: L1ri2s8z75f

--HG--
extra : rebase_source : cfdd998081cb8ef49cc5e66801fc706774f5497a
2018-02-19 18:15:38 +01:00
Emilio Cobos Álvarez cc5a1b6c85 Bug 1439224: Make shadow root style changes not restyle the whole document. r=xidorn
Also, make them not rebuild the CascadeData synchronously, via the
FlushSkinSheets call, since that's broken. That fixes bug 1413119.

This is a little step in getting rid of XBL usage for Shadow DOM.

MozReview-Commit-ID: HJ7FeUZlRTW

--HG--
extra : rebase_source : 0fcd0ed461856c1e87e45ef63c9e1d2e81281469
2018-02-18 14:35:57 +01:00
Andreea Pavel a403fc3f13 Merge mozilla-central to mozilla-inbound. on a CLOSED TREE 2018-02-15 12:37:30 +02:00
Olli Pettay b9ac198b01 Bug 1413102 - Ensure Shadow DOM boundaries are dealt properly in event handling, r=masayuki 2018-02-15 12:08:42 +02:00
Dorel Luca 12fe7a2577 Backed out changeset 2320b7fd9266 (bug 1413102) for Mochitest failure on dom/tests/mochitest/pointerlock/test_pointerlock-api.html 2018-02-14 20:44:19 +02:00
Emilio Cobos Álvarez bdc288daf0 Bug 1438129: Remove ShadowRoot.applyAuthorStyles. r=smaug
MozReview-Commit-ID: E7xk2V78ssq

--HG--
extra : rebase_source : a5be8d3b9cb5543c47f03f91798315f03939c994
2018-02-14 11:41:40 +01:00
Boris Zbarsky 7c392f077e Bug 1418085 part 6. Remove nsIDOMHTMLElement. r=mystor
MozReview-Commit-ID: 5QUyFeAQYZQ
2018-01-30 00:25:36 -05:00
Olli Pettay 6a7af9eddf Bug 1413102 - Ensure Shadow DOM boundaries are dealt properly in event handling, r=masayuki
--HG--
extra : rebase_source : 72130abec4634f60f9c8f9b9bcd7630ef26097e1
2018-02-14 14:16:15 +02:00
Jessica Jong bf1d5c0073 Bug 1429656 - Implement ShadowRoot.activeElement. r=smaug 2018-01-15 14:42:47 +08:00
Jessica Jong 20d2281c59 Bug 1429982 - cloneNode on ShadowRoot interface should throw NotSupportedError. r=smaug
The spec changed in order to align with the error thrown by importNode.

--HG--
rename : dom/tests/mochitest/webcomponents/test_bug1176757.html => dom/tests/mochitest/webcomponents/test_shadowroot_clonenode.html
2018-01-15 14:42:43 +08:00
Emilio Cobos Álvarez 198b044d86 Bug 1428053: Fix ShadowRoot::ContentAppended. r=jessica
MozReview-Commit-ID: iUhaP8VVIO
2018-01-05 11:18:18 +01:00
Emilio Cobos Álvarez 90f6f7ae08 Bug 1428053: Use Maybe<uint32_t> instead of an integer and a bool. r=jessica
This is just cleanup and not needed, but I wrote it while debugging so I'd
rather land it :)

MozReview-Commit-ID: BdnheDnwHr4
2018-01-05 11:18:16 +01:00
Emilio Cobos Álvarez 1cda1ad876 Bug 1427511: Make GetFlattenedTreeParent more straight-forward. r=smaug
Now that accessing nsIContent slots is not a blob of virtual function calls, we
should be able to unify logic here, and speed up the not-so-rare case for
chrome, while keeping the usual case fast.

MozReview-Commit-ID: 87iY5Cbhx4T
2018-01-02 18:00:25 +01:00
Emilio Cobos Álvarez c8eb630ebe Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W
2017-12-25 17:50:10 +01:00
Emilio Cobos Álvarez ffdf5d2cb5 Backout changeset e43f568b3e9a (bug 1423990) because some OSX-only code still doesn't build. r=me 2017-12-25 12:55:45 +01:00
Emilio Cobos Álvarez c0959b2955 Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W

--HG--
extra : rebase_source : 09b82acb4f3d69e8a4345457ab217443bc28d6e2
2017-12-07 19:13:50 +01:00
Emilio Cobos Álvarez 9db998a70b Bug 1426494: s/StyleScope/DocumentOrShadowRoot. r=smaug
MozReview-Commit-ID: DsFPlQMGAyv
2017-12-22 01:56:36 +01:00
Emilio Cobos Álvarez d5196e4079 Bug 1426494: Share more code among Document / ShadowRoot. r=smaug
MozReview-Commit-ID: C4cJrSFPnIb
2017-12-22 01:56:17 +01:00
Emilio Cobos Álvarez 041202a4fc Bug 1426494: Devirtualize StyleScope::AsNode. r=smaug
MozReview-Commit-ID: 2nDEI5aIu46
2017-12-22 01:56:16 +01:00
Sebastian Hengst f1ca246ee0 merge mozilla-central to mozilla-inbound. r=merge a=merge 2017-12-21 13:41:45 +02:00
Cosmin Sabou 4620ebda6e Backed out 3 changesets (bug 1426494) for build bustages on dom/base/FuzzingFunctions.h:25:44 r=backout on a CLOSED TREE
Backed out changeset 8d07cb1ef232 (bug 1426494)
Backed out changeset 74a8ebb0f5d3 (bug 1426494)
Backed out changeset 07c4aa18a0b6 (bug 1426494)
2017-12-21 03:09:22 +02:00
Emilio Cobos Álvarez d58883c70b Bug 1426494: s/StyleScope/DocumentOrShadowRoot. r=smaug
MozReview-Commit-ID: DsFPlQMGAyv
2017-12-21 00:24:28 +01:00
Emilio Cobos Álvarez 7e7dee971b Bug 1426494: Share more code among Document / ShadowRoot. r=smaug
MozReview-Commit-ID: C4cJrSFPnIb
2017-12-21 00:24:27 +01:00
Emilio Cobos Álvarez 85d3328fea Bug 1426494: Devirtualize StyleScope::AsNode. r=smaug
MozReview-Commit-ID: 2nDEI5aIu46
2017-12-21 00:24:26 +01:00
Emilio Cobos Álvarez 27c288f0e2 Bug 1426536: Remove nsContentUtils::IsContentInsertionPoint. r=smaug
We're not going to need it in Shadow DOM v1.

MozReview-Commit-ID: HOokTPlm2Wt

--HG--
extra : rebase_source : 2f746eafb9fa2b14cfe05233d67bf34b80105a44
2017-12-20 22:45:19 +01:00
Emilio Cobos Álvarez aff5090202 Bug 1425769: Base class for ShadowRoot and Document to manage style state. r=smaug
This also removes some confusing comments around nsIDocument regarding some kind
of "special" stylesheets, which don't seem to exist anymore, and consolidates
StyleSheetList so that we only have one implementation.

I think that fixes a potential leak on the shadow root code (even though the API
is v0 only), given the pointer from the ShadowRootStyleSheetList to the
ShadowRoot wasn't being CCd.

Also, more stuff could be renamed, methods removed, etc, feel free to suggest
more cleanup, I've done mostly the minimal.

Next steps are moving the stylesets there and stop using the proto binding sheet
list / resources.

MozReview-Commit-ID: D9hnDgPQAS5
2017-12-19 11:09:59 +01:00
Dorel Luca e968e809aa Backed out changeset 13faabcf8e96 (bug 1425769) for Linux bustage on build/src/dom/base/nsLineBreaker.h 2017-12-19 11:07:44 +02:00
Emilio Cobos Álvarez 5ae586e759 Bug 1425769: Base class for ShadowRoot and Document to manage style state. r=smaug
This also removes some confusing comments around nsIDocument regarding some kind
of "special" stylesheets, which don't seem to exist anymore, and consolidates
StyleSheetList so that we only have one implementation.

I think that fixes a potential leak on the shadow root code (even though the API
is v0 only), given the pointer from the ShadowRootStyleSheetList to the
ShadowRoot wasn't being CCd.

Also, more stuff could be renamed, methods removed, etc, feel free to suggest
more cleanup, I've done mostly the minimal.

Next steps are moving the stylesets there and stop using the proto binding sheet
list / resources.

MozReview-Commit-ID: D9hnDgPQAS5

--HG--
extra : rebase_source : 0597917521894288c6b749e5d3ac6ac3b7db44a0
2017-12-17 22:29:10 +01:00
Olli Pettay d78d3295c5 Bug 1412775 - Implement Event.composedPath, r=stone
--HG--
extra : rebase_source : a970c4a0daac4a7a02cec34733131734eb93b151
2017-12-18 18:07:36 +02:00
Jessica Jong 9dcbb9b211 Bug 1409976 - Part 2: Signal `slotchange` when slot's assigned nodes changes. r=smaug
MozReview-Commit-ID: FBeeDE7UIAu
2017-12-19 23:16:33 +08:00
Jessica Jong fbd3a63cba Bug 1409975 - Part 3: Fix event get-the-parent algorithm for a node. r=smaug 2017-12-04 16:06:40 +08:00
Jessica Jong 306e4bafc3 Bug 1409975 - Part 2: Include slots in the flat tree. r=smaug,emilio
We should consider slot as a parent in ChildIterator: if slot's
`assignedNodes` is not empty, use `assignedNodes`, otherwise, use direct
children as fallback content.
Also, GetFlattenedTreeParentNodeInternal should be changed to use
`assignedSlot` instead of `DestInsertionPoints`.
2017-12-04 16:06:37 +08:00
Jessica Jong adc29479a2 Bug 1409975 - Part 1: Implementation for assignedNodes. r=smaug
Set and unset assignedNodes properly when slot is added/removed and when
slotables are added/removed/modfied. Note that assigedNodes with
flatten: true is calculated on demand.
2017-12-04 16:06:34 +08:00
Olli Pettay af3373dc1d Bug 1418002 - Remove HTMLContentElement, r=jessica 2017-11-30 10:57:15 +02:00
Ben Tian a4fe26d361 Bug 1404842 - P1: Implement Element.attachShadow and Element.slot, r=smaug
MozReview-Commit-ID: KWy8mDqEw4o

--HG--
extra : rebase_source : d8378628b8f7028f6b3600c5abd20dc4fc6a9ccb
2017-10-19 14:44:35 +08:00
Emilio Cobos Álvarez 4deb3bee3b Bug 1411754: Rename PresShell::DestroyFramesFor to DestroyFramesForAndRestyle. r=mats
I'm drive-by removing the comment about the frame tree state because I looked
into it, and the answer is: we properly restore it.

The gotcha is that we retain it too much, indeed, we retain it enough that it
can leak. See bug 1397239.

MozReview-Commit-ID: LP6bXkduEZ4

--HG--
extra : rebase_source : f7e18fc35e48b75c07fcc84b939614d379926828
2017-10-25 23:12:25 +02:00
Emilio Cobos Álvarez 24e65c29e3 No bug - Remove FIXME that doesn't really apply. r=comment-only
See the explanation in bug 1404789 comment 53.

DONTBUILD because it's removing a comment.
MozReview-Commit-ID: KJEI3G4Mv96
2017-10-25 23:07:32 +02:00
Emilio Cobos Álvarez 235a90daa7 Bug 1409088: followup: Reword no longer accurate part of the comment in RemoveDestInsertionPoint. r=me
MozReview-Commit-ID: 2gbxreSgkqi
2017-10-20 00:24:44 +02:00
Emilio Cobos Álvarez 15c0252093 Bug 1404789: Be a bit better at detecting distribution changes. r=bz
MozReview-Commit-ID: JqutdNJURZU

--HG--
extra : rebase_source : 7ce5d43c108ed97e7d9f377471d9741a892c2142
2017-10-18 16:03:41 +02:00
Emilio Cobos Álvarez e912891dc7 Bug 1404789: Simplify ShadowRoot::IsPooledNode. r=bz
MozReview-Commit-ID: EDUwUmca7Qv

--HG--
extra : rebase_source : 72e8b19b0613b37995699857a518d53af3ebce0a
2017-10-18 15:02:16 +02:00
Emilio Cobos Álvarez 737044cfd3 Bug 1404789: When the shadow tree distribution changes, post a restyle + reframe. r=bz
MozReview-Commit-ID: DvRb22UfnJ4

--HG--
extra : rebase_source : 5e1d76f7e1c28c6d2117c3fe358a90778933f03c
2017-10-18 15:24:53 +02:00
Emilio Cobos Álvarez 67ccc345f4 Bug 1404789: Cleanup a bit the ShadowRoot code. r=bz
MozReview-Commit-ID: 8mTrXbbefX2

--HG--
extra : rebase_source : f88e255ddffd5b0a9c9b2ea52144ebb08df05233
2017-10-17 18:22:29 +02:00
Emilio Cobos Álvarez bce283e551 Bug 1409088: Fix destination insertion point removal algorithm. r=bz
When an insertion point (a) is added to the document before another insertion
point (b), and that insertion point matches nodes that used to match (b), the
following happens in RedistributeAllNodes:

 * Loop through (a), and clear the existing insertion points on nodes
   distributed into it (none, since it was just inserted).

 * Go through the node pool and add the matched nodes. That makes the node
   (which already had (b) in the insertion point array) have [(b), (a)] as the
   insertion points.

 * Go through (b), and clear the existing insertion points on the nodes
   distributed to it. That used to do IndexOf() + SetLength(), but since (b) was
   the first node by then in the insertion point array, we'll leave the
   insertion point array empty, while (a) would still think that the node is
   distributed to it.

This causes the bloom filter code, which loops through the flattened tree
parents, to not insert any (because the node doesn't know about where it's
inserted).

Also, add a debug phase to verify the flat tree before restyling that would've
caught this more clearly (happy to remove it if you don't think it's worth).

We still can't assert that the insertion point is properly referenced due to the
hacky way mInsertionPoints is cleared in
HTMLContentElement::UpdateFallbackDistribution, but we'll still clear the
insertion points either there, or on the rest of insertion point removal code in
ShadowRoot::DistributeAllNodes.

MozReview-Commit-ID: 9k2gnsAKMEe

--HG--
extra : rebase_source : 7e8371199bde8148d77cb69417a8dd8b1ee77078
2017-10-19 14:45:16 +02:00
Boris Zbarsky 3fc7b4c919 Bug 1324463. Fix crash when xbl:children is stuck into shadow DOM. r=smaug
MozReview-Commit-ID: C602pPbIfih
2017-10-11 22:19:10 -04:00
Sebastian Hengst bf13779eda Backed out changeset 76fb9cb1078c (bug 1324463) for failing own crashtest in non-stylo builds. r=backout on a CLOSED TREE
--HG--
extra : amend_source : 41a2653de93c450e89a005beb532177cf224eea7
2017-10-12 09:42:53 +02:00
Boris Zbarsky fb61ca8219 Bug 1324463. Fix crash when xbl:children is stuck into shadow DOM. r=smaug
MozReview-Commit-ID: C602pPbIfih
2017-10-11 22:19:10 -04:00