Commit graph

10347 commits

Author SHA1 Message Date
Martin Robinson
2ce306f450
script: Create CSSStyleOwner::Null for getComputedStyle (#36272)
This new `CSSStyleOwner` variant is used when the pseudo-element
argument fails to parse properly or is for some unknown or unsupported
pseudo-element.

Testing: There are tests for this change. Various tests start to pass
and some start to
fail. New failures are due to partial or fully missing support for
pseudo-elements such
as:
 - `::selection`
 - `::first-letter` and `::first-line`
 - `::marker`

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-04-02 13:54:42 +00:00
Oriol Brufau
1f13e8b596
layout: Allow collapsing bottom margins with any indefinite block size (#36278)
According to CSS2, the bottom margin of a block container can collapse
with the bottom margin of its last in-flow child if `height` computes to
`auto`.

However, according to CSS Sizing, that was "legacy spec prose" and
should be interpreted as "behaves as `auto`".

Therefore, cyclic percentages and intrinsic keywords like `min-content`
shouldn't prevent margin collapse, because they behave as `auto`.

This change aligns Servo with Gecko and Blink, but diverges from WebKit.

https://www.w3.org/TR/CSS22/box.html#collapsing-margins
https://www.w3.org/TR/css-sizing/#behave-auto

Testing:
-
`tests/wpt/tests/css/css-sizing/margin-collapse-with-indefinite-block-size-001.html`
-
`tests/wpt/tests/css/css-sizing/margin-collapse-with-indefinite-block-size-002.html`
-
`tests/wpt/tests/css/css-sizing/margin-collapse-with-indefinite-block-size-003.html`
-
`tests/wpt/tests/css/css-sizing/margin-collapse-with-indefinite-block-size-004.html`
-
`tests/wpt/tests/css/css-sizing/margin-collapse-with-indefinite-block-size-005.html`

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-02 12:10:04 +00:00
Andrei Volykhin
3bc0eeab8f
dom: Firing "click" event as synthetic pointer event (#36274)
According to specification

https://html.spec.whatwg.org/multipage/webappapis.html#fire-a-click-event
"Firing a click event at target means firing a synthetic pointer event
named click at target"

So need to replace synthetic mouse event with "click" type to pointer
event.

https://w3c.github.io/pointerevents/#the-click-auxclick-and-contextmenu-events
https://www.w3.org/TR/uievents/#event-type-click

Firing "click" event could be triggered from script or by UA:
- element.click()
(https://html.spec.whatwg.org/multipage/interaction.html#dom-click)
- form implicit submission
(https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#implicit-submission)
- keyboard activation (space)

---
- [x] ./mach build -d does not report any errors
- [x] ./mach test-tidy does not report any errors
- [x] There are tests for these changes
tests/wpt/tests/shadow-dom/event-composed.html
tests/wpt/tests/uievents/interface/click-event.htm

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-04-02 11:20:25 +00:00
Tim van der Lippe
0d38d6239a
Remove meta-legacy-layout wpt tests (#36281)
These tests were related to the legacy layout engine which has been
removed.
Therefore, they are considered leftover and can be removed.

Fixes #36277

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-04-01 19:19:21 +00:00
Oriol Brufau
0cdc1dcf72
Turn CSSStyleRule into a CSSGroupingRule subclass (#36254)
Note that `StyleRule` may not have the `CssRules` readily available,
they may need to be created. So the previous approach of providing
`CSSGroupingRule` with the `CssRules` is no good: it would require
writing them in advance, just in case they end up being used.

Therefore, this removes the `CSSGroupingRule::rules` field. Instead,
they are lazily obtained in `CSSGroupingRule::rulelist()` by downcasting
and calling the appropriate method for the subclass.

Testing: covered by WPT
Fixes: #36245

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-01 19:18:07 +00:00
Steven Novaryo
a77592e281
canvas: Implement line dash setters and getters (#36257)
Implement `setLineDash`, `getLineDash`, and `lineDashOffset` from
`CanvasPathDrawingStyles` mixin, according to the spec
https://html.spec.whatwg.org/multipage/canvas.html#canvaspathdrawingstyles.

Testing: Existing WPT.

---------

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
2025-04-01 11:22:00 +00:00
Oriol Brufau
bc6926d1fe
Implement CSSNestedDeclarations (#36248)
This is the CSSOM interface that represents a nested declarations rule.
https://drafts.csswg.org/css-nesting/#the-cssnestrule

Testing: `/_mozilla/mozilla/interfaces.https.html`. And once
`CSSStyleRule` becomes a `CSSGroupingRule` subclass, this will be
further covered by `/css/css-nestting/`.
This is part of #36245

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-01 11:20:46 +00:00
Oriol Brufau
e8d5a019a4
Enable CSS parent selector (&) (#36249)
Bumps Stylo to servo/stylo#164
Changelog:
bc4717c784...600b5c4297

Testing: covered by WPT
This is part of https://github.com/servo/servo/issues/36245

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-01 09:08:18 +00:00
Josh Matthews
fcef1dff9d
Fix null realm assertion when activating a service worker (#36256)
Ensure there is an active realm when dispatching the `activation` DOM
event to the ServiceWorker global.

Testing: Existing WPT coverage.
Fixes: #36114
Fixes: #36235
Fixes: #36231

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-04-01 08:13:02 +00:00
MDCODE247
be38c5478f
script: Use RegExpFlag_UnicodeSets when validating regular expressions in HTMLInputElement (#36236)
Changed `RegExpFlag_Unicode` to `RegExpFlag_UnicodeSets` in all
instances.

Testing: Ran `./mach test-wpt
tests/wpt/tests/html/semantics/forms/constraints/form-validation-validity-patternMismatch.html`
and all tests passed successfully.
Fixes: #36075

---------

Signed-off-by: MDCODE247 <ammedabubakard500@gmail.com>
2025-04-01 07:29:24 +00:00
Oriol Brufau
77525cef84
Enable css-nesting WPT tests (#36246)
So that we can see the improvement when enabling the feature.

Testing: This PR enables tests
This is part of #36245

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-03-31 19:07:27 +00:00
Andrei Volykhin
f48c3a5e2a
dom: Set "composed" flag on construction for some event types (#36239)
"Composed" flag (https://dom.spec.whatwg.org/#composed-flag) should be
properly set on event construction phase from optional "EventInit"
dictionary
(https://dom.spec.whatwg.org/#dom-eventinit-composed).

The limited set of event types (Custom/Error/Focus/Mouse) will be
affected by this CL (used in WPT tests).

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

- [X] There are WPT shadow-dom tests which have new issues related to
event "relatedTarget" property
tests/wpt/tests/shadow-dom/event-composed-path-with-related-target.html
  tests/wpt/tests/shadow-dom/event-with-related-target.html

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-03-31 17:15:48 +00:00
Josh Matthews
7382efa209
script: Fix resize observer depth calculation for Shadow DOM. (#36230)
Follow the specification more closely by using the flat tree when
calculating depth for the resize observer.

Testing: Newly passing WPT test.
Fixes: #36092

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-03-31 16:01:16 +00:00
Josh Matthews
ee95ef53fb
Enable service worker WPT tests. (#36221)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-03-31 08:31:24 +00:00
Servo WPT Sync
c593e15fa8
Update web-platform-tests to revision b'efce5c7cd31b0e1add4f41758504c767b56abeed' (#36222)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-03-30 01:40:11 +00:00
chocolate-pie
987716ca4b
layout: Implement support for image-set() notation (#36210)
Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com>
2025-03-29 13:20:16 +00:00
Martin Robinson
b5c8164e99
layout: Simplify and generalize the usage of pseudo-elements (#36202)
- Remove the last remaining Servo-specific PseudoElement enum from
  layout. This was made to select `::before` and `::after` (both eager
  pseudo-elements), but now `traverse_pseudo_element` is called
  `traverse_eager_pseudo_element` and should work on any eager pseudo
  element.
- Expose a single way of getting psuedo-element variants of
  ThreadSafeLayoutElement in the Layout DOM, which returns `None` when
  the pseudo-element doesn't apply (not defined for eager
  pseudo-elements or when trying to get `<details>` related
  pseudo-elements on elements that they don't apply to).
- Ensure that NodeAndStyleInfo always refers to a node. This is done by
  making sure that anonymous boxes are all associated with their
  originating node.

These changes are prepatory work for implementation of the `::marker`
pseudo-element as well as ensuring that all anonymous boxes can be
cached into the box tree eventually.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-03-29 12:41:04 +00:00
Andrei Volykhin
5f5bf87eee
dom: Track "removed" event listener status (#36163)
The DOM event listener "removed" status should be supported to track
the following situations (with immediate effect of listener removal):
- Removing a later event listener while an earlier listener
  for the same event is running
- Nested usage (recursively dispatch another event) of "once" listeners
https://dom.spec.whatwg.org/#event-listener-removed

During event dispatching requires to clone event listeners list
on "invoke" step https://dom.spec.whatwg.org/#concept-event-listener-invoke
and the lowercase "event listener" concept in Servo is EventListenerEntry
https://dom.spec.whatwg.org/#concept-event-listener

Bug: #25479, #25090

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-03-28 23:34:04 +00:00
Andreu Botella
95c3033456
Consume BOM in the text() method of fetch bodies (#36192)
In the fetch spec, the `text()` method of `Body` (an interface mixin
implemented by both `Request` and `Response`) consumes the body with
the Encoding spec "UTF-8 decode" algorithm, which skips the UTF-8 BOM
if it is present at the beginning of the body. Servo's implementation
does not do that. This patch fixes this.

Signed-off-by: Andreu Botella <abotella@igalia.com>
2025-03-28 19:02:48 +00:00
Andreu Botella
482d28e4ff
Fix content-type when creating a Request with FormData body (#36194)
When you create a `Request` object with a `FormData` body, the spec
says that the `Content-Type` header should start with
`multipart/form-data; boundary=`. However, in Servo's implementation
it started with `multipart/form-data;boundary=`, without the space.

While all reasonable servers should be able to that headers whether
the space is present or not, this brings Servo closer to the spec, and
also makes some WPT tests pass.

Note that submitting a form with `enctype="multipart/form-data"` does
produce a `Content-Type` header with the space (see
`HTMLFormElement::submit_entity_body`).

Signed-off-by: Andreu Botella <abotella@igalia.com>
2025-03-28 13:33:07 +00:00
Barigbue Nbira
5a4e232cb6
fix: prevent missing value error for radio button inputs without a name (#36197)
Signed-off-by: Barigbue <barigbuenbira@gmail.com>
2025-03-28 11:20:59 +00:00
Servo WPT Sync
ecaf2930cc
Update web-platform-tests to revision b'9d20f3ae600d00673a27a69f69e13d4cd8eca443' (#36195)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-03-28 06:07:42 +00:00
elomscansio
a8063b8b4b
fix(parser): Set shadow’s available to element internals in attach_declarative_shadow (#36173)
Aligns the implementation with step 8.5 of the HTML spec for parsing
a <template> element in the InHead state by setting
shadow_root.set_available_to_element_internals(true) after
assigning the shadow root to the template’s contents.

Also removes tests/wpt/meta/shadow-dom/declarative/declarative-shadow-dom-available-to-element-internals.html.ini
since the test expectations are now updated accordingly.

Spec reference: https://html.spec.whatwg.org/multipage/#parsing-main-inhead

Signed-off-by: Emmanuel Elom <elomemmanuel007@gmail.com>
2025-03-27 17:20:42 +00:00
Simon Wülker
517f99e067
Start implementing the URLPattern API (#36144)
* Start working on a basic URLPattern implementation

This is API part of Interop 2025, so we should definitely support it!

This change implements the basic workflow for parsing
and compiling URL patterns. Parts of it are stubbed out and will be
implemented later.

For now the API is preference-gated behind "dom_urlpattern_enabled".

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Preference-gate the URLPattern API

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update WPT expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Fix full wildcard value (Should be ".*" not "*")

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-03-27 10:39:57 +00:00
Josh Matthews
53a2e61fec
Make DOMPoint and DOMPointReadOnly serializable (#35989)
* script: Make DOMPointReadOnly serializable.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Make DOMPoint serializable.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Shrink worker script event.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Update components/script/dom/dompoint.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-03-27 01:35:02 +00:00
elomscansio
30a2a89d16
Fix Backspace deleting entire previous line in <textarea> (#36112)
* test(textinput): Add test for backspace at beginning of line in textarea

Introduce a test to reproduce and verify the fix for backspacing at the
beginning of a line in a multiline textarea. This ensures that pressing
Backspace when the cursor is at the start of a line correctly removes the
newline without deleting the entire previous line’s content.

Related to: #27523

Signed-off-by: Emmanuel Elom <elomemmanuel007@gmail.com>

* fix(textinput): Preserve selection origin when adjusting vertical position

Fixes an issue where pressing Backspace at the beginning of a line in a
textarea incorrectly deleted the entire previous line's content. This happened
because `self.adjust_vertical(-1, select)` modified `selection_origin` and
`edit_point`, but `selection_origin` was not restored before performing the
horizontal adjustment. As a result, `self.selection_start()` and
`self.selection_end()` were inconsistent, leading to `replace_operation`
erasing the entire line.

Now, we temporarily store `selection_origin` before adjusting vertical
position and restore it afterward to ensure proper cursor and selection
behavior.

Fixes: #27523
Signed-off-by: Emmanuel Elom <elomemmanuel007@gmail.com>

---------

Signed-off-by: Emmanuel Elom <elomemmanuel007@gmail.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-03-26 18:37:48 +00:00
Lukas Lihotzki
251eeb2c2d
Add Path2D (#35783)
Signed-off-by: Lukas Lihotzki <lukas@lihotzki.de>
2025-03-26 12:12:44 +00:00
Michael Rees
09041e77a0
Fix check in get_array_index_from_id to return early on ASCII char (#36136)
* fix: wrong ascii check in get_array_index_from_id

Signed-off-by: Michael Rees <mrees@noeontheend.com>

* Update WPT expectations

Signed-off-by: Michael Rees <mrees@noeontheend.com>

---------

Signed-off-by: Michael Rees <mrees@noeontheend.com>
2025-03-25 19:27:38 +00:00
Simon Wülker
c8a8f56f4e
Import URLPattern tests (#36145)
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-03-25 17:51:08 +00:00
Martin Robinson
b4a768cfc7
layout: Ensure compatible positioning context during flexbox block content sizing calculation (#36123)
Sometimes column Flexbox needs to do an early layout pass to determine
the preferred block content size of flex items. Previously the
absolutely positioned children created during this pass were discarded,
but now they are cached to be possibly used during the final layout
phase of the flex item. Since they are not thrown away, it is necessary
that the `PositioningContext` used to collect them is compatible with
their final `PositioningContext`.

Fixes #36121.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-03-25 09:41:59 +00:00
Jerens Lensun
efd6e86393
fix: radio input element don't trigger validity state (#36103)
Signed-off-by: jerensl <54782057+jerensl@users.noreply.github.com>
2025-03-23 19:16:48 +00:00
Simon Wülker
19d5f5f06f
script: Implement Element::GetHTML and ShadowRoot::GetHTML (#36106)
* Serialize html fragments without going through html5ever

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Implement ShadowRoot::GetHtml / Element::GetHtml

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update WPT expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Propagate CanGc annotations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-03-23 19:04:23 +00:00
Oriol Brufau
8c2ac88ad0
layout: Implement the fit-content() sizing function (#36056)
Spec: https://drafts.csswg.org/css-sizing-3/#funcdef-width-fit-content

It's similar to the `fit-content` keyword but, instead of clamping the
stretch size between `min-content` and `max-content`, it clamps the
provided argument.

So now that we support `fit-content`, it's quite straightforward to add.
It's just not completely clear what should happen when the argument has
a cyclic percentage, so this may need some further adjustments depending
on the outcome of https://github.com/w3c/csswg-drafts/issues/11805

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-03-23 14:26:44 +00:00
Simon Wülker
3a356ffb74
Don't clear children of declarative shadow hosts when imperatively attaching another shadow root (#36104)
* Don't remove a declarative shadow hosts children when attaching an imperative shadow root

Instead we should remove all children of the shadowroot.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update WPT expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-03-23 13:49:45 +00:00
Kenzie Raditya Tirtarahardja
40270cb626
Make input element display-inside always flow-root (#35908)
Signed-off-by: Kenzie Raditya Tirtarahardja <kenzieradityatirtarahardja.18@gmail.com>
Co-authored-by: Kenzie Raditya Tirtarahardja <kenzieradityatirtarahardja.18@gmail.com>
2025-03-23 00:45:59 +00:00
Kenzie Raditya Tirtarahardja
8dda64f14b
Max assign outer block size to cell measures (#36064)
Signed-off-by: Kenzie Raditya Tirtarahardja <kenzieradityatirtarahardja.18@gmail.com>
Co-authored-by: Kenzie Raditya Tirtarahardja <kenzieradityatirtarahardja.18@gmail.com>
2025-03-23 00:35:03 +00:00
elomscansio
80434d4644
Fix form validation for readonly inputs and update WPT expectations (#36090)
The HTML specification states that an input element with the `readonly`
attribute must be barred from constraint validation. Our implementation
previously included an extra check (`does_readonly_apply()`) to verify
if `readonly` applies to the input type, which is unnecessary.

This caused three test failures in:
tests/wpt/meta/html/semantics/forms/constraints/form-validation-willValidate.html.ini

- Removed `does_readonly_apply()` as it is not required for validation.
- Removed `tests/wpt/meta/html/semantics/forms/constraints/form-validation-willValidate.html.ini` since the test now passes.

To update the Web Platform Test expectations, see:
https://book.servo.org/hacking/testing.html#updating-web-platform-test-expectations

Fixes servo/servo#36076

Signed-off-by: Emmanuel Elom <elomemmanuel007@gmail.com>
2025-03-22 19:35:13 +00:00
Martin Robinson
5424479768
metrics: Simplify ProgressiveWebMetrics (#35985)
Simply how `ProgressiveWebMetrics` works:

1. Keep only a single struct instead of one in layout and one script
   that both implement the `ProgressiveWebMetrics` trait. Since layout
   and script are the same thread these can now just be a single
   `ProgressiveWebMetrics` struct stored in script.
2. Have the compositor be responsible for informing the Constellation
   (which informs the ScripThread) about paint metrics. This makes
   communication flow one way and removes one dependency between the
   compositor and script (of two).
3. All units tests are moved into the `metrics` crate itself since there
   is only one struct there now.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-03-21 14:55:00 +00:00
batu_hoang
db74179dc8
Make Element::attach_shadow() and ShadowRoot closer to spec (#36024)
Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-03-19 17:58:16 +00:00
Oriol Brufau
86341da885
layout: Stop ignoring containing block padding for the static position (#36051)
The static position rect is calculated assuming that the containing
block would be established by the content box of some ancestor, but the
actual containing block is established by the padding box.
So we need to add the padding of that ancestor.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-03-19 11:47:52 +00:00
Oriol Brufau
a9afc631ae
layout: Obey sizing keywords in layout_for_block_content_size() (#36015)
We were ignoring sizing keywords on the min and max sizing properties.
With this, flexbox layout has full support for sizing keywords.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-03-19 11:38:30 +00:00
Oriol Brufau
ba6c3916fc
layout: Support min/max main keyword sizes in flexbox (#35961)
Adds support for min-content, max-content, fit-content and stretch on
the min and max main size properties of a flex item.

I'm removing `automatic_min_size()` and `flex_base_size()` because they
would need to share so much code among themselves and their one caller
that it's simpler to just inline the code.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-03-19 09:03:49 +00:00
Oriol Brufau
4acaa08cf5
Cleanup Stylo dependencies (#36046)
Now that Stylo considers `servo` as the default feature, Servo doesn't
need to specify `features = ["servo"]`.

Also use the same crate names as Stylo, rather than renaming them with
`package`.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-03-19 08:53:26 +00:00
Oriol Brufau
3a3c3aeb75
layout: Don't consider a definite stretch size as intrinsic (#36045)
`block_size_is_zero_or_intrinsic()` was always returning true for
`stretch`. This function is used for the margin collapse heuristics
in block layout, so we were considering that an empty element with
`height: stretch` would self-collapse.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-03-19 08:52:35 +00:00
Simon Wülker
6be7612d16
script: Implement Range::getClientRects and Range::getBoundingClientRect (#35993)
* Add doc comments to boundary point

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Allow querying content box of text fragments

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Implement Range::getBoundingClientRect

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update WPT expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-03-19 08:33:11 +00:00
Stephen Muss
07e06f5635
Support align attribute on HTMLParagraphElement interface (#36054)
Signed-off-by: Stephen Muss <stephenmuss@gmail.com>
2025-03-19 07:57:43 +00:00
Oriol Brufau
09fe51f55a
layout: Fix intrinsic contributions of indefinite stretch keyword (#36030)
In #35630 I treated an indefinite `stretch` as 0px on min sizing
properties, and as `none` on max sizing properties. However, this was
only for final layout sizes, I forgot about intrinsic contributions.

Blink already modified the relevant test, I'm just reordering it a bit
since we are no longer treating `stretch` as `fit-content`, so it seems
better to test it at the end.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-03-18 19:19:53 +00:00
Euclid Ye
86957be5f0
Create config_dir if none exist for caching (#35761)
* Create config_dir if none exist for caching

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

* remove specialized behaviour for ohos; copy prefs.json if necessary

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

* downgrade the log to trace verbosity

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

* update wpt-test

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-03-18 18:36:33 +00:00
Gregory Terzian
8d39d7706a
Streams: Implement stream pipe-to (#35650)
* implement PipeTo, stub pipe_to

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* define a data structure to manage the piping

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* implement propagation of errors forward and backward, stub shutdown and shutdown with action

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* adding more fine-grain shutdown variants to state

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* implement progagate closing backward and forward

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* implement shutdown and actions

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* implement reading and writing

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* implement shutdown continuation and finalize

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* fix typo

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* add can_gc arguments

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* implement writer close with error propagation

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* move and document wait on pending write

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* more docs

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* write pending reads as part of shutdown

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* turn on piping test suite

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* add comment about using Rust api
improve comment on result
add comment on backpressure

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* fix multiple propagations

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* fix writing of chunks

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* fix error and close propagation
update test expectations

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* fix warnings

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* improve docs
remove redundant logic in pending writes

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* fix clippy

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* remove unnecessary expansion of visibility of enqueued value to_jsval

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* remove unnecessary conditional accessing of streams when propagating states

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* improve docs

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* remove unused result var

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* fix typo

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* remove redundant logic dealing with closed sources with pending writes

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* add doc links for shutdown actions

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* add comments on the need to return early when shutting down before checking close and error states

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* fmt

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* Update test expectations

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* fix can_gc

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
Co-authored-by: Taym Haddadi <haddadi.taym@gmail.com>
2025-03-18 11:13:09 +00:00
Steven Novaryo
67a5f285ed
dom: Implement minimal IntersectionObserver workflow (#35551)
* Add very rough implemnentation of observation steps

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Fix entry reflection and propagate can_gc

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Fix BorrowError and add fragment find descendant

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Implement is descendant in containing block path correctly

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Fix unrooted error and tidy issues

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Fix comments

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Remove is descendant of other node query

I suppose these changes is better separated to other PRs.

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Fix intersection and refactor registration

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Use AppUnit more and propagate GlobalScope better

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Update WPT expectations

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Revert delay changes

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Align compute intersection algo to other browser actual behavior

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Align processing documents and note several issues

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Update WPT

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Minor lint

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Fix top level browsing context

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Make Registration rootable

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Avoid reflow inside observation step algo

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Using borrow for iterating registration

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Fix document disconnect

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Update WPT

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Address comments and minor quality suggestions

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Root the observer before nofifying any of it

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Tidy docs

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Account not found element and refactor observation step

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Fix documentations

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Ignore position of document viewport

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Refactor root intersection rectangle

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Add can GC note to the callback

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Fix top-level browsing context term

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Fix minor comments

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

---------

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
2025-03-18 11:09:44 +00:00