Commit Graph

389 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
7a3fb0690f Bug 1419554: Teach the restyle root code about elements outside of the flattened tree. r=heycam
The textarea is inserted under a Shadow host, with no matching insertion point,
so its flattened tree parent node is null.

We're treating this case in the restyle root code as "the parent is the
document", but that's very wrong.

MozReview-Commit-ID: JlzUMRIYaYZ
2017-11-22 14:15:34 +01:00
Hiroyuki Ikezoe
49d07e92ed Bug 1418867 - Pass element or pseudo element to Servo_StyleSet_GetBaseComputedValuesForElement(). r=emilio
MozReview-Commit-ID: Ae3iZ6g3x3c
2017-11-22 11:03:40 +09:00
Emilio Cobos Álvarez
385aa3e51f Bug 1414999: Synchronously clean style data from the DOM tree when the shell goes away. r=bz
There's nothing preventing the flat tree from changing while the document
doesn't have a shell. In that case, we really really don't want to lose track
of elements with stale style data, since then we'll mess up.

It's ok to _not_ clear the style data when the document goes into the BFCache
though, because the document is thrown away if other document runs script and
touches the cached DOM.

MozReview-Commit-ID: 4W3xDAnnLPL
2017-11-20 22:11:23 +01:00
Emilio Cobos Álvarez
96999a49a2 Bug 1418456: Get rid of unstyled children only traversals. r=heycam
They're useless now, provided we remove the hack to not traverse XBL-bound
elements on initial styling.

This also allows us to get rid of the fallback case.

MozReview-Commit-ID: AvBVdyF1wb6
2017-11-20 13:05:35 +01:00
Emilio Cobos Álvarez
83f112b922 Bug 1418456: Clear subtree element data when applying an XBL binding. r=heycam
We not only need to care about children getting inserted in the flat tree, but
also about children moving _out_ of the flat tree.

In particular, as of right now we may leave stale data on elements when they
disappear from the flattened tree.

We're lucky enough that in 99% of the situations we enter in[1] and that clears
all the stuff, including servo data. But my assertions for bug 1414999 caught
the template / observes case.

Thus, just clear the whole bound element subtree data, and restyle it in the
end, no need for StyleNewChildren. This matches what we do for shadow DOM
(though in the shadow DOM case we do it async in DestroyFramesForAndRestyle).

[1]: https://searchfox.org/mozilla-central/rev/9bab9dc5a9472e3c163ab279847d2249322c206e/dom/xbl/nsXBLBinding.cpp#368

MozReview-Commit-ID: 69A0aR0AFfU
2017-11-20 13:02:24 +01:00
Cameron McCormack
d0d7e8523c Bug 1418222 - Move system metrics handling to nsMediaFeatures. r=TYLin
MozReview-Commit-ID: 25yWc29Wt4R
2017-11-17 15:35:26 +08:00
Cameron McCormack
df2d3f6c03 Bug 1418216 - Move IsCSSSheetType out of nsStyleSet. r=TYLin
MozReview-Commit-ID: 6OV5WHX4INb
2017-11-16 09:37:17 +08:00
Xidorn Quan
c3a97dac83 Bug 1417220 - Force re-resolve style for doc element when binding requires so. r=emilio
MozReview-Commit-ID: DdbpZnk7tCZ
2017-11-15 15:39:29 -08:00
Emilio Cobos Álvarez
e3c0dbc2b2 No bug - Remove unused variable. r=me
MozReview-Commit-ID: EuOqz9FLJyy
2017-11-02 06:36:45 +01:00
Cameron McCormack
e993a0b1a2 Bug 1390694 - Part 1: Add ServoStyleSet function for checking document state dependencies. r=emilio
MozReview-Commit-ID: G8Ju8yHtYx6
2017-11-01 21:20:39 +11:00
Attila Craciun
9e796516c6 Backed out 4 changesets (bug 1390694) for failing crash test and in reftest/tests/layout/reftests/xul/mac-tab-toolbar.xul r=backout on a CLOSED TREE.
Backed out changeset b9cff3469bfd (bug 1390694)
Backed out changeset e13dd2a3651f (bug 1390694)
Backed out changeset 83ff9e245757 (bug 1390694)
Backed out changeset 484a2644318f (bug 1390694)
2017-10-20 14:49:52 +03:00
Xidorn Quan
6366a6297e Bug 1397644 part 1 - Implement XUL tree pseudo style resolution for stylo. r=emilio
MozReview-Commit-ID: 5JqvLv3tt5m
2017-10-20 21:31:13 +11:00
Cameron McCormack
2fa43910b3 Bug 1390694 - Part 1: Add ServoStyleSet function for checking document state dependencies. r=emilio
MozReview-Commit-ID: G8Ju8yHtYx6
2017-10-18 17:26:08 +08:00
Boris Chiou
3ec629e381 Bug 1303235 - Part 1: Add ResolveServoStyleByAddingAnimation. r=hiro
We need to create a temporary ServoStyleContext with the animation value for
calculating the Cumulative change hints.

MozReview-Commit-ID: JzArnaGqVeV
2017-10-19 10:51:55 +08:00
Hiroyuki Ikezoe
f9c63e1497 Bug 1407463 - Drop unused pseudo atom argument from GetBaseContextForElement. r=heycam
MozReview-Commit-ID: JJ2Jh1I6y4h
2017-10-11 10:00:37 +09:00
Hiroyuki Ikezoe
f50a03dd72 Bug 1407463 - Drop unused pseudo atom argument from ResolveStyleLazily and ResolveStyleLazilyInternal. r=heycam
MozReview-Commit-ID: Lmjqbr7QsTU
2017-10-11 10:00:28 +09:00
Hiroyuki Ikezoe
1d539ae3a1 Bug 1405544 - Propagate existing bits to the parent element as well when switch the restyle root for invalidation siblings in post-traversal. r=emilio
MozReview-Commit-ID: 8Rmg2FSytlp
2017-10-10 10:05:54 +09:00
Hiroyuki Ikezoe
f0a38025cf Bug 1329169 - Use atom for animation-name property. r=xidorn
MozReview-Commit-ID: 9yVWXVi1oXf
2017-10-10 17:00:28 +09:00
Nicholas Nethercote
7dbfdaf890 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
2017-10-03 09:05:19 +11:00
Hiroyuki Ikezoe
0f37fa04d1 Bug 1406284 - Remove unused parent context argument. r=heycam
MozReview-Commit-ID: A1yIOZ1bWjY
2017-10-06 13:51:02 +09:00
Brad Werth
4a834ef67f Bug 1374181 Part 1: Don't attempt EnsureUniqueInner on incomplete sheets in a StyleSet. r=xidorn
One remaining issue is that requesters of CSSRules might also want to know if those rules are complete, and to listen for completion if the rules are incomplete. Bug 1404538 will fix this up at least for devtools.

MozReview-Commit-ID: COnkS40Ooe2
2017-10-03 11:15:26 -07:00
Bobby Holley
b1404a6cc6 Bug 1403397 - Revert: Add a testing API. r=bholley
This reverts commit 4194b7dd8ec748c044a9b8b0967fd9d652ea342c.
2017-10-03 14:05:56 -07:00
Bobby Holley
9176b13fd1 Bug 1403397 - Add a testing API. r=bz,r=Manishearth
This will allow us to verify the entire detection pipeline in real nightly
builds, which will give us confidence that real heap corruption will be
detected and reported properly.

MozReview-Commit-ID: 43Fp2HT8RYy
2017-09-28 18:23:15 -07:00
Emilio Cobos Álvarez
aa36c63d88 Bug 1403078: Lazily tweak the traversal root to account for sibling invalidations. r=heycam
MozReview-Commit-ID: Ij3nMOKu5FO
2017-09-26 14:20:11 +02:00
Bobby Holley
484427be27 Bug 1402285 - Don't try to cache pseudo styles with an unstyled originating element. r=emilio
MozReview-Commit-ID: C4JNZFtYHBH
2017-09-22 18:02:24 -07:00
Bobby Holley
1f8e1325c1 Bug 1401317 - Disable lazy pseudo caching when the originating element's primary style was reused via the rule node. r=emilio
MozReview-Commit-ID: IkBa39E1bR1
2017-09-20 10:09:59 -07:00
Bobby Holley
f468a30435 Bug 1400435 - Use a more precise check in the nsCSSValue destructor. r=xidorn
MozReview-Commit-ID: KFdgtxyOZ01
2017-09-19 22:53:23 -07:00
Nicholas Nethercote
7ba62ed662 Bug 1400078 - Measure the UA cache. r=njn.
ServoStyleSetSizes now has two uses, one for the Stylist, and one for the UA
cache, and so the patch removes 'Stylist' from the field names.

Example output from about:memory:

> +----1,359,608 B (00.55%) -- layout
> |    +----756,488 B (00.31%) -- style-sheet-cache [2]
> |    +----393,968 B (00.16%) -- servo-ua-cache
> |    |    +--234,496 B (00.10%) -- element-and-pseudos-maps
> |    |    +---59,648 B (00.02%) -- revalidation-selectors
> |    |    +---58,320 B (00.02%) -- invalidation-map
> |    |    +---30,752 B (00.01%) -- other
> |    |    +---10,752 B (00.00%) -- precomputed-pseudos

MozReview-Commit-ID: 8oxuJO0ojp
2017-09-19 09:25:00 +10:00
Emilio Cobos Álvarez
23436da119 Bug 1399546: Remove broken code for handling the body text color. r=bholley,Manishearth
MozReview-Commit-ID: AfAT9DgzvI7
2017-09-16 02:38:58 +02:00
Neerja Pancholi
e62b634d27 Bug 1389029 - Undo code changes in Bug 1388234 which is unnecessary now that we post restyle events for rowspan/colspan changes. r=emilio
MozReview-Commit-ID: 5eTW5dCcxzP

This patch reverts the code changes, but not the test changes from changeset bf9cf6f393eb. There is a crashtest here which is valuable to keep.
2017-09-06 12:56:53 -07:00
Bobby Holley
56f2a7aacc Bug 1397500 - Disable the ActiveElementUsesStyle optimization for stylo. r=emilio
MozReview-Commit-ID: 20aqaFv9fxE
2017-09-06 15:30:53 -07:00
Nazım Can Altınova
e39abe7081 Bug 1394551 - stylo: Dont unnecessarily construct gfxFontFeatureValueSet r=xidorn
If there is no font feature values inside document we should avoid creating
unnecessary objects.

MozReview-Commit-ID: HJKMzQvQAPR
2017-08-30 17:08:50 -07:00
Nicholas Nethercote
d7228279d1 Bug 1387958 - Measure the stylist during memory reporting. r=heycam.
Example output from the Obama Wikipedia page:

> ├──2,315,600 B (01.16%) -- stylist
> │  ├──1,916,928 B (00.96%) ── invalidation-map
> │  ├────228,800 B (00.11%) ── rule-tree
> │  ├────142,336 B (00.07%) ── element-and-pseudos-maps
> │  ├─────14,336 B (00.01%) ── revalidation-selectors
> │  ├──────9,648 B (00.00%) ── other
> │  └──────3,552 B (00.00%) ── precomputed-pseudos

This change requires new code to measure HashMaps, which uses the new
'malloc_enclosing_size_of' functions that can measure a heap block from an
interior pointer.

The patch changes MallocSizeOfFn to a newtype, and introduces
MallocEnclosingSizeOfFn alongside.

It also adds new traits: MallocSizeOfBox, MallocSizeOfVec, MallocSizeOfHash.
These each contain a single method that does shallow measurement of the
relevant type, which is often useful. (This is a different style to the
existing MallocSizeOf trait, which does deep measurement, but I'm moving away
from the always-deep-measurement style because it's less flexible.)

MozReview-Commit-ID: FgJCCmdw0ZF
2017-09-05 11:38:45 +10:00
Ting-Yu Lin
e92df4e2f8 Bug 1396700 - Add a method to ServoStyleSet for creating XBL style set. r=xidorn
The motivation of this patch is that clearing mPresContext should be an
implementation detail of XBL style set, so I create a method for that, and
remove ClearPresContext().

MozReview-Commit-ID: Ftta0rcAqu6
2017-09-01 16:45:39 +08:00
Ting-Yu Lin
06d158c02d Bug 1396700 - Remove ServoStyleSet::UpdateStyleSheet(). r=xidorn
This is no longer used.

MozReview-Commit-ID: G7cUcz9CKeQ
2017-09-01 17:12:58 +08:00
Ting-Yu Lin
8be84b02e9 Bug 1382078 Part 4 - Avoid unneeded restyle when XBL styleset is utilized by different PresContext. r=emilio
This fixed layout/style/test/test_media_queries_dynamic.html after Part 3 is added.

MozReview-Commit-ID: 7ZpSunCnkIc
2017-09-04 17:57:00 +08:00
Ting-Yu Lin
0ff1df05f0 Bug 1382078 Part 3 - Support media changes for XBL stylesheets. r=emilio
MozReview-Commit-ID: EJp8EMyanBT
2017-09-02 15:25:45 +08:00
Sebastian Hengst
0740ac72b8 Backed out changeset b49d8d47c3f1 (bug 1382078) 2017-09-02 20:43:36 +02:00
Ting-Yu Lin
33901209b6 Bug 1382078 Part 3 - Support media changes for XBL stylesheets. r=emilio
MozReview-Commit-ID: EJp8EMyanBT
2017-09-02 15:25:45 +08:00
Emilio Cobos Álvarez
3945d65e27 Bug 1395351: Use the parallel traversal flag more often. r=bholley
MozReview-Commit-ID: JF6i0HDniR2
2017-09-01 19:28:57 +02:00
Emilio Cobos Álvarez
b0d3910730 Bug 1395351: Assert the root element is styled in StyleDocument. r=bholley
MozReview-Commit-ID: 6KncJ5IqLbt
2017-09-01 19:31:45 +02:00
Emilio Cobos Álvarez
f5e5f14adc Bug 1374235: style: Remove the for reconstruction traversals. r=bholley
One less hack, a few more to go.

MozReview-Commit-ID: 6katL1EGn2U
2017-09-01 18:46:23 +02:00
Sebastian Hengst
298dd9aea9 Backed out changeset 35afffcb4182 (bug 1374235) for build bustage because it landed before its servo commit. r=backout 2017-09-01 14:07:47 +02:00
Emilio Cobos Álvarez
292a358f1c Bug 1374235: style: Remove the for reconstruction traversals. r=bholley
One less hack, a few more to go.

MozReview-Commit-ID: 6katL1EGn2U
2017-09-01 13:16:09 +02:00
Emilio Cobos Álvarez
1e0df9b436 Bug 1384232: Don't post restyles when loading XBL stylesheets. r=TYLin
MozReview-Commit-ID: 3MCz4vuJb9q
2017-08-31 22:59:11 +02:00
Emilio Cobos Álvarez
a291267a13 Bug 1384232: Let ServoStyleset know what its purpose is. r=TYLin
MozReview-Commit-ID: IwC6FcxhYMT
2017-08-31 22:50:24 +02:00
Brian Birtles
594134da1f Bug 1395452 - Call HasAnimationController() before GetAnimationController(); r=hiro
nsDocument::GetAnimationController() will lazily create an animation controller
which, in some call sites, is unnecessary.

This patch first calls HasAnimationController() and only calls
GetAnimationController() if it returns true. This avoids creating an animation
controller in situations where one is not necessarily required.

MozReview-Commit-ID: 4cdpLRvMVJU
2017-08-31 15:00:39 +09:00
Nicholas Nethercote
d79886e790 Bug 1394729 - Measure memory usage of Stylo's Rule Tree. r=heycam.
This patch splits up the existing "layout/style-sets" measurement into
"layout/gecko-style-sets", or "layout/servo-style-sets/stylist/rule-tree" and
"layout/servo-style-sets/other". (Additional things will be measured under
"layout/servo-style-sets/" later, such as cascade data.)

This requires introducing a new type, ServoStyleSetSizes, for transferring the
multiple measurements from Rust code to C++ code.

MozReview-Commit-ID: FbmzpsjBpgI
2017-08-30 18:21:26 +10:00
Bobby Holley
d5613cdb36 Bug 1392863 - Clean up DoProcessPendingRestyles. r=emilio
MozReview-Commit-ID: 4JhWFNPVvGn
2017-08-26 12:28:25 -07:00
Nazım Can Altınova
5e5b68d3c7 Bug 1355721 - stylo: Implement font feature values lookup r=emilio,xidorn
MozReview-Commit-ID: 7wgQ1NCn7vL
2017-08-23 18:05:53 -07:00