This patch basically does:
* Add descriptor setters and generation count to CounterStyleRule in
Servo. (This code is mostly based on the old code inside
nsCSSCounterStyleRule for handling mutation.)
* Use RawServoCounterStyleRule in CounterStyleManager.
* Add ServoCounterStyleRule and remove nsCSSCounterStyleRule.
Test change:
* "fixed" was parsed as and thus serialized to "fixed 1", but Servo
doesn't do so. It preserves whether the number presents. Either way
is probably fine.
MozReview-Commit-ID: EtKTeu32isi
--HG--
extra : rebase_source : ec44f01c581003ce4b6ef69435a05de7f3da5469
This reworks bug 1440561 so that we only precompute loads that belong to our
user font set, avoiding messing up with fonts in the cache that belong to other
pages.
The loadability of a font is precomputed in PreTraverse in the same way as we
did, but only for the fonts that we may end up loading. This is stored in
FontFaceSet now.
Also, the principal shenanigans that this code did are reworked to be explicit
about when the document principal changes in ResetToURI, instead of having a
member around and a mutable variable. This makes the code easier to follow.
MozReview-Commit-ID: 9ofTbaLDUF7
To remove the dependency from ServoStyleSet.h to ServoBindings.h.
MozReview-Commit-ID: 6YJ71AnQklL
--HG--
extra : rebase_source : 20e1ead4438f3e3e457af2a4ae4e614992b5f050
extra : source : 53aae6abf7482d4366b66fc8b14d89bf762c19f3
It is no longer used, and removing this from ServoStyleSet allows us to
remove dependency from ServoStyleSet.h to StyleSheetInlines.h.
MozReview-Commit-ID: HzYNulJF7tf
--HG--
extra : rebase_source : f54811369fd7af27b2ee61d54143726e473c6640
extra : source : f872ca0df2d0a71508eeba67c2b922b87bdcbe01
Some of the definitions are needed for the headers removal in
following patches.
MozReview-Commit-ID: BCj7U7RgBLj
--HG--
extra : rebase_source : e8e437f76c4db6ec930ea0481b6c1a38129a5477
extra : source : a1c42220e5070fa4beea438859ab0daec3f3fe7b
We don't need the parent style context, nor the pseudo-element dance or anything
like that. All end up in the same place, Servo_ResolveStyle.
We cannot assert for text style resolution because of non-lazy frame
construction, and we cannot remove non-lazy frame construction because of XBL.
This is effectively the same code, since the old code passed the parent style
around from the frame tree / display contents map, which didn't have a similar
assertion either... Slow steps.
I'll improve and cleanup LazyFC in bug 1447506.
MozReview-Commit-ID: Ck4RCoFLGOi
Also, make them not rebuild the CascadeData synchronously, via the
FlushSkinSheets call, since that's broken. That fixes bug 1413119.
This is a little step in getting rid of XBL usage for Shadow DOM.
MozReview-Commit-ID: HJ7FeUZlRTW
--HG--
extra : rebase_source : 0fcd0ed461856c1e87e45ef63c9e1d2e81281469
This will make it easier to handle it properly for Shadow DOM, though this patch
doesn't do that.
This also makes some method inline and infallible for convenience, since nobody
checks the errors anyway.
MozReview-Commit-ID: Hq3erAUs5tf
This avoids resetting the computed values all the time, and paves the way to
avoid using a StyleSet on XBL bindings / Shadow DOM, which we should really
really do because it's super overkill.
There are some XBL bits that are kind of hacky, in particular the mStylistDirty,
but they'll go away soon, since I want to redo how we store styles in XBL.
The alternative, which was returning an array of indices or something was even
more hacky I think.
MozReview-Commit-ID: 6tEl5gebXVF
This will allow us to invoke it from nsAttrValueInlines.h, which can't
include ServoStyleSet.h due to circular dependencies.
MozReview-Commit-ID: BgC7ExyWRn7
This also makes the rule map not process all the stylesheets for the document,
which would be a mess with shadow DOM.
Far from the final, ideal state, but hey, progress.
MozReview-Commit-ID: 7TrifME9VZ
This is a pre-patch for the real fix of Bug 1418433.
In the real fix, we'll add a IncrementUndisplayedRestyleGeneration() call into
SetStylistStyleSheetsDirty(). However, the IncrementUndisplayedRestyleGeneration()
call needs get through some deep structures in nsPresContext, RestyleManager,...
etc., and doing so means we need to move bunches of related include files, forward
declarations, from .cpp file to .h file, which doesn't make sense.
Instead, we move the implementation parts of SetStylistStyleSheetsDirty() to .cpp
file (since it is now a bit more complicated than it was), so we can use the existing
include files in the .cpp file to add IncrementUndisplayedRestyleGeneration() call
(this is in a following patch).
MozReview-Commit-ID: 3Vp9qyCf8NA
--HG--
extra : rebase_source : 16386256e16a2ca98bf988d66d861cbea58490a3
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