Commit graph

288 commits

Author SHA1 Message Date
Gregory Terzian
9508b83af6
fix intermittency of child-document-raf-order test (#33480)
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2024-10-14 13:23:14 +00:00
Servo WPT Sync
76776bf082
Update web-platform-tests to revision b'c7076ab2397dd3dcf0bb93dc304d05be04cd2a47' (#33826)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-10-13 13:52:51 +00:00
Oriol Brufau
8c56cbdab2
Implement keyword sizes on atomic inlines (#33737)
Adds support for min-content, max-content, fit-content and stretch,
for atomic inlines.

There are some new test failures because we don't support vertical
writing modes nor `transition-behavior:allow-discrete`.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-10-10 15:25:59 +00:00
Josh Matthews
3eee02869a
Fix test timing for all tests using xr_promise_test (#33715)
* Ensure all xr_promise_test calls wait for DOMContentLoaded when necessary.

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

* Update webxr test expectations.

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

* Update manifest.

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

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-10-09 12:13:11 +00:00
Oriol Brufau
c1b744b2b2
Implement keyword sizes on floats (#33666)
Adds support for min-content, max-content, fit-content and stretch,
for floated elements.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-10-08 13:07:59 +00:00
Servo WPT Sync
f8933a5735
Sync WPT with upstream (06-10-2024) (#33668)
* Update web-platform-tests to revision b'9448ab31f11e671a8b069e3407b4f6279bea698e'

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>

* Remove intermittent failure.

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

---------

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2024-10-06 02:45:43 +00:00
Servo WPT Sync
013473f1d5
Sync WPT with upstream (29-09-2024) (#33580)
* Update web-platform-tests to revision b'16d17064d2122cfa83b22f8bab32c96e6514c034'

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>

* Update big5-decode-csbig5.html.ini

Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-09-29 07:54:33 +00:00
Oriol Brufau
5d269a9036
Simplify the computation of CAPMIN (#33577)
CAPMIN is the largest min-content contribution of the table captions.

In Servo, the standard way to compute min/max-content contributions is
`outer_inline_content_sizes()`, so just use that instead of reinventing
the wheel.

This also fixes cyclic percentages to resolve consistently with normal
block boxes.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-09-28 09:39:22 +00:00
Oriol Brufau
057dd1e9eb
Make ComputedValuesExt expose keywords for the sizing properties (#33558)
This will allow callers to start obeying `min-content`, `max-content`,
`fit-content` and `stretch` in follow-up patches.
The old functionality is kept as deprecated methods that we should
eventually remove.
This patch has very little impact on the existing behavior, just some
very minimal implementation of the keywords for css tables.

This also overhauls fixed-layout-2.html since:
 - It had code that wasn't doing anything
 - It had wrong expecations in prose
 - The logic seemed broken in general
 - All browsers were failing one testcase

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-09-27 17:16:07 +00:00
Servo WPT Sync
8276673bae
Update web-platform-tests to revision b'8e164c249d2b93a4234a2710a5e2cc5a16fab499' (#33515)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-09-22 01:24:38 +00:00
Martin Robinson
ef229b9386
layout: Ensure that <caption>'s support position: relative (#33426)
This change adds support for `position: relative` to table `<caption>`.
In addition to adjusting their position according to inset values, table
captions must also establish containing blocks for descendants that are
absolutely positioned.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-09-19 12:43:29 +00:00
Oriol Brufau
5b6a9110c7
Clear self.pending_whitespace.max_content in forced_line_break() (#33469)
If we encountered a preserved line break after some whitespace, we were
including the space in the max-content size of the following line.

So just like `line_break_opportunity()` was already clearing
`self.pending_whitespace.min_content`, `forced_line_break()` needs to
clear `self.pending_whitespace.max_content` too.

Also some cosmetic refactoring.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-09-16 10:57:56 +00:00
Servo WPT Sync
9f2306f760
Update web-platform-tests to revision b'4c3d068f942231dc905ea283e4f82bd70801c37c' (#33461)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-09-15 01:26:41 +00:00
Oriol Brufau
219a2f2038
Cleanup after #33396 (#33429)
Mostly formatting improvements, but also recovering a pair of parenthesis
that was accidentally removed, changing the logic.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-09-12 19:23:17 +00:00
Oriol Brufau
d9be9d6bd4
Handle all white-space values when intrinsically sizing an IFC (#33343)
There were various cases like `text-wrap-mode: nowrap` and
`white-space-collapse: break-spaces` that weren't handled well.

Fixes #33335

flexbox_flex-formatting-interop.html fails now because we don't support
`table-layout: fixed`.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-09-11 23:50:45 +00:00
Oriol Brufau
9d3d009895
Allow breaking line after space with white-space: break-spaces (#33376)
`white-space: break-spaces` should allow a soft wrap opportunity *after*
every preserved white space. Then, to avoid breaking before the first
white space, `TextRunSegment::shape_text()` has some logic to separate
it from the following spaces and put it with the preceding text instead.

The problem was that, when combined with `word-break: keep-all`, we were
then only checking whether there were more white spaces afterwards,
ignoring the soft wrap opportunity after the first one.

Also removing a duplicated `can_break_anywhere` variable.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-09-10 11:06:40 +00:00
Oriol Brufau
f1ad364ec2
Fix reordering of table-header-group and table-footer-group (#33383)
We weren't moving a table-header-group to the front if it was the first
row group. However, there might still be preceding rows that don't
belong to any row group.

And similarly, we weren't moving a table-footer-group to the end if it
was the last row group. However, there might still be following rows
that don't belong to any row group.

This patch fixes the logic, and enables existing tests from Microsoft
that were missing a reference.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-09-09 23:20:48 +00:00
Cristian Brinza
2993577ac0
script: Added missing spec step in Location::SetHash (#33380)
* Implement missing spec step in Location::SetHash

Signed-off-by: crbrz <cristianb@gmail.com>

* Fixed wrong URL fragment when hash set to empty string

Signed-off-by: crbrz <cristianb@gmail.com>

* Add WPT tests

Signed-off-by: crbrz <cristianb@gmail.com>

---------

Signed-off-by: crbrz <cristianb@gmail.com>
2024-09-09 16:58:26 +00:00
Servo WPT Sync
85823edd01
Update web-platform-tests to revision b'ec9b870fec350e59e9db48ae2858e914a07f38d6' (#33359)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-09-08 01:41:09 +00:00
Martin Robinson
f3f96c3393
layout: Do not use orthogonal baselines in flex layout (#33347)
When a baseline is orthogonal to the main flexbox axis, it should not
take part in baseline alignment. This change does that for column flex.
While there is no support for vertical writing modes, this change is
made to be as writing mode-agnostic as possible.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-09-07 22:08:48 +00:00
Oriol Brufau
37e1c3385e
Treat align-self: normal as stretch on flex items (#33314)
According to https://drafts.csswg.org/css-align/#align-flex
It was being treated as `auto` instead.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-09-05 11:15:41 +00:00
Servo WPT Sync
3453d9fdad
Update web-platform-tests to revision b'5d8ec746ed021738e7ee0cee92ad1a1814ba00fe' (#33274)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-09-01 01:40:45 +00:00
Oriol Brufau
cd8b803368
Use the proper aspect ratio in flexbox (#33256)
When computing the automatic minimum size, flex layout was using the
natural aspect ratio, ignoring the `aspect-ratio` property.

`ReplacedContent::inline_size_over_block_size_intrinsic_ratio()` is now
made private to avoid more accidental uses.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-30 06:28:14 +00:00
Oriol Brufau
93abdf7cb5
layout: Add an indefinite containing block for intrinsic sizing (#33204)
When computing the min-content or max-content size of an element we
need to ignore `inline-size`, `min-inline-size` and `max-inline-size`.

However, we should take the block-axis sizing properties into account.
That's because the contents could have percentages depending on them,
which can then affect their inline size via an aspect ratio.

Therefore, this patch adds `IndefiniteContainingBlock`, which is similar
to `ContainingBlock`, but it allows an indefinite inline-size. This
struct is then passed arround during intrinsic sizing.

More refinement will be needed in follow-up patches in order to fully
address the problem.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-29 14:10:46 +00:00
Oriol Brufau
46dbe4ce32
Obey min and max cross sizes of flex items (#33242)
When laying out the contents of a flex item, we used to resolve their
cross-axis percentages against the preferred cross size of the item.
Now we will take the min and max cross sizes into account.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-29 11:24:23 +00:00
Oriol Brufau
59c74c874a
Obey min-block-size and max-block-size in floats (#33241)
We were using the unclamped `box_size.block` instead of `block_size`.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-08-29 11:24:07 +00:00
Mukilan Thiyagarajan
1aff31fd96
wpt: fix path to wpt-prefs.json (#33243)
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-08-29 04:37:35 +00:00
Oriol Brufau
9639d36550
Remove width and height presentational hints for <canvas> (#33211)
According to HTML, the `width` and `height` attributes should only set
the natural sizes and the aspect ratio.
The `width` and `height` properties should stay as `initial` by default.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-28 10:20:18 +00:00
Mukilan Thiyagarajan
5092cece7a
wpt: fix the path to wpt-prefs.json on WPT runner (#33220)
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-08-28 07:50:16 +00:00
Oriol Brufau
5d43d88b6c
Respect min/max constraints in the block axis of block containers (#33203)
Consider a block container that establishes an inline formatting context
and has a definite `block-size` which is clamped by `min-block-size` or
`max-block-size`.

We were already sizing such container correctly, however, its contents
were resolving their percentages against the unclamped `block-size`
value.

This patch fixes the `ContainingBlock` that we pass to the contents so
that they resolve percentages correctly.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-27 09:05:43 +00:00
Mukilan Thiyagarajan
173b6f183c
wpt: check for wpt-prefs.json in "./servo" sub-directory (#33202)
The current working directory when running on WPT runners is not the
folder with the servo binary, but a parent folder into which the servo
nightly tar is extracted. This means the binary is `$PWD/servo/servo`
and resources directory in in `$PWD/servo/resources`, so the current
hardcoded relative path `resources/wpt-prefs.json` will not work on WPT
runners.

This is causing crashes in WPT runner:

2928440716
https://community-tc.services.mozilla.com/tasks/J7MqNwJGQRSkIWlvB5ktPQ/runs/0/logs/live/public/logs/live.log

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-08-27 08:04:12 +00:00
Servo WPT Sync
6caaa0c955
Update web-platform-tests to revision b'd988aeeb33edc4d452899921799b8bed69fff65d' (#33178)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-08-25 01:37:49 +00:00
Daniel Adams
e85491b5fc
Allow prefs to be overridden from a file and set WPT-specific prefs from file (#33163)
* Allow prefs to be passed in from a separate file

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add wpt-prefs.json for setting WPT-specific prefs

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* fix argument to read_prefs_file

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update test_parse_pref test

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add line in executorservo.py to read from wpt-prefs.json

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update MANIFEST.json

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Disable dom.webxr.test for interfaces test

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-24 06:47:57 +00:00
Martin Robinson
2db9032e72
layout: Add support for flex items with position: relative (#33151)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-23 18:11:22 +00:00
Oriol Brufau
c00cd1326a
Take into account the intrinsic block size when computing the main size of a column flex container (#33135)
In particular, `main_content_sizes()` now works with columns.

`layout_for_block_content_size()` is now used for both intrinsic sizes
and intrinsic contributions, a IntrinsicSizingMode parameter is added
to choose the behavior.

Also, we consider the main size of a flex item as indefinite if its flex
basis is indefinite and the flex container has an indefinite main size.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-20 11:30:27 +00:00
Servo WPT Sync
d59a7f62f8
Update web-platform-tests to revision b'ebe057a1153d34042bac1ff3dc944220876f69ec' (#33116)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-08-19 07:45:30 +00:00
Daniel Adams
e078353bf0
Fix race in WebXR WPT test setup (#33112)
* Ensure xr_promise_test only runs after DOMContentLoaded

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update meta expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update meta-legacy-layout expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update manifest

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-18 21:27:05 +00:00
Martin Robinson
8159f03288
layout: Support start and end values for flexbox align-self (#33032)
These are similar to `flex-start` and `flex-end`, but in `wrap-reverse`
situations, they are the opposite.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-08-15 08:20:41 +00:00
Martin Robinson
7633bdccd2
layout: Initial implementation of flex-direction: column and column-reverse (#33031)
This change removes restrictions on using the column layout mode of
flexbox and adds an initial implementation of sizing for that flex
direction. There's a lot of missing pieces still, but in some cases this
does render column flexbox.

In particular, there are now two code paths for preferred widths
(intrinsic size) calcuation: one in the main axis (row) and one in
the cross axis (column) corresponding to the flex direciton with
horizontal writing modes.

In addition, `FlexItemBox::inline_content_sizes` is removed in favor of
making `sizing::outer_inline` /
`IndependentFormattingContext::outer_inline_content_sizes` generic
enough to handle using a different value for auto minimum sizes, which
flexbox needs.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-08-14 14:25:09 +00:00
Martin Robinson
564ba5969f
layout: Non-auto z-index should always make stacking contexts for flex items (#32961)
Fixes #32756.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-12 12:15:20 +00:00
Servo WPT Sync
1af3ad8a74
Update web-platform-tests to revision b'3b3beee1bf2469013583bafe702f2d4821d76c1f' (#33000)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-08-11 01:31:50 +00:00
newmoneybigbucks
3fca6e015f
script: Properly handle removed iframes in GlobalScope::get_referrer (#32782)
Signed-off-by: newmoneybigbucks <newmoneybigbucks@protonmail.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-07 11:12:19 +00:00
Servo WPT Sync
9cb0e74cdc
Update web-platform-tests to revision b'3634d5a63f2fa3969616396d95537c91c3348fe5' (#32959)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-08-07 10:15:56 +00:00
Martin Robinson
b6f1e3b22d
dependencies: Upgrade cookie and rename Servo's Cookie to ServoCookie (#32861)
This changes updates to the new version of the `cookie` crate in Servo
which no longer uses the old `time@0.1` data types. This requires using
a new version of `time` while we transition off of the old one. This is
the first step in that process.

In addition, the overloading of the `cookie::Cookie` name was causing a
great deal of confusion, so I've renamed the Servo wrapper to
`ServoCookie` like we do with `ServoUrl`.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-07-26 16:13:39 +00:00
valadaptive
60e65c175d
Implement the aspect-ratio property for replaced elements (#32800)
* Add WPT tests for box-sizing with aspect-ratio

Signed-off-by: valadaptive <valadaptive@protonmail.com>

* Implement `aspect-ratio` for replaced elements

There are two regressions because we don't implement `object-fit`, and
one because we don't properly represent non-available <img>s with `alt`
attributes.

Signed-off-by: valadaptive <valadaptive@protonmail.com>

---------

Signed-off-by: valadaptive <valadaptive@protonmail.com>
2024-07-24 11:40:23 +00:00
Servo WPT Sync
2c4b96b872
Update web-platform-tests to revision b'5af3e9c2a2aba76ade00f0dbc3486e50a74a4506' (#32824)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-07-21 07:59:39 +00:00
Servo WPT Sync
968474a9fd
Update web-platform-tests to revision b'f3dd9cba239a9655951ee62ec4dafc8fe37df2c5' (#32774)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-07-14 09:16:30 +00:00
Servo WPT Sync
816359583c
Update web-platform-tests to revision b'4e3b5de2eb8218cf18a1674618994efeb96e2cc0' (#32717)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-07-07 07:23:54 +00:00
Servo WPT Sync
e2e7476404
Sync WPT with upstream (30-06-2024) (#32649)
* Update web-platform-tests to revision b'639fa536940371f833fbbcc10104e20f435f9777'

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>

* Delete tests/wpt/meta/css/css-values/cap-invalidation.html.ini

* Update css-font-face.https.sub.tentative.html.ini

---------

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-06-30 11:14:33 +00:00
Servo WPT Sync
62b230e85d
Update web-platform-tests to revision b'f46bf6aa167e2838a8b93501a1a998ffde90d879' (#32581)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-06-23 06:21:30 +00:00