Commit Graph

83 Commits

Author SHA1 Message Date
Andreea Pavel
7062e6b6a2 Merge mozilla-inbound to mozilla-central. a=merge 2018-03-20 00:39:56 +02:00
Emilio Cobos Álvarez
a93be87a5c Bug 1446507: Don't unnecessarily notify the document for shadow style changes if it's not in the document. r=xidorn
Summary:
When the host is bound to the document, it'll also re-BindToTree the shadow
tree, which will update the stylesheets and all that.

Reviewers: xidorn

Bug #: 1446507

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

MozReview-Commit-ID: fBLq5owB7U
2018-03-19 13:56:53 +01:00
Emilio Cobos Álvarez
5caaf1c9f3 Bug 1445682: Make Shadow DOM account for stylesheet applicableness correctly. r=xidorn
Summary:
Also, make stuff sound in presence of CSSOM and what not.

The dirty: false thing is reverting an accidental change that landed in the
de-XBL stuff, which was harmless, but now wouldn't let me assert stuff properly.

Reviewers: xidorn

Bug #: 1445682

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

MozReview-Commit-ID: K0W2Rv0qK8X
2018-03-19 15:50:31 +01:00
Emilio Cobos Álvarez
d44be89a37 Bug 1438210: Make slot assignment sound with layout after bug 1409975. r=smaug
Summary:
Before that bug, we carefully told layout about all distribution changes before
they happened, so layout could cleanup frames and styles synchronously properly
(since otherwise there's no way afterwards to figure out what the tree shape
was).

That bug made it not do it correctly, causing this.

I obviously need to write a bunch of tests for this...

Reviewers: smaug

Bug #: 1438210

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

MozReview-Commit-ID: 8uupNhoFwme
2018-03-14 10:54:28 +01:00
Olli Pettay
3faf40c897 Bug 1425864 - Ensure printing documents which have ShadowDOM works, r=mrbkap,emilio 2018-03-04 19:41:13 +09:00
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