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
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
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
That way we don't bust the build (for some reason the ASAN build choked in
ResponsiveImageSelector, I suspect due to missing includes).
MozReview-Commit-ID: 6I6Q7jiAFr0
This needs to dumb down the parsing in order to match what we do in Gecko and
pass more tests.
The remaining tests are just because of calc() in media queries and "or" media
expressions.
MozReview-Commit-ID: CXGdYVbojBL
We need to create a temporary ServoStyleContext with the animation value for
calculating the Cumulative change hints.
MozReview-Commit-ID: JzArnaGqVeV
--HG--
extra : rebase_source : 2947910e07f0aab6b385ca60cef927966d15bcf6
(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
--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
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
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
--HG--
extra : rebase_source : 7d86216967259b71df7280261d025cc65bf00ba4
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
--HG--
extra : rebase_source : 0bdb1ac3e2c988e5a0220172f19ab4b006e883d7
This fixed layout/style/test/test_media_queries_dynamic.html after Part 3 is added.
MozReview-Commit-ID: 7ZpSunCnkIc
--HG--
extra : rebase_source : 6acab11ba784b801b90afc0558c32baabcc3f271
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
--HG--
extra : rebase_source : f2d1441705139e6674d355792255302fcd89f748
CLOSED TREE
--HG--
extra : amend_source : 7618f27e1cf71347f12384935374d303d5c1ab23
extra : histedit_source : 1143d226673ace563bb5d9ff3c420ded33439791%2C9746a30097304bd2214a0072773dc00c767d31cd
Now that we do process normal traversal even in the case of throttled animation
flush so that we don't need to do special handling for the case.
Note about the comment in has_current_styles():
the remaining animation hints is not caused by either this patch or the
previous patch in this patch series, it's been there in the first place, but
it should be fixed somehow later. See bug 1389675.
MozReview-Commit-ID: JojHufxNCiS
This doesn't actually implement style context reparenting in the style set yet; that part is next.
There is one behavior difference being introduced here compared to Gecko: we
don't reparent the first block piece of an {ib} (block-inside-inline) split
whose first inline piece is being reparented. This is actually a correctness
fix. In this testcase:
<style>
#target { color: green; }
#target::first-line { color: red; }
</style>
<div id="target">
<span>
<div>This should be green</div>
</span>
</div>
Gecko makes the text red, while every other browser makes it green.
We're preserving Gecko's behavior for out-of-flows in first-line so far, but
arguably it's wrong per spec and doesn't match other browsers either. We can
look into changing it later.
MozReview-Commit-ID: 5eC6G449Mlh
--HG--
extra : rebase_source : 8c333a0afe96c68a4e3b6aeca1b742ef8d5edd3b
ForAnimationOnly is somewhat misleading, it means actually we process
*only* animation-only restyle without normal restyle. The purpose of
ForAnimationOnly is for updating throttled animations to get correct position
of the animations when we need to handle events. Currently we do also update
unthrottled animations though.
MozReview-Commit-ID: HBCCluKrZs9
--HG--
extra : rebase_source : bb37080e44b161b8b0210e3ba3c055604cf43a72
Handling a document's node principal changing is done in part 9.
MozReview-Commit-ID: 1gPtRpddys5
--HG--
extra : rebase_source : f0b4d07481ae7215117b86c474f14658b61d6f06
Handling a document's node principal changing is done in part 9.
MozReview-Commit-ID: 1gPtRpddys5
--HG--
extra : rebase_source : def889e9ae4a428ccc02f9b5ac18f2ce640dc652
Before this refactoring, getComputedStyle could have side effects, and left the
style data in the element, so we could never arrive there without data.
There are a few crashtests that caught this, but this was already broken if you
called animate() on an element deep in a display: none subtree.
MozReview-Commit-ID: 1AvOvhAyOP3
--HG--
extra : rebase_source : 0a920df8809961f784026a14a624d8eafb4cc79f
Handling a document's node principal changing is done in part 9.
MozReview-Commit-ID: 1gPtRpddys5
--HG--
extra : rebase_source : 5b1d40af5ad0484440075e7229dc9ae3d5a13764
We need to call nsBindingManager's method from ServoStyleSet in a later
patch.
Also, we call nsStyleSet::SetBindingManager() immediately after we call
nsStyleSet::Init(). Therefore, we could pass binding manager to Init()
directly, and delete SetBindingManager().
MozReview-Commit-ID: 43WTpW3mSKX
--HG--
extra : rebase_source : f24f6085c51dfae1a969aee1e073720097d240d5
This commit adds class ServoStyleRuleMap which caches the mapping from
raw Servo style rule to Gecko's wrapper object.
It is a per-document object, and is added as an observer of document
when constructed, so that it updates data inside when possible.
For safety consideration, this change also makes ServoStyleRule support
weak pointer, and use weak pointer inside ServoStyleRuleMap.
MozReview-Commit-ID: YxBnZ88tjf
--HG--
extra : source : 0f2bc306d27b8ab22f1aa08aa9d44af0dba4694d
It was getting inial value from gecko side before and that was always
eCompatibility_NavQuirks. Created an FFI to fetch quirks mode.
MozReview-Commit-ID: 1lXsM9hwldZ
--HG--
extra : rebase_source : 17093f4cd46cc630d36535b01c8924e67ec98b3f
In next part, we'll use ServoStyleSet to host XBL stylesheets. The raw set
is not available until the resources are loaded, so it's easier to tell that
by checking whether the pointer is nullptr or not.
MozReview-Commit-ID: Hqydd55FPO9
--HG--
extra : rebase_source : 6df6c2666aea2ca8a8065d4f4d9b552ec7b3e6fe