Commit graph

32 commits

Author SHA1 Message Date
Servo WPT Sync
43edab336a
Sync WPT with upstream (04-05-2025) (#36829)
Automated downstream sync of changes from upstream as of 04-05-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-05-04 01:43:02 +00:00
Servo WPT Sync
bfa0a61375
Sync WPT with upstream (30-04-2025) (#36785)
Automated downstream sync of changes from upstream as of 30-04-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-04-30 19:46:03 +00:00
Steven Novaryo
bd6928f3dc
layout: Account for transform in scrollable overflow (#36138)
In the scrollable overflow calcutation, apply CSS transforms to boxes
and scrollable overflow of the descendant. Clip unreachable scrollable
overflow according to it's block start and inline start scrolling
direction. And, renamed `Fragment::scrolling_overflow` to
`Fragment::scrolling_overflow_for_parent` as it was calculating the
scrolling overflow contribution from a child.

Add several WPT tests, testing the transform interaction `rotate`,
`scale`, and `skew` with scrollable overflow. There are several WPT test
that are testing the interaction that not expected from current browsers
implementation according to the spec.

Testing: Existing and new WPT. 
Fixes: #36031

---------

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
2025-04-29 09:37:27 +00:00
Servo WPT Sync
e22ce3988b
Sync WPT with upstream (27-04-2025) (#36708)
Automated downstream sync of changes from upstream as of 27-04-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-04-27 02:05:07 +00:00
Servo WPT Sync
c915bf05fc
Sync WPT with upstream (20-04-2025) (#36618)
Automated downstream sync of changes from upstream as of 20-04-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-04-20 01:47:50 +00:00
Oriol Brufau
428e8f7dd8
Enable all experimental web platform features on all testsuites (#36519)
This affects the following testsuites:
 - tests/wpt/tests/
 - tests/wpt/mozilla/tests/
 - tests/wpt/webgl/tests/
 - tests/wpt/webgpu/tests/

Testing: Several tests improve
This is part of #36315

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-14 18:33:38 +00:00
Oriol Brufau
f1417c4e75
layout: Let getComputedStyle resolve auto min size as 0px when needed (#36430)
The initial value of `min-width` and `min-height` was 0px in CSS2.
However, CSS3 changed it to `auto`, so for backwards compatibility,
`getComputedStyle` needs to resolve it to 0px in a bunch of cases.

Testing: covered by WPT

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-14 10:31:48 +00:00
Barigbue Nbira
e1de46c691
Fix: display: inline-grid considered an atomic inline (#36298)
This change ensures that `display: inline-grid` is considered an atomic
inline

- Add `is_atomic_inline_level()` logic to `box_fragment.rs` to improve
accuracy.
- Update `stacking_context.rs` to use the new `is_atomic_inline_level()`
method instead of the one from stylo.
- Update `repeat-auto-fill-005.html` test expectation.
- Remove .ini expectations for tests that are no longer failing.

Testing: covered by WPT
Fixes:  #35310

---------

Signed-off-by: Barigbue <barigbuenbira@gmail.com>
2025-04-03 19:48:19 +00:00
Oriol Brufau
e1213f9dbc
Enable layout_grid_enabled pref for all tests (#36316)
This is part of #36315
Testing: This improves several tests that rely on this feature

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-03 18:48:05 +00:00
Oriol Brufau
9d6e1f67fb
layout: Improve style conversion for Taffy (#36311)
This imports the following changes from Blitz:
- Map position:sticky to relative rather than absolute position
16a7c16544
- Map left and right alignment from Stylo
c71cc681d8
- Improve mapping of align-items/self
7bf2a25e75

Fixes: #35998

Testing:
-
`/css/css-grid/alignment/grid-align-justify-margin-border-padding.html`
- `/css/css-grid/alignment/grid-align.html`
-
`/css/css-grid/alignment/grid-column-axis-alignment-sticky-positioned-items-001.html`
- `/css/css-grid/alignment/grid-gutters-and-alignment.html`
-
`/css/css-grid/alignment/grid-item-alignment-with-orthogonal-flows.html`
-
`/css/css-grid/alignment/grid-row-axis-alignment-sticky-positioned-items-001.html`
- `/css/css-grid/alignment/grid-self-alignment.html`

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-03 15:47:56 +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
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
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
f93006af95
Improve logic for establishing a stacking context (#35947)
In particular:
 - `z-index` will now work on unpositioned grid items.
 - `will-change: z-index` will only establish a stacking context if
   `z-index` applies, i.e. if the box is positioned or a flex/grid item.
 - The conditions in `establishes_stacking_context()` are reordered,
   so that the most likely ones are checked first.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-03-13 06:49:08 +00:00
Servo WPT Sync
66583ce3c9
Update web-platform-tests to revision b'c23b0ad587af296087067b48a2f2101233589a8f' (#35869)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-03-09 01:39:16 +00:00
Servo WPT Sync
5ba9cfe809
Update web-platform-tests to revision b'fc557e215e11221c91de4f283539725ef2f35928' (#35741)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-03-02 12:18:38 +00:00
Servo WPT Sync
6d6070242b
Update web-platform-tests to revision b'de61904887c13679551c32e5e3e70b4dc870c98a' (#35480)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-02-16 01:35:48 +00:00
Oriol Brufau
006ec58598
Let animations&transitions fall back to discrete interpolation (#34981)
Bumps Stylo to https://github.com/servo/stylo/pull/109

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-01-30 20:36:55 +00:00
Martin Robinson
0e616e0c5d
api: Flatten and simplify Servo preferences (#34966)
Flatten and simplify Servo's preferences code. In addition, have both
preferences and options passed in as arguments to `Servo::new()` and
make sure not to use the globally set preferences in `servoshell` (as
much as possible now).

Instead of a complex procedural macro to generate preferences, just
expose a very simple derive macro that adds string based getters and
setters.

- All command-line parsing is moved to servoshell.
- There is no longer the concept of a missing preference.
- Preferences no longer have to be part of the resources bundle because
  they now have reasonable default values.
- servoshell specific preferences are no longer part of the preferences
  exposed by the Servo API.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-14 13:54:06 +00:00
Servo WPT Sync
716fa9387d
Update web-platform-tests to revision b'475127f90be9926867796ff98717b621a358af52' (#34956)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-01-12 01:34:48 +00:00
Nico Burns
bb79408434
Bump taffy to v0.7.5 (#34927)
Signed-off-by: Nico Burns <nico@nicoburns.com>
2025-01-10 14:08:09 +00:00
Steven Novaryo
bbb255d81c
layout: grid-template getComputedStyle cleanup (#34926)
* Update Taffy and WPT expectations

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

* Rename DetailedInfo to SpecificInfo

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

* Run fmt

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

---------

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
2025-01-10 09:04:49 +00:00
Steven Novaryo
76fa456a9a
layout: grid template getComputedStyle resolved value (#34885)
* Store taffy detailed info into fragment

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

* Fix info propagation and resolved grid track query

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

* Fix import

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

* Fix tracklist matching logic and type optimization

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

* Run fmt

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

* Update wpt expectations

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

* Optimizing info propagation and minor qol

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

* Run fmt

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

---------

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
2025-01-09 10:49:27 +00:00
Oriol Brufau
ceec1759f6
layout: Defer some table sizing logic to the parent formatting context (#34889)
A box is usually sized by the formatting context in which it participates.
However, tables have some special sizing behaviors, and these were in
conflict.

Instead of letting tables attempting to re-resolve their inline table,
which failed to e.g. take flex properties into account or resolve sizing
keywords correctly, now tables will trust the inline size determined by
the parent. They will only floor it by the min-content size, and maybe
shrink the final size due to collapsed columns.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-01-09 00:25:58 +00:00
Oriol Brufau
3d816d6d24
Complete implementation of keyword sizes for block layout (#34641)
Adds support for min-content, max-content, fit-content and stretch,
for the case that was missing from #34568: block-level elements that
establish an independent formatting context, when there are floats.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-12-16 18:17:46 +00:00
Oriol Brufau
eb82161a8a
Partial implementation of keyword sizes for block layout (#34568)
Adds support for min-content, max-content, fit-content and stretch,
for block-level elements that don't establish an independent formatting
context, and for block-level elements when there is no float.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-12-16 12:34:57 +00:00
Servo WPT Sync
a37a9f68b8
Update web-platform-tests to revision b'38623a53d6598cb7aab4be8a810102b352a652df' (#34622)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-12-15 03:52:07 +00:00
Servo WPT Sync
b3977e7f6c
Update web-platform-tests to revision b'7b6f075f0ec3c52d92c61fb9f35ce0ec927b17b2' (#34525)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-12-08 10:45:12 +00:00
Servo WPT Sync
c3a58f9c16
Update web-platform-tests to revision b'bf49dde84c5f05613115d6146d109f0ec3900694' (#34483)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-12-05 05:23:07 +00:00
Nico Burns
6cbd89dbb0
Layout: Implement CSS Grid using taffy (#32619)
* Add layout.grid.enabled pref

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Add taffy dependency

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Import taffy <-> stylo conversion code from taffy_stylo crate

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Add `Grid` variant to DisplayInside

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Implement CSS Grid using Taffy

Signed-off-by: Nico Burns <nico@nicoburns.com>

Import full stylo_taffy crate

Signed-off-by: Nico Burns <nico@nicoburns.com>

Squashed PR feedback changes

Deduplicate is_document_only_whitespace

Signed-off-by: Nico Burns <nico@nicoburns.com>

Import taffy::AvailableSpace

Signed-off-by: Nico Burns <nico@nicoburns.com>

Rename FlexContext to TaffyContainerContext

Signed-off-by: Nico Burns <nico@nicoburns.com>

Eliminate references to flexbox in taffy/layout module

Signed-off-by: Nico Burns <nico@nicoburns.com>

Use constructors for geom types

Signed-off-by: Nico Burns <nico@nicoburns.com>

Remove comment about abspos elements splitting contiguous text runs

Signed-off-by: Nico Burns <nico@nicoburns.com>

Remove reference to flexbox in taffy/construct

Signed-off-by: Nico Burns <nico@nicoburns.com>

Deduplicate construction of flexbox/grid containers

Signed-off-by: Nico Burns <nico@nicoburns.com>

Make anonymous text runs InFlow

Signed-off-by: Nico Burns <nico@nicoburns.com>

Remove commented code

Signed-off-by: Nico Burns <nico@nicoburns.com>

Update comments

Signed-off-by: Nico Burns <nico@nicoburns.com>

Inline/vendor the stylo/taffy interop code

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Update test expectations

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix nits from PR review

Signed-off-by: Nico Burns <nico@nicoburns.com>

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
2024-11-21 20:21:01 +00:00
Servo WPT Sync
b22c0771be
Update web-platform-tests to revision b'd2f2efe271ae2fa661c52ed2fe8564e21ad4036f' (#34115)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-11-03 01:33:12 +00:00
Nico Burns
635c10a941
Enable css-grid WPT tests (#34052)
* Enable css-grid WPT tests

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Add assertions for css-grid WPT tests

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Add test assertions

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Allow for timeouts

Signed-off-by: Nico Burns <nico@nicoburns.com>

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
2024-10-30 15:50:37 +00:00