Commit Graph

45 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
58045500b8 Bug 1465572: Ensure <slot> disables whitespace optimizations. r=bz
The whitespace optimization code only knows about the light tree.

It's not a great idea to try to put flattened tree children of a slot through
there, since the children may not be assigned to the same slot, or to any slot
(in which case we crash).

We should probably rename XBLInvolved to ShadowDOMOrXBLInvolved too, I guess.
Note that the ShadowRoot case already sets the bit on Init().

MozReview-Commit-ID: 91lmE7OxlnA
2018-06-02 09:35:19 +02:00
Boris Zbarsky
152cd3ba6e Bug 1447098 part 1. Rename FromContent on various DOM classes to FromNode. r=mystor
MozReview-Commit-ID: 202nkbmkwfR
2018-03-21 17:39:04 -04:00
Emilio Cobos Álvarez
fae4d1bc87 Bug 1422653: Compute whether XBL is involved in ChildIterator lazily. r=mats
The only thing that cares about it is the frame constructor, it's a shame that
everyone else (in particular, the style system) needs to pay this extra walk
over the DOM.

MozReview-Commit-ID: F7S5zx9KMlp
2018-02-28 23:15:33 +01:00
Margareta Eliza Balazs
5cdf96402b Backed out changeset 283b2a4cb219 (bug 1422653) for bustage in /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:6840:26 on a CLOSED TREE 2018-02-28 12:25:31 +02:00
Emilio Cobos Álvarez
4b0099e37b Bug 1422653: Compute whether XBL is involved in ChildIterator lazily. r=mats
The only thing that cares about it is the frame constructor, it's a shame that
everyone else (in particular, the style system) needs to pay this extra walk
over the DOM.

MozReview-Commit-ID: F7S5zx9KMlp
2018-02-28 10:43:00 +01:00
Emilio Cobos Álvarez
99e5b9f573 Bug 1425759: Make ChildIterator handle Shadow DOM explicitly. r=smaug
I'll rename mIsXBLInvolved in a bit, since I plan to do more changes here in
bug 1422653.

MozReview-Commit-ID: JCeAgk2DoY4
2018-02-27 12:39:30 +01:00
Jessica Jong
1b8802d510 Bug 1428685 - Use dom.webcomponents.shadowdom.enabled pref for Shadow DOM. r=smaug
Most of the Shadow DOM related code are behind "dom.webcomponents.enabled" and
this pref is only used by Shadow DOM right now, so we should rename it to
"dom.webcomponents.shadowdom.enabled"

MozReview-Commit-ID: er1c7AsSSW
2018-01-16 17:16:30 +01:00
Emilio Cobos Álvarez
ba0cde9fc6 Bug 1426536: Remove nsContentUtils::IsContentInsertionPoint. r=smaug
We're not going to need it in Shadow DOM v1.

MozReview-Commit-ID: HOokTPlm2Wt
2017-12-20 22:45:19 +01:00
Jessica Jong
35cba086d7 Bug 1422931 - Part 2: Make webcomponents preference per-doc. r=smaug
This is to fix the case where preference is restore to false when a testcase
ends, but nsDocument::DeleteShell is called afterwards. So, we make the
preference per-doc and set it when the document is created. The value does not
change for the lifetime of the document.
2017-12-09 11:25:14 +08:00
Jessica Jong
c1c231786c Bug 1422931 - Part 1: Fix crash with slot element. r=smaug 2017-12-09 11:24:58 +08:00
Narcis Beleuzu
9c14a10d15 Backed out 2 changesets (bug 1422931) for crashtest failures on dom/base/crashtests/1419799.html r=backout on a CLOSED TREE
Backed out changeset 60d9744e3fc4 (bug 1422931)
Backed out changeset cf554d5d70cc (bug 1422931)
2017-12-08 18:27:56 +02:00
Jessica Jong
b940e53eb8 Bug 1422931 - Part 2: Make webcomponents preference per-doc. r=smaug
This is to fix the case where preference is restore to false when a
testcas ends, but nsDocument::DeleteShell is called afterwards. So, we
make the preference per-doc and once it is enabled for a document, it
stays enabled.
2017-12-08 22:17:40 +08:00
Jessica Jong
7fd704363c Bug 1422931 - Part 1: Fix crash with slot element. r=smaug 2017-12-08 22:17:33 +08:00
Jessica Jong
af2b401f6a 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
Olli Pettay
9ca325753f Bug 1418002 - Remove HTMLContentElement, r=jessica 2017-11-30 10:57:15 +02:00
Emilio Cobos Álvarez
a289950f9f Bug 1413619: Fix insertion point computation when display: contents pseudos are involved. r=mats,bz
This is a significant rework of how do we compute the insertion point of a
node.

We handle pseudos in the same function instead of out of band, and also recurse
up when the parent has display: contents, which simplifies the code IMO.

MozReview-Commit-ID: 1rSfv1Tq5gO
2017-11-04 11:58:16 +01:00
Olli Pettay
98580ecdff Bug 1396584 - Remove support for multiple ShadowRoots, r=mrbkap 2017-09-25 18:09:26 +03:00
Emilio Cobos Álvarez
6eeff31694 Bug 1397983: Synchronously bind/unbind XBL anonymous content from the bound content's Bind/UnbindFromTree. r=smaug
Doing it off a runnable makes the flattened tree inconsistent until that
runnable runs.

Also add an assert in frame construction that would've caught the first
only-unbind patch.

MozReview-Commit-ID: Hnua3aWSMHi
2017-09-08 14:59:04 +02:00
Cameron McCormack
592b59d3a2 Bug 1372061 - Remove unused StyleChildrenIterator::IsNeeded. r=bholley
MozReview-Commit-ID: LH8xZMrcdO1
2017-06-27 23:56:13 -07:00
Emilio Cobos Álvarez
be614d0d72 Bug 1371130: Move AllChildrenIterator::AppendNativeAnonymousChildren to nsContentUtils. r=heycam
MozReview-Commit-ID: E5kfdxEWTuf
2017-06-20 14:24:34 +02:00
Cameron McCormack
f694913449 Bug 1364361 - Part 2: Make AllChildIterator find NAC created by all of an element's anon boxes. r=bz,janx
MozReview-Commit-ID: IfTLBhhG1Ya
2017-06-16 17:22:34 +08:00
Sebastian Hengst
41be074887 Backed out changeset e9f7c901e132 (bug 1364361) 2017-06-16 11:18:27 +02:00
Cameron McCormack
e03661f1ab Bug 1364361 - Part 2: Make AllChildIterator find NAC created by all of an element's anon boxes. r=bz,janx
MozReview-Commit-ID: IfTLBhhG1Ya
2017-06-16 15:37:06 +08:00
Sebastian Hengst
2e914658c8 Backed out changeset cffde1d0ebb4 (bug 1364361) 2017-06-16 09:27:14 +02:00
Cameron McCormack
b3282b623e Bug 1364361 - Part 2: Make AllChildIterator find NAC created by all of an element's anon boxes. r=bz,janx
MozReview-Commit-ID: IfTLBhhG1Ya
2017-05-22 13:28:20 +08:00
Emilio Cobos Álvarez
e53de3d167 Bug 1331047: Require a child iterator for elements with ::before and ::after pseudos. r=bholley
MozReview-Commit-ID: e1UTlnNn3X
2017-04-27 17:09:50 +02:00
Emilio Cobos Álvarez
e3ee5f5400 Bug 1331047: Also traverse native anonymous content in the style system. r=bholley
MozReview-Commit-ID: 6wTqBAqTH69
2017-04-27 17:09:04 +02:00
Emilio Cobos Álvarez
7e1330401f Bug 1355351: Simplify nsLayoutUtils callers, and make child iterators notice display: contents pseudos. r=heycam
This also happens to fix other bugs, like making display: contents pseudos
animatable, which weren't before.

MozReview-Commit-ID: LhwTPNbFvSZ
2017-04-19 12:53:57 +02:00
Boris Zbarsky
b26328d6e6 Bug 1345362 part 3. Introduce CSSPseudoElementType::NonInheritingAnonBox to represent non-inheriting anon boxes. r=heycam
The idea is to be able to call the right function during style resolution time
without doing a linear walk via nsCSSAnonBoxes::IsNonInheritingAnonBox.

MozReview-Commit-ID: JKt33GggTjz
2017-03-08 23:41:04 -05:00
Cameron McCormack
b4a991df43 Bug 1321284 - Part 4: Factor out AllChildrenIterator's getting of document level NAC to a utility method. r=bholley
MozReview-Commit-ID: 862Yi82D2Ij
2016-12-03 09:37:00 +08:00
Cameron McCormack
3072a80842 Bug 1321284 - Part 1: Make StyleChildrenIterator skip NAC generated by root element primary frame ancestors. r=bholley
MozReview-Commit-ID: HICYWQgkE77
2016-12-01 11:34:57 +08:00
Boris Zbarsky
8bef5cc522 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
2545e5355a 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
830abc700c Bug 1309868 part 1 - Use const nsIContent pointer in some DOM utils. r=bholley
MozReview-Commit-ID: H4g2VbWJUba
2016-10-18 15:29:03 +11:00
Bobby Holley
c9a2c5ee2d Bug 1292662 - Modify StyleChildIterator::IsNeeded to handle the root scroll frame. r=heycam 2016-08-25 21:36:53 -07:00
Bobby Holley
b39340a6c0 Bug 1292662 - Add an API for the Servo style system to traverse anonymous children. r=heycam 2016-08-25 21:36:43 -07:00
Bobby Holley
6cf3bcf72d Bug 1297572 - Handle the root scroll frame in AllChildrenIterator. r=heycam 2016-08-25 21:34:23 -07:00
Alexander Surkov
33d71f96f8 Bug 1253834 - add AllChildrenIterator::Get(), r=bz 2016-03-08 15:54:46 -05:00
Alexander Surkov
b9ed2dd17f Bug 1249443 - add AllChildrenIterator::GetPreviousChild, r=bz 2016-03-05 16:11:21 -05:00
Alexander Surkov
6432a988a5 Bug 1247364 - add AllChildrenIterator::Seek, r=bz 2016-02-11 08:22:39 -05:00
Boris Zbarsky
7b9ae9826e Bug 1201692. Add a fast path to ExplicitChildIterator::Seek for the common case of seeking an actual DOM child of the parent node. r=wchen 2015-09-08 21:23:55 -04:00
Birunthan Mohanathas
a29151dc87 Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Andrew McCreight
92010d3e4c Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Andrea Marchesini
6b10d5e43e Bug 1134280 - Get rid of Tag() - patch 1 - Is{HTML,XUL,MathML,SVG}Element and IsAnyOf{HTML,XUL,MathML,SVG}Elements, r=smaug 2015-03-03 11:08:59 +00:00
Birunthan Mohanathas
e9068bbc4f Bug 946065 - Part 12: Move content/base/ to dom/ and flatten subdirectories. r=peterv 2014-10-25 20:25:22 +03:00