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

64 Коммитов

Автор SHA1 Сообщение Дата
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
Nicholas Nethercote d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Catalin Badea f8162c4bfd Bug 651120 - Remove index argument from content removed/appended/inserted notifications. r=peterv 2017-10-03 11:09:08 +01:00
Olli Pettay c80e124562 Bug 1396584 - Remove support for multiple ShadowRoots, r=mrbkap
--HG--
extra : rebase_source : 2bb600ed1ffd35c195617a7eb70d0ba847a46898
2017-09-25 18:09:26 +03:00
Olli Pettay 3330aa8d71 Bug 1396568 - Make DocumentFragment::mHost a strong reference (so that ShadowRoot.host doesn't become null), r=mrbkap 2017-09-06 09:37:17 +01:00
Andrew McCreight 78807d8776 Bug 1391005 - Eliminate NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED. r=peterv
Replace it with NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION, because it
has been the same for a while.

MozReview-Commit-ID: 5agRGFyUry1

--HG--
extra : rebase_source : 5388c56b2f6905c6ef969150f0c5b77bf247624d
2017-08-29 16:02:48 -07:00
Olli Pettay 0738714332 Bug 1377993 - Make node slots less memory hungry in common cases. r=peterv
MozReview-Commit-ID: Lhr1UsCrRTs
2017-07-18 00:25:49 +02:00
Kirk Steuber 7fdb378650 Bug 1359556 - Optimize cloneNode by preinitializing attribute and child arrays r=bz
Currently, attribute and child arrays (implemented in dom/base/nsAttrAndChildArray.h) start out empty. When cloning, the array ends up being resized multiple times in order to add the attributes and children that are being cloned from the original node. This would be quicker if the array was initialized to the correct size in the first place so that resizes are not necessary.

However, preallocating space for children is only necessary when performing a deep clone. Therefore, an additional parameter is being added to the Clone, CopyInnerTo, and CloneDocHelper methods to indicate whether preallocation of children should happen. Attributes are copied either way, so that part of the array is preallocated in both cases.

MozReview-Commit-ID: 3iVezeAKXnI

--HG--
extra : rebase_source : 9c3deec6d7aafd6411044d623d4863637b45fd58
2017-04-20 12:57:48 -07:00
Olli Pettay 66df8dc927 Bug 1355787, nsIdentifierMapEntry should let one to use either strings or atoms as keys to avoid slow string assignments when possible. r=nfroyd
--HG--
extra : rebase_source : 3e8c53462e4ed19ecaf611b7618a132d8606c0ae
2017-04-13 22:12:20 +03:00
Andrew McCreight fccb0645ed Bug 1323042 - forbid MOZ_COUNT_{CTOR,DTOR} for nsISupports classes; r=froydnj 2016-12-12 09:27:58 -05:00
Nathan Froyd 826598caba Backout aba6c73511a2 (bug 1307961) for massive test bustage resulting in a CLOSED TREE; r=alltheorange 2016-12-12 08:45:46 -05:00
Andrew McCreight e31b5489da Bug 1307961 - require consistent bloatview reporting for nsISupports classes; r=froydnj 2016-12-12 07:58:33 -05:00
Boris Zbarsky 23cc88e459 Bug 1319255 part 2. Stop doing casts to HTMLContentElement* simply based on tag. r=wchen 2016-11-22 22:41:51 -05:00
Boris Zbarsky 3e49872974 Bug 1319255 part 1. Stop doing casts to HTMLShadowElement* simply based on tag. r=wchen 2016-11-22 22:41:51 -05:00
Xidorn Quan ea2d289c2c Bug 1292432 part 9 - Change WebIDL interface of CSSStyleSheet to StyleSheet. r=heycam
MozReview-Commit-ID: 5AXhsuvvrwe

--HG--
extra : source : 218d4c72938f74f16af22239a99fbdf0e4c621cf
2016-10-14 22:25:38 +11:00