Replaced `GamepadButtonList` interface with a frozen array of gamepad
buttons to match the gamepad webidl specification.
Testing: No idlharness tests possible since the values can't be accessed
without a real gamepad.
Fixes: #44333
---------
Signed-off-by: Rover track <rishan.pgowda@gmail.com>
Instead of readily adding a strut for text carets when processing a line
break, wait until a line is finished. This allows placing a strut on the
final line. In addition to fixing #41338 this will also make it possible
to handle line breaks as a separate kind of text run item so that we can
preserve shaping results between layouts.
In addition, some changes are made in script to ensure that these
placeholders
are never placed for non-textual input elements.
Testing: This change adds a Servo-specific WPT test. Caret rendering
isn't specified.
Fixes: #41338
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Add the Storage Standard WebIDL for NavigatorStorage and StorageManager,
wire navigator.storage on Window and Worker, and implement persisted(),
persist(), and estimate().
Testing: covered by WP test.
part of #39100fixes#39101
---------
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
Add a cache for `SameFormattingContextBlock`s: A new kind of cache
is added which allows reusing fragments for
`SameFormattingContextBlock` (the majority of block level elements).
This can reduce the amount of fragment tree construction during
incremental layout (although with a 40 byte overhead per
`SameFormattingContextBlock`).
Testing: This change adds a new Servo-specific WPT test that verifies
that
the minimal number of `Fragment`s are rebuilt after an incremental
layout.
Previously, when running `flexbox-deeply-nested-column-flow.html` from
`tests/blink_perf_tests/perf_tests/layout/`, performance would degrade
with successive test runs. This is due to how slow inline layout is.
This change
removes that progressive degradation, though we may be able to remove
this cache with improvements to inline layout.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Luke Warlow <lwarlow@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This is a speculative fix for #40543. Although I could not get this test
to flake locally, it is obviously wrong to assumee that web fonts (Ahem
in this case) is loaded at the time of `window.onload`. This change
makes all the tests Promise tests and has them await
`document.fonts.ready` before running. This should fix the
intermittency.
Testing: This should fix itnermittency as seen on the CI.
Fixes: #40543.
Signed-off-by: Martin Robinson <mrobinson@fastmail.fm>
Co-authored-by: Martin Robinson <mrobinson@fastmail.fm>
This is a speculative fix for #39668. Although I could not get this test
to flake locally, it is obviously wrong to assumee that web fonts (Ahem
in this case) is loaded at the time of `window.onload`. This change
makes all the tests Promise tests and has them await
`document.fonts.ready` before running. This should fix the
intermittency.
Testing: This should fix intermittency as seen on the CI.
Fixes: #39668
Signed-off-by: Martin Robinson <mrobinson@fastmail.fm>
Co-authored-by: Martin Robinson <mrobinson@fastmail.fm>
This is a very minor, but annoying bit of technical debt that we have
carried for over a decade. Many of the Servo-specific WPT-style tests
had names that didn't match the naming convention used in WPT. In some
cases tests and references were named `test_a.html` for the test and
`test_b.html` for the reference. To make things more confusing,
sometimes two tests in a series were named `test_a.html`, `test_b.html`
and `test_ref.html` for the reference.
This change makes it so that tests are named consistenty and with
hyphens which are more common in WPT:
- `test-001.html`
- `test-002.html`
- `test-ref.html`
Testing: This shouldn't change results, as this just renames the test
files.
Fixes#2463.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This tests a feature (`about:sslfail`) that was removed in #14360 and
has been flaky for years. At this point, the test has been flaking for a
decade longer after the original feature existed! We can just go ahead
and remove it I think.
Testing: This change just removes a test, so doesn't need new tests.
Fixes: #10760
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This change converts a collection of old Servo-specific crash tests into
WPT style crash tests, which are supported directly by the WPT test
harness. The main change here is the addition of `-crash.html` to the
end
of the test name (this is how the harness detects crash tests) and the
removal of `testharness.js` from the tests. This is a preparation for
#44232.
Testing: This change just changes the tests, so should be tested by the
test run.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
TL;DR: We increase stack size of `ScriptThread` to 8MiB, and set Stylo
stack size environment var
to 8 MiB for all builds. This only reserves virtual memory space which
is
basically unlimited for 64-bit machine,
matches the recursion depth of Chromium for the example, which also uses
8MiB.
Stylo stack increase is necessary to prevent overflow when
refreshing/navigating to the example,
probably because initial load restyle incrementally but not refresh.
Testing: Added a Servo-specific test.
---
For example in #43845, we get stack overflow when we got more than 394
nested shadow roots.
For Chromium, it happens for more than 1631:
<img width="290" height="127" alt="image"
src="https://github.com/user-attachments/assets/b3d75627-4e80-4586-9b85-4b58d8a0cd33"
/>
For Firefox, it overflows for more than 1052.
Initially I thought we didn't implement this optimally, and have
unnecessary recursion depth.
But the real reason is explained in Rust std:
> The default stack size is platform-dependent and subject to change.
Currently, it is 2 MiB on all Tier-1 platforms.
For Chromium, the visual studio dumpbin shows the stack size :
```
Dump of file C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
OPTIONAL HEADER VALUES
800000 size of stack reserve
```
This is hex value, which is $8*16^5$, exactly 8MiB.
After we make the same change in Servo, we are fine at 1601 and
overflows at 1602.
This matches Chromium behaviour, defeating firefox, and should not
create much overhead,
as this only reserves virtual memory space:
I tried to increase the value to 512MiB, but task manager still says
73MB RAM used,
and we won't crash even with 10000 nested shadow roots.
But that is just for more evidence and uncalled for.
Fixes: #43845
---------
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This change makes it so that when you press alt or control (depending on
the platform) while backspacing, entire words are deleted. This matches
the behavior of the major desktop platforms.
Testing: This change adds a Servo-specific test for this behavior as
well
as for normal backspacing.
Signed-off-by: Martin Robinson <mrobinson@fastmail.fm>
Co-authored-by: Martin Robinson <mrobinson@fastmail.fm>
<https://heycam.github.io/webidl/#es-operations>
<https://html.spec.whatwg.org/multipage/#integration-with-idl>
This PR implements the IDL security check, which is an important (but
not only) mechanism to restrict cross-origin DOM accesses.
This implementation follows WebKit's behavior and not the specification
for the following reasons:
- Neither Gecko nor WebKit implements the specification's behavior.
- This would require a relatively elaborate mechanism *just* to have
access to the target object's `CrossOriginProperties`.
---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)
---
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Implement the `SubtleCrypto.supports` method in our WebCrypto API. The
*check support for an algorithm* algorithm is also implemented to
support the functionality of the `SubtleCrypto.supports` method.
The `SubtleCrypto.supports` method has two overloads. One of them has a
union containing a non-object value at the distinguishing index. Our
`codegen.py` currently does not support unions of non-object values at
distinguish index. So, `codegen.py` is also patched to extend its
support to unions of objects, strings, numbers and boolean values.
Specification of `SubtleCrypto.supports`:
https://wicg.github.io/webcrypto-modern-algos/#SubtleCrypto-method-supports
Specification of "check support for an algorithm":
https://wicg.github.io/webcrypto-modern-algos/#dfn-check-support-for-algorithm
Testing:
- Pass WPT tests related to `supports` method.
- Add new tests for IDL operation overloading with unions of various
types.
Fixes: Part of #40687
---------
Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
In addition to making it so that textual `<input>` and `<textarea>`
share a common shadow DOM structure, this allows styling the
`<textarea>` placeholder. It is now properly shown in grey.
Testing: This fixes a few WPT tests.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Implement the layout of `<input type="range">`. Support automatically
calculating the position of thumb based on the current input value, and
the size of range-track and range-thumb. Added a
document.has_script_or_layout_blocker function to detect whether it is
possible to run box_area_query during bind_to_tree, add delay_task if
there are blocker.
Here are some of the fixes made in this PR:
1. Fixed the structure for input type range's pseudo elements.
2. Fixed the positioning of input type range's thumb based on current
value, width, and direction.
3. Allow input type range to stretch vertically in a bigger container.
Original PR: #41024
Stylo PR: https://github.com/servo/stylo/pull/310
Testing: Some improvements in WPT tests, with a few regressions. This
change includes a Servo-specific appearance test to detect unexpected
changes to the look and feel of range widgets.
Fixes: #22728
---------
Signed-off-by: Budiman Arbenta <arbenta6@gmail.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: rayguo17 <tin.tun.aung1@huawei.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This change adds support for `background-blend-mode` to Servo by
creating one stacking context per blend and a single stacking context to
serve as the blend container. This matches the approach that Gecko
takes.
Stylo PR: servo/stylo#344
Testing: This change causes some WPT tests to start passing. In general
this feature
is not well exercised by tests. I suspect that blending is hard to test
properly.
Fixes: #43621
Signed-off-by: Martin Robinson <mrobinson@fastmail.fm>
Co-authored-by: Martin Robinson <mrobinson@fastmail.fm>
This is the first step toward implementing the Web Animations
specification. It adds support for the `AnimationTimeline` and
`DocumentTimeline` specification concepts. Note that there was already
an `AnimationTimeline`, but it did not implement the specification.
Testing: Various WPT start to pass or no longer error / timeout.
Signed-off-by: Martin Robinson <mrobinson@abandonedwig.info>
Co-authored-by: Martin Robinson <mrobinson@abandonedwig.info>
As titled. The `Vec<UnshapedTextRun>` produced by `fn
build_unshaped_text_runs`
is only used by `into_shaped_text_run`, which filters out those without
string or font.
It is better to not allocate them in the first place.
Testing: [Try](https://github.com/servo/servo/actions/runs/23642089615).
Added a Servo-specific crash test to ensure we will not have empty
font/string in a text run.
---------
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This adds the WebIDl and implementation for the HTMLMarqueeElement type.
The `<marquee>` HTML is now assigned this type.
None of the contained properties or methods are implemented yet.
Testing: Existing WPTs
Signed-off-by: Luke Warlow <lwarlow@igalia.com>
The change makes it so that `<marquee>` elements render more like the do
in Chrome. The text will not animate, but likewise it does not wrap and
the element will stretch to fill the inline space in its containing
block.
Testing: This change adds a Servo-specific appearance test. This
essentially
just replicates the user agent style of `<marquee>`. It's quite
difficult to
write tests for appearance. Some WPT tests start to pass, but
`/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-min-intrinsic-size.html`
starts to fail. This is due to the fact that though the `<marquee>`
style
is improved, we do not yet correctly handle the minimum intrinsic size
properly.
Fixes: #43517
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
On Windows and Linux the control key is expected to move the text caret
by word. In addition, it seems like the alt wasn't working properly on
Linux. This change makes the modifier key for word movement dependent on
the platform.
Testing: This change adds a Servo-specific keyboard motion test.
Keyboard motion events are not specified AFAIK.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Instead of using ASCII character to process the `accesskey` attribute
use the hardware key code that comes with the platform key event. This
aligns our implementation closer to the spec and allows `accesskey` to
work properly with lowercase letters on Linux machines (where shift is
part of the access key sequence). This might introduce some issues with
non-US keyboards, but those issues are inherent in the specification --
one reason why `accesskey` is not recommended for use.
Testing: A Servo-specific accesskey test is extended to cover this case.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
When clicking just to the left of a text fragment, we should return the
first index in that fragment. This means that when you click on the
border of a text input, the first fragment is selected. We do this by
improving the distance calculation logic to account for this situation.
Testing: This allows us to remove the "fudge factor" that we were adding
to
mouse handling input tests. In addition, the content rectangle
calculation
function is improved and made more general for these tests. In addition,
two new Servo-specific tests are added to verify the behavior when
clicking
in the padding of various text inputs.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Propagate the had_duplicate_attributes flag from html5ever's
ElementFlags through to the Element struct, enabling step 3 of the
CSP "is element nonceable" algorithm. Elements with duplicate
attributes are now correctly marked as "Not Nonceable", preventing
scripts with duplicate attributes from bypassing CSP nonce checks.
Testing: We still need https://github.com/servo/html5ever/issues/118 to
fully pass the
`content-security-policy/script-src/nonce-enforce-blocked.html` wpt
test. But I was able to uncomment some of the remaining tests on
`mozilla/csp/nonce-external-script-malformed-blocked.html`
---------
Signed-off-by: Dyego Aurélio <dyegoaurelio@gmail.com>
This change allows pressing the spacebar to cause a page down or page up
scroll. This matches the behavior of other browsers. In addition,
keyboard
scrolling tests are moved to the same directory as other input method
tests.
Testing: This change adds some additional testing to Servo-specific
keyboard scrolling tests.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Servo has for years implemented a behavior where spacebar or enter click
on a focused element will trigger a click. That behavior used to be
unspecified, but now it is. The specification says that this should only
happen on state-changing elements. This change makes this happen using
activatable elements as a heuristic (as state-changing elements are not
defined in the specification). In addition, the behavior is integrated
into the default keyboard event handler code.
Testing: This change adds a Servo-specific test due to the ambiguities
in the specification.
Fixes: #39028.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Add support for the "sequential focus navigation starting point" which
allows clicking on an unfocuable part of the part and then having
sequential focus start from that part when it is triggered later. In
addition:
1. Start moving the sequential focus code match the specification more
more closely.
2. Generalize the
`Element::find_click_focusable_shadow_host_if_necessary` method to be
able to find the appropriate focuable area after a click and
correctly handle clicking on children of focusable elements.
Testing: This adds two Servo-specific tests as sequential focus
navigation
behavior is so lightly specified. In addition, on WPT subtest starts to
fail
for `<label>`s in `<summary>`, but this just exposes existing issues we
have
with two unimplemented features:
1. Clicking on activable elements in `<summary>` should not expand the
`<details>`.
2. Clicking on a `<label>` should activate its target.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Instead of just focusing elements that are the target of tab navigation,
also scroll them into view. Though this is unspecified, this is what all
other browsers do.
Testing: This change adds a new Servo-specific test. The behavior isn't
really specified.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
There is a `handle_event` virtual method on `Node` that triggers the
default event handler. Typically the "superclass" virtual method is
called and then the specific type runs its default event handler. This
isn't good for form controls, because typically the event handler should
prevent further event handlers from running. This badness can be
observed by pressing down in a text input, which will both move the
cursor as well as scroll the page. 🙃
This change makes it so that the default form control event handler
consistently calls the `Event::mark_as_handled` method and triggers the
"superclass" event handler *after* running its own. In addition, the
scrolling default event handler on `Node` now doesn't run if the `Event`
was already handled.
Finally, a little bit of dead event handling code is removed.
Testing: This change adds a Servo-specific test for this behavior.
Fixes: #40785
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Remove command invokers preference
This now passes most of the relevant tests. Most of the remaining
failures are due to missing functionality such as the popover API,
element reflection properties (see
https://github.com/servo/servo/issues/42884), and issues with the event
retargeting code that doesn't handle shadow dom correctly.
Signed-off-by: Luke Warlow <lwarlow@igalia.com>
For the longest time we've had a `dispatch_event` boolean flag in our
error reporting code that determines whether or not to fire an `error`
event. It was only set to `false` in the event handler code due to a
double borrow that would occur otherwise. It seems that this is no
longer a problem, so we can remove the flag and correctly fire the event
in that case too.
Testing: A new test starts to pass and
`html/webappapis/scripting/processing-model-2/runtime-error-in-body-onerror.html`
does not crash
Fixes: https://github.com/servo/servo/issues/13152
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
The equality check used to detect whether an element has an access key
assigned was reversed. This meant that access keys did not work on
non-form control elements. This change fixes the equality sign and adds
a test for this behavior.
Testing: A new Servo-specific test is added. Access key behavior
activation
behavior is very lightly specified so the way we deal with it is
Servo-specific at the moment.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This PR modifies the text layout in such a way that text carets can
render on empty lines (other than the first if the textarea is empty).
Zero-length segments are added to support caret rendering. The last
line, if it is without content, does not currently render a caret
correctly
This corresponds to cases 0, 1, and 3 in #41338
Testing: WPT subset `tests/wpt/tests/css/css-text/` ran as expected, one
internal WPT test was added
Fixes: Partially addresses https://github.com/servo/servo/issues/41338
---------
Signed-off-by: Freya Arbjerg <git@arbjerg.dev>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
When the async parser thread finds a `<meta charset>` tag then it asks
the main thread whether parsing should restart. The main thread wasn't
responding, so the parser got stuck.
Part of https://github.com/servo/servo/issues/37418
Testing: This change adds a test
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This PR fixes two related issues with Content Security Policy (CSP)
nonce validation for external scripts:
1. Missing nonce validation for external scripts with malformed
attributes
2. Incorrect violation event reporting for blocked external resources
This makes servo closer to passing the `nonce-enforce-blocked` wpt test.
The remaining failures are blocked by required changes in the html
parser.
1. Svg script support (https://github.com/servo/html5ever/issues/118)
```html
<svg xmlns="http://www.w3.org/2000/svg">
<script attribute attribute nonce="abc">
t.unreached_func("Duplicate attribute in SVG, no execution.")();
</script>
</svg>
```
2. Duplicate attrs check
the html parser needs to provide this flag, as mentioned on the original
commit message
(4821bc0ab0)
```html
<script attribute attribute nonce="abc">
t.unreached_func("Duplicate attribute, no execution.")();
</script>
<script attribute attribute=<style nonce="abc">
t.unreached_func("2# Duplicate attribute, no execution.")();
</script>
[...]
<script src="../support/nonce-should-be-blocked.js?5" attribute attribute nonce="abc"></script>
```
I've also created a PR to implement the duplicate attrs flag on
html5ever https://github.com/servo/html5ever/pull/695
Testing: doesn't fixes the aforementioned wpt test yet.
Fixes: part of #36437
---------
Signed-off-by: Dyego Aurélio <dyegoaurelio@gmail.com>
The current implementation treats an SVG element that needs a new
serialized tree as non-replaced content, so we attempt to lay out all of
the children. If serialization is successful, subsequent layouts treat
the SVG as replaced content and ignore the children, but the children's
layout data is never cleaned up. This means that layout queries against
those children can return stale data, which can lead to unexpected
results. By always treating SVG elements as replaced content, we remove
this footgun and improve consistency.
Testing: New crashtest added. It doesn't make sense to upstream this
because our SVG implementation is very nonstandard.
Fixes: #42291Fixes: #40900
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
When fragment tree layout is going to run for a node that starts an
independent formatting context, but only because an ancestor was
damaged, preserve the fragment cache. This means that in the optimistic
case we do not need to re-run fragment tree layout for this independent
formatting context. Previously this was only done for the children of
the independent formatting context, but the fragment cache is robust
enough to detect any layout changes necessary for the IFC fragment
itself as well. This helps to avoid so much fragment reconstruction
during incremental layout.
Testing: `basic-fragment-tree-layout.html` is updated reflecting the
decrease
in the number of fragments rebuilt.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Luke Warlow <lwarlow@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This reverts commit 1f42551042.
This change led to a decrease in Speedometer performance and needs to be
reworked to avoid that.
Testing: This is just a revert.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Now `ServoTestUtils.forceLayout()` will provide the number of fragments
that have been restyled and rebuilt. This will be useful to test that
incremental layout works well.
Testing: Adds a test using this new API
---------
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Luke Warlow <lwarlow@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This change makes it so that selection changes driven by user input
events also fire the `select` event and not just selection changes from
script. In addition the change eliminate the `SelectionState` data
structure instead opting to store the `SelectionDirection` in the
`SharedSelection`. That way there is a centralized place that selection
changes are handled.
Testing: This change adds a Servo-specific WPT test. This is
Servo-specific as
it relies on engine-specific text selection behavior.
Fixes: #41308.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
These three methods date back from the very early history of Servo and
are no longer necessary:
1. `Window.debug`: `console.log` is a better replacement for this method
now. A manual test that tests the very basics of JavaScript used
this. This test is removed as well.
2. `Window.gc`: This can be replaced with `TestUtils.gc`, which is part
of a W3C specification.
3. `Window.js_backtrace`: This method is moved to `ServoTestUtils`.
Testing: Tests are updated to reflect these changes.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This introduces a new `ServoTestUtils` namespace with a `forceLayout()`
function. This `forceLayout()` function returns an object which
currently has an array of the phases ran by layout. Also moves
`panic()`, `crashHard()` and `advanceClock()` from `TestBinding` to this
new namespace. `TestBinding` is meant to test the bindings generation,
but these are more generic helpers for Servo-only tests.
Testing: This change adds a series of Servo-only tests that verify the
behavior of the new `forceLayout()` function. Tests that rely on the
moved interfaces are updated and should continue to pass.
Signed-off-by: Luke Warlow <lwarlow@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Indexeddb: transaction lifecycle
Testing: more Indexeddb test should pass
part of #40983
---------
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
This continues #41916
Changelog:
- Upstream:
360787fff5...7cd2a178d3
- Servo fixups:
e4d50e905e...d9831d464b
Stylo tracking issue: https://github.com/servo/stylo/issues/305
In particular, this adds support for `alignment-baseline` and
`baseline-shift`, and turns `vertical-align` into a shorthand of them.
This also introduces `vertical-align: center`.
Testing: Various tests improve. Some internal tests are updated because
they were wrong. And some fail because we don't support presentation
attributes on SVG elements.
---------
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Servo does not yet calculate the ink overflow area, as this sort of
thing is usually a result of `contain: paint` which Servo does not
support yet. We just need to ensure that text clipping is large
enough to contain the ink of all of the glyphs in the run. This change
just expands the rectangle based on glyph advances by 2 times the
largest advance, which should be big enough for most glyphs.
This is a big of a workaround until we have support for `contain:
paint`.
Testing:
- This change adds a Servo-specific test to ensure glyphs are fully
inked. While this test would run just fine in other browsers, it isn't
very
useful to them as this is test is very specific to the way that Servo
draws
glyphs.
- This also fixes a variety of existing WPT tests.
Fixes: #41413.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>