This depends on bug 898333 in order to avoid causing:
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/chrome/dom/tests/mochitest/chrome/test_focused_link_scroll.xul | Assertion count 1 is greater than expected range 0-0 assertions.
due to the assertion:
###!!! ASSERTION: Shouldn't be trying to restyle non-elements directly: '!aContent || aContent->IsElement()', file ../../../layout/base/nsStyleChangeList.cpp, line 62
The assertion count change in layout/generic/crashtests/571995.xhtml is
expected because it changes us from having 7 of:
###!!! ASSERTION: Shouldn't be trying to restyle non-elements directly: '!aContent || aContent->IsElement()', file ../../../layout/base/nsStyleChangeList.cpp, line 62
with the stack:
mozilla::ElementRestyler::CaptureChange(nsStyleContext*, nsStyleContext*, nsChangeHint) [layout/base/nsChangeHint.h:191]
mozilla::ElementRestyler::RestyleSelf(nsRestyleHint) [layout/base/RestyleManager.cpp:2304]
to only having one. This is expected since this patch changes
RestyleSelf to only call CaptureChange for the first continuation or
block-in-inline sibling.
This patch fundamentally makes three changes:
(1) Change the way RestyleSelf is used so that it is called in a loop,
over all of the same-style continuations and block-in-inline
siblings.
(I had a note here reminding myself:
TODO: Don't set hints for descendants!
but I no longer remember what it meant.)
(2) Change the traversal of children to traverse all of the children of
the items traversed in (1).
(3) When traversing children, skip children that are continuations,
since we already reached them in (1) and (2).
A later patch will change the RestyleSelf loop to copy for the later
continuations rather than repeating the work. This will mean reverting
many of the RestyleSelf changes contained here.
Some of the pieces marked temporary will be removed in bug 828312 patch
11, and the rest should hopefully be removed in bug 918064.
This is the second of two big chunks of code moved into the new
RestyleManager class from another sources.
Note that the undisplayed map remains in nsFrameManager, although it
could perhaps have moved.
This moves restyling management out of nsCSSFrameConstructor (thus
reducing its size), and keeps the restyling code closer together.
This is the first of two big chunks of code moved in this patch series.
A later patch in this series will move related code from nsFrameManager
into the same destination file.