Commit Graph

175 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
93c3013be8 Bug 1364862: Make PostRebuildAllStyleData async. r=heycam
MozReview-Commit-ID: EM3eUP1dWwA
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-15 18:02:59 +02:00
Emilio Cobos Álvarez
fec475d0be Bug 1364824: Implement ServoRestyleManager::PostRebuildAllStyleDataEvent. r=heycam
MozReview-Commit-ID: I9HmM9ZMB2c
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-15 09:41:42 +02:00
Hiroyuki Ikezoe
0defd7d385 Bug 1356916 - Call PostRestyleEvent() with the change hint obtained by Element::GetAttributeChangeHint in ServoRestyleManager::AttributeChanged. r=heycam
MozReview-Commit-ID: 14clm0eE0iE
2017-05-11 07:30:34 +09:00
Emilio Cobos Álvarez
c4f847ffaa Bug 1355343: Take all the snapshots into account. r=bholley
I've chosen this approach mainly because there's no other good way to guarantee
the model is correct than holding the snapshots alive until a style refresh.

What I tried before this (storing them in a sort of "immutable element data") is
a pain, since we call into style from the frame constructor and other content
notifications, which makes keeping track of which snapshots should be cleared an
which shouldn't an insane task.

Ideally we'd have a single entry-point for style, but that's not the case right
now, and changing that requires pretty non-trivial changes to the frame
constructor.

MozReview-Commit-ID: FF1KWZv2iBM
2017-05-07 16:36:47 +02:00
Emilio Cobos Álvarez
cabca766ba Bug 1362991: Compute at most one text style context per element. r=heycam
MozReview-Commit-ID: IDTRk47CsRS
2017-05-08 14:49:57 +02:00
Emilio Cobos Álvarez
c1d10eadbb Bug 1351339: Compute text style changes when the parent is a display: contents element. r=heycam
MozReview-Commit-ID: GWPNevfP4xc
2017-05-08 03:16:43 +02:00
Emilio Cobos Álvarez
8d15928c16 Bug 1361766: Move MathML content state changes outside of reflow. r=xidorn
This also adds assertions to ensure attributes and state don't change during
layout or frame construction.

MozReview-Commit-ID: BANcpxnRsYS
2017-05-02 22:42:26 +02:00
Emilio Cobos Álvarez
3731858edf Bug 1360241: Devirtualize nsIFrame::GetType. r=heycam
MozReview-Commit-ID: 5Nzhyta5Hle
2017-04-30 17:30:08 +02:00
Emilio Cobos Álvarez
5cff30131d Bug 1331047: Implement the new traversal semantics for stylo. r=bholley,hiro
MozReview-Commit-ID: 4BXx9JpGZKX
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-27 17:06:11 +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 Chiou
fcc513f6a3 Bug 1355758 - Update RestyleManager::mAnimationGeneration for non-animation update. r=heycam
We use RestyleManager::mAnimationGeneration as the animation index of a
new created transition, and Element.getAnimations() uses this index to
sort the order of transitions. We increase mAnimationGeneration one per
restyle cycle if there is any non-animation update.

MozReview-Commit-ID: KmirBzI7CXi
2017-04-21 16:44:17 +08:00
Ting-Yu Lin
d168afba4f Bug 1354975 - Let the frame handles attribute change in ServoRestyleManager::AttributeChanged(). r=heycam
MozReview-Commit-ID: EdvgBnPlP9Y
2017-04-07 16:41:33 +08:00
Manish Goregaokar
0de0989a14 Bug 1341647 - stylo: Move HTMLBodyElement::WalkContentStyleRules to the mapped attr functionality; r=bz
MozReview-Commit-ID: 90qDHl0Ane4
2017-03-29 12:10:00 -07:00
Emilio Cobos Álvarez
529ee020ee Bug 1351791: Move PostRestyleEventForLazyConstruction and PostRestyleEventInternal to GeckoRestyleManager. r=bholley
MozReview-Commit-ID: 5lrNlkbrnZb
2017-03-31 11:56:29 +02:00
Manish Goregaokar
42f484fe6f Bug 1341648 - stylo: Include content rules from HTMLTableCellElement::WalkContentStyleRules ; r=bz
This also removes the TABLE_ATTRS_DIRTY optimization. Constructing nsMappedAttributes isn't really expensive and we do it all the time anyway.

MozReview-Commit-ID: 2krt1nFUzgl
2017-03-26 13:53:34 -07:00
Bobby Holley
a2cd204d74 Bug 1350441 - Make ServoRestyleManager::ClearServoDataFromSubtree a bit smarter. r=heycam
There's no reason to traverse the entire subtree if we encounter an unstyled section.

MozReview-Commit-ID: 7WeMTI73wR9
2017-03-29 09:27:24 -07:00
Emilio Cobos Álvarez
39225cda06 Bug 1350140: Flush the overflow changed tracker when done with restyles. r=heycam
MozReview-Commit-ID: 6ENzvvxCok5
2017-03-27 22:55:20 +02:00
Bobby Holley
aacbfde69f Bug 1350115 - Squelch post-traversal generated by additional animation traversals when we're styling a fresh subtree. r=heycam,r=birtles
This patch exists to avoid a crash in layout/style/test/test_animations.html. We end up
generating some ::before content, which causes us to style the new subtree at [1]. In
StyleNewSubtree, we fail the !postTraversalRequired assertion because
PrepareAndTraverseSubtree decided to traverse the tree twice (once to style it, and again
to restyle it for animations), and return that a post-traversal is needed.

The reason this issue happens with my NAC patches and not without is that we were previously
filtering out generated ::before content from the servo traversal, so the servo traversal
wouldn't have reached it and (presumably) the animation restyle wouldn't have happened and
we wouldn't have returned true for needing a post-traversal.

[1] http://searchfox.org/mozilla-central/rev/c48398abd9f0f074c69f2223260939e30e8f99a8/layout/base/nsCSSFrameConstructor.cpp#1918

MozReview-Commit-ID: 8tgzLjV8B3A
2017-03-24 09:40:30 -07:00
Cameron McCormack
61828f2975 Bug 1302054 - Part 1: Avoid computing style differences when we just want to ensure structs are cached on the new context. r=dbaron
MozReview-Commit-ID: DLhHcCD4GQS
2017-03-21 16:33:05 +08:00
Emilio Cobos Álvarez
78d21942de Bug 1296516: Tidy RestyleManager::ContentStateChanged. r=heycam
MozReview-Commit-ID: 7iWc6JvljhT
2017-03-20 22:28:13 +01:00
Cameron McCormack
5d728859aa Bug 1338461 - Pass eRestyle_StyleAttribute through to Servo_NoteExplicitHints. r=bholley
MozReview-Commit-ID: C7HIOTs1SSY
2017-03-20 14:42:31 +08:00
Boris Zbarsky
e1d5ac409a Bug 1347411 part 1. Make sure to correctly update anon boxes belonging to ::before/::after pseudo-elements. r=heycam
MozReview-Commit-ID: AzF9WdUo1E
2017-03-15 14:00:42 -04:00
Emilio Cobos Álvarez
4b72eae7aa Bug 1328652: Ensure we do actual restyling work after calling RebuildAllStyleData. r=bz
The Gecko restyle manager does this synchronously, along with a content flush.

In my testing there's no need to do so, and Boris couldn't think off-hand of
why, except the fact that we have this mRebuildAllStyleData thing that takes
care of rebuilding the rule tree, which is quite sensitive.

Also, Boris made a good point about non-inheriting anon boxes, that could
technically change style. I've left a note about it too.

MozReview-Commit-ID: 2lvzhxugKB0
2017-03-11 00:25:37 +01:00
Cameron McCormack
eeea0c3a51 Bug 1291786 - stylo: Move eRestyle_Subtree translation handling to Servo. r=bholley
MozReview-Commit-ID: LHTJzImnj6h
2017-03-10 17:54:19 +08:00
Hiroyuki Ikezoe
d9c3518720 Bug 1341985 - Trigger the second traversal for updating CSS animations. r=birtles,heycam
The restyle request during restyling is a result of creating/updating/removing
CSS animations that will come from a SequentialTask which will be implemented
in a subsequent patch.

MozReview-Commit-ID: JoAqvcN3y51
2017-03-10 11:53:19 +09:00
Hiroyuki Ikezoe
500774de7b Bug 1344619 - Part 7: Drop EffectCompositor::ClearElementsToRestyle. r=birtles
MozReview-Commit-ID: DlTj2OR0wI0
2017-03-09 05:20:17 +09:00
Bobby Holley
fe8dc59428 Bug 1344386 - Don't look for overlapping change hints in stylo documents. r=emilio
MozReview-Commit-ID: 9wK8TTXolPM
2017-03-07 13:14:32 -08:00
Bobby Holley
6ff512b18f Bug 1338921 - Handle lazy frame construction in the regular post-servo pass. r=emilio
MozReview-Commit-ID: FSXKAiyZDzt
2017-03-03 14:55:22 -08:00
Boris Zbarsky
76369661b5 Bug 1337696. Fix change hint computation for table-outer frames to be more correct. r=emilio
MozReview-Commit-ID: LgRmTlWsM6o
2017-03-03 15:54:47 -05:00
Boris Zbarsky
194b86b428 Bug 1340723 part 3. Fix stylo to properly update styles on the anonymous blocks we create in a block-inside-inline situation when the style of the inline changes. r=emilio
MozReview-Commit-ID: JYz6g1ZJInT
2017-03-03 15:45:40 -05:00
Boris Zbarsky
b8daadc24a Bug 1340723 part 2. Call the new UpdateStyleOnOwnedAnonBoxes function as needed from ServoRestyleManager. r=emilio
MozReview-Commit-ID: 5nrv8x7CEtN
2017-03-03 15:44:48 -05:00
Bobby Holley
3348921dcc Bug 1343362 - Allow restyle hints to be posted during change hint handling. r=emilio
MozReview-Commit-ID: 6ZU24tLQCjV
2017-03-01 22:42:51 -08:00
Bobby Holley
6d5ba43988 Bug 1343128 - Don't leave stale change hints and other restyle data hanging around in reconstructed subtrees. r=emilio
MozReview-Commit-ID: 4BIvC6lPUmF
2017-02-28 18:02:11 -08:00
Emilio Cobos Álvarez
c0e5af8f9a Bug 1341083: Implement dynamic restyling for display: contents. r=heycam
MozReview-Commit-ID: KimTU2j4V4p
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-02-25 19:15:38 +01:00
Emilio Cobos Álvarez
a2cee39cab Bug 1322317: Fix CalcStyleDifference assumptions and PeekStyleContext semantics. r=heycam
For the reasoning for this change, please see the related bugs and:

http://logs.glob.uno/?c=mozilla%23layout&s=22+Feb+2017&e=22+Feb+2017#c27236

Mainly, before this change, there was nothing forcing style structs computed in
a style context to remain computed for the new style context after a call to
CalcStyleDifference. This can make us skip change hints when a style change
doesn't force to recompute one of these structs.

MozReview-Commit-ID: FoWbLjt97Uu
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-02-21 16:56:43 +01:00
Hiroyuki Ikezoe
72d06432c0 Bug 1340340 - Stop mutating nsRefreshDriver during parallel traversal. r=heycam
MozReview-Commit-ID: D5VYPWXm5jO
2017-02-20 14:37:13 +09:00
Boris Zbarsky
20d50473db Bug 1324661 another followup: just simplify the chnagehint thing for now, with a followup filed. r=bholley
MozReview-Commit-ID: G9IvoODSOch
2017-02-17 17:50:24 -05:00
Boris Zbarsky
432b94a0a1 Bug 1324661 followup: check our child hint before trying to append it. r=bholley
MozReview-Commit-ID: 3FIBludwV7j
2017-02-17 16:36:12 -05:00
Boris Zbarsky
9666ae4505 Bug 1324661 part 1. When recreating style contexts for elements in stylo, use the right frame (not the primary frame!) for tables. r=bholley,emilio
For a table, the primary frame is the table wrapper anonymous box.  That
anonymous box inherits style from its _child_ table frame, which is the frame that
has the actual style for the element.  So we want to use the stylo-computed
style for the table frame, and then compute an updated style for the table
wrapper too, because some things (like absolute positioning) are done for the
table wrapper anonymous box, not the table frame.
2017-02-17 14:52:39 -05:00
Cameron McCormack
72208062c5 Bug 1297899 - Part 8: Move Content{Inserted,Appended} up to RestyleManager. r=bholley
MozReview-Commit-ID: G2XyuyxhzOz
2017-02-13 11:21:33 +08:00
Cameron McCormack
23f1714041 Bug 1297899 - Part 7: Move PostRestyleEventForLazyConstruction up to RestyleManager. r=bholley
MozReview-Commit-ID: 8M5wgCJp6PT
2017-02-13 11:21:33 +08:00
Cameron McCormack
594df5c15c Bug 1297899 - Part 4: Store concrete restyle manager type on RestyleManager. r=bholley
MozReview-Commit-ID: AmsNPqPVm8c
2017-02-13 11:21:32 +08:00
Cameron McCormack
34c943ee6e Bug 1297899 - Part 3: Rename RestyleManager to GeckoRestyleManager and RestyleManagerBase to RestyleManager. r=bholley
MozReview-Commit-ID: fFTZKwmGJm
2017-02-13 11:21:32 +08:00
Shing Lyu
ec447997bf Bug 1329919 - Skip repaint frame hint if there is no frame. r=heycam
MozReview-Commit-ID: F46VpEBJqvU
2017-02-03 10:37:08 +08:00
Cameron McCormack
81aced4890 Bug 1338763 - stylo: Bump restyle generation only when we do restyle things. r=bholley
MozReview-Commit-ID: 1f3l7L0hfJp
2017-02-11 16:50:02 +08:00
Cameron McCormack
8e21d528cb Bug 1331294 - Part 6: Remove RestyleManager::HasPendingRestyles and Servo_Element_ShouldTraverse. r=bholley
MozReview-Commit-ID: 2ST5i7M4QZ4
2017-02-10 10:42:30 +08:00
Cameron McCormack
4f76a8ce9c Bug 1331294 - Part 5: Make ServoRestyleManager::ProcessPendingRestyles use StyleDocument()'s return value to determine whether to return early. r=bholley
MozReview-Commit-ID: Hbk0vuQMhJs
2017-02-10 10:42:30 +08:00
Cameron McCormack
c48f6c44a5 Bug 1331294 - Part 3: Make ServoRestyleManager::PostRestyleEvent not check HasPendingRestyles() before returning early. r=bholley
If there are pending restyles, and we were called with zero change and restyle
hints, then we're still not going to do any extra work.  So we may as
well return early after only checking the hints.

MozReview-Commit-ID: ACCGtDZcOJ0
2017-02-10 10:42:30 +08:00
Emilio Cobos Álvarez
eddb89bfb8 Bug 1337248: remove bogus assertion in presence of explicit change hints. r=bholley
When any explicit change hint appears to trigger, for example, a repaint,  this
assertion is no longer true, and we should indeed avoid recreating the style
context unnecessarily for that element.

MozReview-Commit-ID: Ln7lBPZW0kp
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-02-07 21:01:01 +01:00
Emilio Cobos Álvarez
149696300c Bug 1335987: stylo: Don't use the change hint to decide whether to recreate style contexts. r=bholley
MozReview-Commit-ID: 11Yyq8UE3LP
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-02-03 22:03:34 +01:00