Fixes crash in the created test as well as https://wpt.live/css/css-text
/word-spacing/reference/word-spacing-percent-001-ref.html. The WPT test
hasn't been imported as it passing is currently a false-positive due to
the fact that we don't yet respect `word-spacing` in most cases.
Updating the hovered node may fire events, and so we can't assume the
layout and paintable nodes we've found via hit testing will be valid
after doing it.
This helps make callers only use the slice of the output buffer that
was written to.
As part of updating the callers of the API several bugs were fixed and
useless code paths were removed:
- The exported data is not host-endianess dependent (always big endian)
- The exported data does not contain leading zeros
- The output buffer is only written up to the result's size
The spec language specifies 'Set maxScopeString to "/", followed by the
strings in XXXX’s path (including empty strings), separated from each
other by "/"': That is, adjacent components are separated by a '/', but
the last component does not get a trailing '/'.
This resulted in the generated scope string ending with '//' in some
cases, incorrectly tripping the 'Service-Worker-Allowed' security check
Without this, any relative url()s in the `content` property don't know
what style sheet they are in, which makes them load relative to the
document instead.
Taking a ColorResolutionContext directly instead of creating one from a
layout node allows us to call this from places where we don't have a
layout node.
Using a generic context argument will allow us to resolve colors in
places where we have all the required information but not in the form of
a layout node as was expected previously.
Now we pass all WPT tests in:
`css/css-properties-values-api/at-property-cssom`.
Note: Failing tests were false positives.
Proper handling of inheriting values and detecting computational
independence will be done in another PR.
QualifiedRule::for_each_as_declaration_list() now takes a rule_name, so
that the error message can actually be useful - we only know what a
qualified rule is by context.
Instead of random dbgln_if(CSS_PARSER_DEBUG) messages, this lets us
report what kind of error it was. Repeated errors are combined instead
of spamming the console.
Ideally this would also record where the error occurred, but not yet.
We have a bunch of TODO/FIXME about supporting applicable specifications
for algorithms that are not mentioned in the spec. There is no plan to
have any, there is nothing to do as of now.
The storage type was being incorrectly set to Session instead of Local,
apparently because of copying the implementation from
`Window::session_storage()`.
Bug introduced in commit 2066ed2318
Previously, the value of the `src` tag would always be used as the
image source URL when requesting an image context menu, which may not
be correct if an image uses a `srcset` or has a parent picture tag.