The :host family of pseudo class selectors select the shadow host
element when matching against a rule from within the element's shadow
tree.
This is a bit convoluted due to the fact that the document-level
StyleComputer keeps track of *all* style rules, and not just the
document-level ones.
In the future, we should refactor style storage so that shadow roots
have their own style scope, and we can simplify a lot of this.
(cherry picked from commit 4c326fc5f6f64797764e7f32a9789b74665f2fec)
This fixes an issue where :host(foo) would parse as if "foo" was the
on the right side of a descendant combinator.
Not testable yet, but will be in the next commit.
(cherry picked from commit 274c46a3c97e1f9969d18b7704ced4c39770e152)
This is the expected behavior per the HTML spec. Fixes an issue where
styling these elements wouldn't have the expected effect unless you also
set the display property.
(cherry picked from commit 3faff34bf6a290e4df1c73f92e8c7d992a78a8e0)
This would have saved me an hour of debugging, so putting it here for
the next person. :^)
(cherry picked from commit ebacb921dac6f8fd335d917100e6b04521a3f893)
We already have a FlyString of its value from parsing, and most users
also want a FlyString from it, so let's use that instead of converting
backwards and forwards.
The two users that did want a String are:
- Quotes, which make sense as FlyString instead, so I've converted that.
- Animation names, which should probably be FlyString too, but the code
currently also allows for other kinds of StyleValue, and I don't want
to dive into this right now to figure out if that's needed or not.
(cherry picked from commit 9fb44cb05777c6d7a8a1950258edadfcee6d4e09)
This does not appear to be correct; the `grid-area` property's value is
quite complicated, and not just a string.
(cherry picked from commit d2f04b9f0415ebfebb1d8f6386ff13f8df053674)
When loading a canned version of reddit.com, we end up parsing many many
shadow tree style sheets of roughly ~170 KiB text each.
None of them have '\r' or '\f', yet we spend 2-3 ms for each sheet just
looping over and reconstructing the text to see if we need to normalize
any newlines.
This patch makes the common case faster in two ways:
- We use TextCodec::Decoder::to_utf8() instead of process()
This way, we do a one-shot fast validation and conversion to UTF-8,
instead of using the generic code-point-at-a-time callback API.
- We scan for '\r' and '\f' before filtering, and if neither is present,
we simply use the unfiltered string.
With these changes, we now spend 0 ms in the filtering function for the
vast majority of style sheets I've seen so far.
(cherry picked from commit dba6216caa71796f25831908035cd9eb0fb54715)
This property is now correctly parsed.
Ladybird always uses overlay scrollbars so this property does nothing.
(cherry picked from commit 662317726549cd2dde4c7902b99f0b83397a3396)
This method was unused and a FIXME remained for combining it with
another, similar method.
(cherry picked from commit df7f7268db5edb37b735f30586d774544537e342)
Previously the entire slider track was colored.
Now only the lower part of the slider track (left side of the thumb) is
colored.
Chrome and Firefox do the same.
(cherry picked from commit 7766909415312b971252f8c7750b0a1873fd5ba0)
Instead of using fixed arbitrary colors for the background of the bar,
AccentColor and Background are now used.
(cherry picked from commit 062a266574a24fe13f2a77401b97f833c3cdd099)
Apple Clang doesn't like this, rather than waiting for their version of
random-clang-commit-to-call-a-release to catch up with llvm trunk, just
work around the issue.
Fixes#186.
(cherry picked from commit 8c9d3b30cf62016ffb03e425f1e7e3f2461262bf)
Now that EasingStyleValue is a lot nicer to use, there isn't much reason
to keep TimingFunction around.
(cherry picked from commit 7950992fc21e2428a7f32954bbe893a2b2d58cf7,
manually amended with the output of `git clang-format master`)
The values aren't that complex, so it doesn't make much sense to have a
dedicated generator for them. Parsing them manually also allows us to
have much more control over the produced values, so as a result of this
change, EasingStyleValue becomes much more ergonomic.
(cherry picked from commit 667e313731f06fabf2a3f75893c3e8f15a4172be,
manually amended with the output of `git clang-format master`)
Let's log which property we're trying to look up, since that's the most
interesting part!
(cherry picked from commit f7a83e57554c7a98cda165ea1fa18356a6ee54d9)
To make this straightforward, CSSKeyframesRule now uses a CSSRuleList
for internal storage.
(cherry picked from commit 7f2c833a39e150c7372299dcfe4d2d5590ae779f)
This readonly attribute returns the containing CSS rule, or null (in the
case of element inline style).
(cherry picked from commit a12d28fd3053638ce6f4215bed2d8d45cda86375)
This was made redundant in GH-12971 (SerenityOS), and removing it drops
a FIXME :^)
See:
- https://github.com/SerenityOS/serenity/pull/12971
(cherry picked from commit be08abbf8a0a62ae46275c3133f711c27b2efa02)