Commit Graph

217 Commits

Author SHA1 Message Date
Cameron McCormack
301463dc20 Bug 1092363 - Disable bug 931668 optimizations for the time being. r=dbaron 2015-01-22 13:25:08 +11:00
L. David Baron
c90d6e2a33 Bug 1110277 patch 7 - Call CreateNeededFrames from ~ReframingStyleContexts. r=bzbarsky
I don't have any tests that exercise this code, and I can't even find a
codepath that demonstrates that it's needed, since the lazy
reconstruction that happens during style-triggered frame reconstruction
all appears to go through PostRestyleEvent rather than
MaybeConstructLazily.

But I think we should either do this or add an assertion that it's not
needed, and given that it's one line, it seems like we may as well just
do it.  (Note also that we're currently calling CreateNeededFrames at
the start of style reresolution, in
RestyleManager::ProcessPendingRestyles; this adds a call at the end.)
2015-01-13 21:03:13 -08:00
L. David Baron
f290869b5e Bug 1110277 patch 6 - Make the lifetime of the ReframingStyleContexts object longer. r=heycam
This makes the ReframingStyleContexts live across the lifetime of the
processing of a full queue of posted restyles.

This depends on bug 1115812 to behave sensibly (and not assert) when
rebuilding the rule tree (RebuildAllStyleData, etc.).

This handles the form of lazy frame construction that is done in
nsCSSFrameConstructor::RecreateFramesForContent, which posts a restyle.
Patch 7 handles any use of the lazy frame construction mechanism.

This patch (with patches 4 and 5 under it, but without patches 1-3)
fixes the original testcase in bug 1110277, except for some flashing of
the final position as the transition starts.

Also fixes bug 1111451.
2015-01-13 21:03:13 -08:00
L. David Baron
6a6e77a8d9 Bug 1110277 patch 5 - Move the AutoRestore into ReframingStyleContexts. r=heycam
This is just a little cleanup that follows from patch 4.
2015-01-13 21:03:13 -08:00
L. David Baron
c85cb4876e Bug 1110277 patch 4 - Add a RestyleManager member to ReframingStyleContexts. r=heycam
This is needed for patch 7.
2015-01-13 21:03:13 -08:00
L. David Baron
f1332e99f1 Bug 1115812 patch 20 - Add assertions that mDoRebuildAllStyleData and mInRebuildAllStyleData are false by the end of restyle processing. r=heycam
These assertions are as requested in comment 30 in the bug.

(If the first one doesn't fire, it's possible we could even get rid of
the handling of mDoRebuildAllStyleData that it's within.)
2015-01-13 21:03:13 -08:00
L. David Baron
7bc8463f0e Bug 1115812 patch 19 - Avoid bad kungFuDeathGrip pattern. r=heycam
If we need a strong reference to the pres shell, we may as well do it
the first time rather than bothering with an extra variable.
2015-01-13 21:03:12 -08:00
L. David Baron
0e8362d05a Bug 1115812 patch 18 - We only need to call ProcessPendingRestyles recursively, rather than RebuildAllStyleData. r=heycam
If we discover that we've set mDoRebuildAllStyleData in the middle of
ProcessPendingRestyles(), now that ProcessPendingRestyles() fully
handles mDoRebuildAllStyleData, we only need to make a recursive call to
ProcessPendingRestyles, rather than calling RebuildAllStyleData to call
ProcessPendingRestyles.
2015-01-13 21:03:12 -08:00
L. David Baron
a998c7bd03 Bug 1115812 patch 17 - Do animation-only update properly for a rebuild all. r=heycam
This fixes another pre-existing bug in the rebuild-all codepath; it
didn't handle the animation-only update correctly, which could have
caused bugs in transitions with OMT animations enabled.
2015-01-13 21:03:12 -08:00
L. David Baron
20ed69a9ae Bug 1115812 patch 16 - Remove the now-unused DoRebuildAllStyleData. r=heycam 2015-01-13 21:03:12 -08:00
L. David Baron
f9abbf6ae0 Bug 1115812 patch 15 - Change the rebuild-all that we do for 'rem' unit changes to use the new way. r=heycam
This means that instead of recurring into DoRebuildAllStyleData, we'll
call StartRebuildAllStyleData in the middle of processing the restyle
queue (which is fine).  StartRebuildAllStyleData will move the old rule
tree out of the way and immediately do a full-tree restyle, before
returning to any queue processing that might be left (the full-tree
restyle should have consumed all remaining restyle hints, but might have
posted some new ones for handling reframes that require reframing
ancestors).  And, more importantly, the EndReconstruct() call to get rid
of the old rule tree won't happen until after we're done processing the
containing RestyleTracker's queue of restyles, which reduces the risk of
having dangling old style contexts and makes it easier (in bug 1110277)
to have a ReframingStyleContexts with the right lifetime.
2015-01-13 21:03:12 -08:00
L. David Baron
eed121aaa9 Bug 1115812 patch 14 - For rem unit change handling, repost min hint to root just like change hint. r=heycam
This changes what was probably a silly design choice when I wrote the
code for 'rem'-basis handling; we shouldn't try continuing through the
rest of RestyleElement() here, but instead repost the hint to the
rebuild-all process.
2015-01-13 21:03:12 -08:00
L. David Baron
6dc93cb14d Bug 1115812 patch 13 - Make RebuildAllStyleData use the normal ProcessPendingRestyles() codepath. r=heycam
This switches RebuildAllStyleData() to the normal
ProcessPendingRestyles() manner of restyle processing.  This means a
rebuild-all going through this codepath (the main rebuild-all codepath)
only sets up for non-animation restyle processing once rather than doing
it twice (and potentially having reframes posted in
DoRebuildAllStyleData() that don't get processed until
ProcessPendingRestyles(), which causes a variant of bug 1110277 with
transitions on reframed elements failing to start because it doesn't
match the lifetime of the ReframingStyleContexts).
2015-01-13 21:03:12 -08:00
L. David Baron
504d9a46e0 Bug 1115812 patch 12 - Null-check the root frame in StartRebuildAllStyleData. r=heycam
In the new way of doing a rebuild-all, StartRebuildAllStyleData might be
called directly from ProcessPendingRestyles rather than from
RebuildAllStyleData (which null-checks the root frame) or from within
processing restyles (which can only happen when there's a root frame).
This means it needs its own null-check of the root frame.
2015-01-13 21:03:12 -08:00
L. David Baron
b8e6ffef57 Bug 1115812 patch 11 - Move the beginning part of the rebuild-all process to StartRebuildAllStyleData. r=heycam
Here we call StartRebuildAllStyleData from BeginProcessingRestyles (much
like patch 9 and EndProcessingRestyles).  But we will later also call it
from the code that handles a root element font size change when we have
'rem' units.  That's because it's fine to *start* the rebuild process in
the middle of processing the queue of pending restyles.  (We have to end
after the whole process is done, though, in order to avoid wanting to
destroy the old rule tree while we still have style contexts referencing
it.)

We only call StartRebuildAllStyleData in this case when we're processing
our primary restyle queue (mPendingRestyles), not the animation restyles
(to be removed in bug 960465) or the animation-only restyles, since a
rebuild-all should be processed (in terms of animation phases, or in
terms of having an animation-only update before it) like a normal
restyle.  (This isn't true for the 'rem' unit restyle, which could
happen during any sort of update.)
2015-01-13 21:03:12 -08:00
L. David Baron
9d5b480b41 Bug 1115812 patch 10 - Add RestyleTracker parameter to BeginProcessingRestyles. r=heycam
This is needed in patch 11.
2015-01-13 21:03:12 -08:00
L. David Baron
9815b54790 Bug 1115812 patch 9 - Move the end part of the rebuild-all process to RestyleManager::EndProcessingRestyles. r=heycam
This moves the code that finishes the rebuild-all process into
EndProcessingRestyles(), which is part of the main restyling codepath.

Patch 7 ensures that we'll always get to EndProcessingRestyles in this
case, when we're going through the normal ProcessPendingRestyles()
codepath rather than the special DoRebuildAllStyleData() codepath (which
will be removed later in this patch series).
2015-01-13 21:03:12 -08:00
L. David Baron
4991382cc8 Bug 1115812 patch 8 - Call BeginProcessingRestyles and EndProcessingRestyles from DoRebuildAllStyleData. r=heycam
This fixes one of the omissions in the rebuild-all codepaths (where it
incorrectly differs from the regular ProcessPendingRestyles codepath).
Note that the explicit FlushOverflowChangedTracker() is no longer needed
because that's part of EndProcessingRestyles.

(This will all get refactored more substantially in the following
patches.)
2015-01-13 21:03:12 -08:00
L. David Baron
61bcb1749a Bug 1115812 patch 6 - Move ProcessRestyles from RestyleTracker to RestyleManager. r=heycam
This is needed for the following patch, so that it can access a member
variable of RestyleManager.
2015-01-13 21:03:12 -08:00
L. David Baron
e19772aa8e Bug 1115812 patch 5 - Store the state of whether we're currently rebuilding all style data in a member variable, to prepare for future merging of the rebuild into other code. r=heycam
This adds a member variable that is currently only used within a single
function, but that function will be split apart so that different parts
of it can be called from different places within ProcessPendingRestyles.
2015-01-13 21:03:12 -08:00
L. David Baron
1493ba39f8 Bug 1115812 patch 4 - Rename mRebuildAllStyleData to mDoRebuildAllStyleData. r=heycam
This is the variable that says we *need to* rebuild style data.  Since
the next patch will introduce a variable that says we're *currently*
rebuilding all style data, renaming this one makes things clearer.
2015-01-13 21:03:11 -08:00
L. David Baron
a6b18a766a Bug 1115812 patch 3 - Pass the hints to DoRebuildAllStyleData via the member variables, in preparation for future refactoring. r=heycam
Part of this refactoring involves the ability to start the rebuild-all
process within the processing of restyles.  This means we can't pass
parameters directly from RebuildAllStyleData into DoRebuildAllStyleData.
So this continues storing the hints as member variables a little bit
deeper into the process.

(I tried to move in a different direction in this patch queue, and store
these hints in mPendingRestyles, for the root element.  But that broke
layout/style/test/test_counter_style.html and
layout/style/test/test_font_loading_api.html, and I didn't want to
figure out why.  It would be somewhat better in the long run, since
currently these hints will get processed if we do a rebuild-all on a
RestyleTracker other than mPendingRestyles, which can happen if we have
'rem' units and have a root element font size change in the
animation-only update or in mPendingAnimationRestyles.)
2015-01-13 21:03:11 -08:00
L. David Baron
5d1c7926f6 Bug 1115812 patch 2 - Move the eRestyle_ChangeAnimationPhaseDescendants hint in DoRebuildAllStyleData so that the new rebuild-all codepaths will keep it. r=heycam
The patches in this series refactor the process of rebuilding all style
data (RestyleManager::RebuildAllStyleData and
RestyleManager::DoRebuildAllStyleData) so that the process of rebuilding
all style data uses the existing restyle processing loops in
ProcessPendingRestyles.  (Rebuilding all style data is what we do when
we need to throw away the rule tree because something has invalidated
the cached data in it.)  This removes (increasing, especially with bug
960465 coming) code duplicated between the two codepaths, fixes some
omissions from the separate rebuild-all codepath, and (more immediately)
allows fixing lifetime issues of ReframingStyleContexts objects in bug
1110277 so that we can have a single ReframingStyleContexts for all of
the restyle processing in each restyle processing operation.  In other
words, the goal is to change the rebuild-all process from a separate
codepath to a few variables that modify the way ProcessPendingRestyles
works (and make it do the extra work).

This is just a small first step in that process, which moves one piece
of code from a chunk of duplicated and to-be-removed code into a chunk
of code that will be preserved.
2015-01-13 21:03:11 -08:00
L. David Baron
c18ac3eff2 Bug 1115812 patch 1 - Remove obsolete comment that was fixed by bug 1047928. r=heycam 2015-01-13 21:03:11 -08:00
L. David Baron
590d7a434b Bug 1110277 patch 1 - Consider the ib-split chain when checking for ::before and ::after in order to reframe when they're missing. r=bzbarsky
This patch is not needed to fix the bug, but it seems like it's probably
desirable.  It's not needed for this bug because
MaybeReframeForBeforePseudo and MaybeReframeForAfterPseudo are already
called (by ElementRestyler::RestyleChildren) on only the first and last
continuation or ib-split sibling with the same style.  So this patch
should only actually change anything for cases like a block-in-inline
split whose initial inline part is inside of a ::first-line (where
different parts of the block-in-inline split chain have different style).

Since the symptom of this bug is (once patch 6 is in the tree) only
causing extra reframes, it can only be tested using the new API (from
bug 1115691) for observing reframes.  I confirmed that the test for this
bug fails without the patch and passes with the patch (as noted by the
removal of its todo annotation).
2015-01-11 15:43:10 -08:00
Brian Birtles
3dcfc0b8f5 Bug 927349 part 28 - Call AddLayerChangesForAnimation after updating style; r=dbaron 2014-12-25 16:28:25 +09:00
Xidorn Quan
61ff35b52e Bug 1114792 - Rename nsStyleContext::IsDirectlyInsideRuby to IsInlineDescendantOfRuby. r=dbaron
--HG--
extra : rebase_source : c28b41828c7d02ab26803c583bae15a218a5da05
2014-12-31 16:39:43 +11:00
Brian Birtles
e5b88e8ef0 Back out parts 22-29 from bug 927349 for causing intermittent test failure in css-animations/test_animation-pausing.html on 10.8 2014-12-26 11:54:43 +09:00
Brian Birtles
8f3f4c1376 Bug 927349 part 29 - Disable failing browser_555547.js on Windows opt - pushed again without backing out parts 22-29 at the same time; r=me
In https://hg.mozilla.org/integration/mozilla-inbound/rev/3ab2ff9b9f94
I accidentally pushed part 29 along with a backout for parts 22-29. This patch
reverts that change.

If this changset causes problems, the following changesets should be backed out:

https://hg.mozilla.org/integration/mozilla-inbound/rev/477f46897b0b
https://hg.mozilla.org/integration/mozilla-inbound/rev/6c345954bce5
https://hg.mozilla.org/integration/mozilla-inbound/rev/642e400b22a9
https://hg.mozilla.org/integration/mozilla-inbound/rev/9bdf7c2279fa
https://hg.mozilla.org/integration/mozilla-inbound/rev/79cac8c71159
https://hg.mozilla.org/integration/mozilla-inbound/rev/cfe757e478d5
https://hg.mozilla.org/integration/mozilla-inbound/rev/eaf834051cbd
2014-12-26 08:49:20 +09:00
Brian Birtles
414a5c831f Bug 927349 part 29 - Disable failing browser_555547.js on Windows opt; r=me (as discussed with jwatt) 2014-12-25 16:31:55 +09:00
Brian Birtles
cbe7771b26 Bug 927349 part 28 - Call AddLayerChangesForAnimation after updating style; r=dbaron 2014-12-25 16:28:25 +09:00
Seth Fowler
710bf88bca Bug 35168 (Part 2) - Allow relative positioning of internal table objects. r=dbaron 2014-08-19 18:24:58 -07:00
Xidorn Quan
4acbb5abac Bug 1098275 - Inlinize block-level boxes inside ruby. r=heycam
--HG--
extra : rebase_source : 70a969d3a6be4ea5dfe14777aa7c31189ade7211
extra : source : 30e0ea21cdfaa29f2c138f0b8975da984e8ac009
2014-12-11 09:26:18 +11:00
Mats Palmgren
b0f013a10d Bug 907396 - Make RestyleManager::RestyleElement and nsCSSFrameConstructor::MaybeRecreateFramesForElement deal with display:contents elements. r=bzbarsky 2014-11-20 18:24:10 +00:00
Mats Palmgren
debd2f3e4d Bug 907396 - Replace GetParentStyleContextFrame with GetParentStyleContext which can return frame-less display:contents style contexts. r=bzbarsky 2014-11-20 18:24:10 +00:00
Mats Palmgren
49c85139e6 Bug 907396 - Implement RestyleUndisplayedDescendants that restyles diplay:none children and display:contents descendants. r=bzbarsky 2014-11-20 18:24:10 +00:00
Mats Palmgren
96ad0f2c46 Bug 907396 - Frame constructor changes for display:contents. r=bzbarsky 2014-11-20 18:24:09 +00:00
David Zbarsky
7e217619a6 Bug 1085769: Merge ContentOrAncestorHasAnimation/Transition r=birtles 2014-11-19 21:48:42 -05:00
Brian Birtles
18c294458c Bug 1073336 part 16 - Factor out animation-layer related information to a common database; r=dbaron 2014-11-17 13:46:00 +09:00
Brian Birtles
d5678b7ad6 Bug 1073336 part 14b - Make ElementRestyler detect changes to the animation generation; r=dbaron
For some kinds of changes we need to update the layer tree even though there is
no change to style. For example, if an animation is paused via the Web
Animations API, we need to remove the animation from the layer even though the
style will not change.

This patch detects such changes by making ElementRestyler check for an
out-of-date animation generation on layers. This is complicated by the fact that
we currently maintain *two* animation generation numbers: one for the set of
animations and one for the set of transitions, but we only have *one* animation
generation number on each layer. This is a known issue (bug 847286).

As a result, until bug 847286 is fixed, we need to be careful to compare against
the greater of the two numbers.
2014-11-17 13:46:00 +09:00
Brian Birtles
dc417c2fec Bug 1073336 part 14a - Update animation generation when changing animations via the API; r=dbaron 2014-11-17 13:45:59 +09:00
L. David Baron
5fc1b3d275 Bug 1086937 patch 2 - Use eRestyle_ChangeAnimationPhaseDescendants to get the right style data in RestyleManager::RebuildAllStyleData. r=birtles
Until we get rid of animation phases in bug 960465, we need to ensure
we're producing style data for the correct animation phase.  This makes
this optimization slightly less beneficial until then.
2014-11-12 23:28:52 -08:00
L. David Baron
0c5741e2ef Bug 1086937 patch 1 - Add eRestyle_ChangeAnimationPhaseDescendants restyle hint that is like eRestyle_ChangeAnimationPhase, but for a whole subtree. r=birtles 2014-11-12 23:28:52 -08:00
L. David Baron
70fce093ea Bug 1086937 patch 0 - Add missing null check of root element so this patch series doesn't expose a crash in layout/style/crashtests/472237-1.html . r=birtles 2014-11-12 23:28:52 -08:00
Robert Longson
4a07c5065f Bug 975757 - changes to transforms in patterns do not cause an update. r=jwatt 2014-11-04 14:52:27 +00:00
Mats Palmgren
1aceb17cf6 Bug 1077687. If we have a pending request to rebuild all style data then do so instead of processing individual restyles. r=roc 2014-11-02 16:47:26 +00:00
Jonathan Watt
bf49eb7f25 Bug 651021 - Make nsRenderingContext a stack class. r=jrmuizel 2014-10-31 20:08:49 +00:00
Mats Palmgren
3f61e03687 Bug 1083855 - part 6, Make RecreateFramesForContent params non-optional. r=bz 2014-10-23 13:19:26 +00:00
Robert Longson
dafe7ccae9 Bug 1067375 - Fix animateTransform in svg-as-image to invalidate properly. r=jwatt 2014-10-12 08:49:34 +01:00
L. David Baron
33003bece1 Bug 1047928 patch 5 - Pass restyle hint to RestyleManager::PostRebuildAllStyleDataEvent. r=bzbarsky
This patch is not intended to contain any changes in behavior.
2014-10-08 14:27:02 -07:00