aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt/meta/css/CSS2
Commit message (Collapse)AuthorAgeFilesLines
* Implement `transition-behavior` (#33991)Oriol Brufau2024-10-245-162/+0
| | | | | Bump Stylo to https://github.com/servo/stylo/pull/84 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Skip anonymous blocks for percentage resolution (#33658)Oriol Brufau2024-10-051-2/+0
| | | | | | | | | Anonymous blocks have `height: auto`, so children with a percentage `height` were considered to have an indefinite height. However, anonymous blocks need to be skipped for percentage resolution, so the percentages may actually be definite. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Ensure that `<caption>`'s support `position: relative` (#33426)Martin Robinson2024-09-191-2/+0
| | | | | | | | | 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>
* Small improvements for table border collapse (#33452)Oriol Brufau2024-09-166-12/+0
| | | | | | | | We were only collapsing the borders from adjacent cells. This patch also handles the borders from rows, row groups, columns, and column groups. Additionally, it takes the border style into account in order to decide which border wins. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Allow table-layout:fixed to shrink cells to less than the border+padding ↵Oriol Brufau2024-09-1312-24/+0
| | | | | | | | | | (#33442) A table cell with `width: auto` in fixed layout will now have an outer min-content width of zero, even if it has borders or padding. In a way, this is like allowing the content-box width to become negative. Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Fix precision issue with line heights (#33438)Oriol Brufau2024-09-1320-40/+0
| | | | | | | | | When computing the ascent and descent in an inline formatting context, we weren't taking into account that app units have precision limitations. Therefore, in some cases we were getting a line height that was slightly taller than the value specified in `line-height`. Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* uses app units in display_list (#33420)atbrakhi2024-09-131-0/+2
| | | | Signed-off-by: atbrakhi <atbrakhi@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Add support for `table-layout: fixed` (#33384)Oriol Brufau2024-09-1211-22/+0
| | | | | | | More details might be needed to fully support the feature, but this covers the basic functionality. Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Add `width` and `height` presentational hints for table-related elements ↵Oriol Brufau2024-09-122-4/+0
| | | | | | | | | | | | | | | (#33405) We were only parsing the `width` attribute as a presentation hint for `<table>`, `<td>` and `<th>`. This patch also handles `<colgroup>` and `<col>`. Also, we weren't parsing `height` at all, now we do it for `<table>`, `<td>`, `<th>`, `<tr>`, `<tbody>`, `<thead>` and `<tfoot>`. One test is now crashing, but this was an existing issue: #33423 Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* layout: Right-to-left support for other layout modes (#33375)Martin Robinson2024-09-1130-56/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change removes the `effective_writing_mode` concept and tries to properly implement right-to-left layout support for all non-inline writing modes. In general, what needs to happen is that rectangles need to be converted to physical rectangles using the containing block. A right-to-left rectangle's inline start is on the right physical side of the containing block. Likewise a positive inline offset in right-to-left text is a negative physical one. The implementation here is pretty good for most layout modes, but floats are still a bit in process. Currently, floats are processed in the logical layout of the block container, but there still might be issues with float interaction with mixed RTL and LTR. While this does move us closer to supporting vertical writing modes, this is still unsupported. New failures: - Vertical writing mode not supported: - `/css/CSS2/floats/floats-placement-vertical-001b.xht` - `/css/CSS2/floats/floats-placement-vertical-001c.xht` - Absolutes inlines should avoid floats (#33323) - `/css/css-position/position-absolute-dynamic-static-position-floats-004.html` - No support for grid - `/css/css-align/self-alignment/self-align-safe-unsafe-grid-003.html` - `/css/css-position/static-position/inline-level-absolute-in-block-level-context-009.html` - `/css/css-position/static-position/inline-level-absolute-in-block-level-context-010.html` - Cannot reproduce these locally on any platform. Very mysterious: - `/css/css-tables/row-group-margin-border-padding.html` - `/css/css-tables/row-margin-border-padding.html` - Exposes bugs we have related to hanging whitespace in preserved whitespace inlines: - `/css/css-text/white-space/trailing-space-and-text-alignment-rtl-003.html` - `/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-023.html` Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
* layout: Lay out absolutes in atomic containing blocks (#33336)Martin Robinson2024-09-061-2/+0
| | | | | | | | | | When inline atomics establish containing blocks for absolute descendants, layout should happen with those atomics as the containing block. This ensures that the absolute descendents have the correct containing block and Fragment parent. This wasn't happening before and this change fixes that. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Respect min/max constraints in the block axis of block containers (#33203)Oriol Brufau2024-08-271-2/+0
| | | | | | | | | | | | | | | 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>
* layout: Add initial support for bidirectional text (BiDi) (#33148)Martin Robinson2024-08-2139-60/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds supports for right-to-left text assigning bidi levels to all line items when necessary. This includes support for the `dir` attribute as well as corresponding CSS properties like `unicode-bidi`. It only implements right-to-left rendering for inline layout at the moment and doesn't include support for `dir=auto`. Because of missing features, this causes quite a few tests to start failing, as references become incorrect due to right-to-left rendering being active in some cases, but not others (before it didn't exist at all). Analysis of most of the new failures: ``` - /css/css-flexbox/gap-001-rtl.html /css/css-flexbox/gap-004-rtl.html - Require implementing BiDi in Flexbox, because the start and end inline margins are opposite the order of items. - /css/CSS2/bidi-text/direction-applies-to-*.xht /css/CSS2/bidi-text/direction-applies-to-002.xht /css/CSS2/bidi-text/direction-applies-to-003.xht /css/CSS2/bidi-text/direction-applies-to-004.xht - Broken due to a bug in tables, not allocating the right amount of width for a column. - /css/css-lists/inline-list.html - This fails because we wrongly insert a soft wrap opportunity between the start of an inline box and its first content. - /css/css-text/bidi/bidi-lines-001.html /css/css-text/bidi/bidi-lines-002.html /css/CSS2/text/bidi-flag-emoji.html - We do not fully support unicode-bidi: plaintext - /css/css-text/text-align/text-align-end-010.html /css/css-text/text-align/text-align-justify-006.html /css/css-text/text-align/text-align-start-010.html /html/dom/elements/global-attributes/* - We do not support dir=auto yet. - /css/css-text/white-space/tab-bidi-001.html - Servo doesn't support tab stops - /css/CSS2/positioning/abspos-block-level-001.html /css/css-text/word-break/word-break-normal-ar-000.html - Do not yet support RTL layout in block - /css/css-text/white-space/pre-wrap-018.html - Even in RTL contexts, spaces at the end of the line must hang and not be reordered - /css/css-text/white-space/trailing-space-and-text-alignment-rtl-002.html - We are letting spaces hang with white-space: pre, but they shouldn't hang. ``` Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
* Fix sizing of replaced elements with min/max sizes (#32777)valadaptive2024-07-184-8/+0
| | | | | | | | If a (min/max)-(height/width) property is set, we still need to respect the intrinsic ratio of the element if it exists. The previous code was simply clamping the element size after doing the sizing calculations once, but this leads to an incorrect aspect ratio. Signed-off-by: valadaptive <valadaptive@protonmail.com>
* use au in inline (#32728)atbrakhi2024-07-098-16/+0
| | | Signed-off-by: atbrakhi <atbrakhi@igalia.com>
* layout: Improve layout of table captions (#32695)Martin Robinson2024-07-0830-60/+0
| | | | | | | | | | | | | | | | - Instead of treating captions as a `BlockFormattingContext`, treat it as a `NonReplacedFormattingContext`, which allows reusing flow layout for captions -- fixing some issues with sizing. - Pass in the proper size of the containing block when laying out, fixing margin calculation. - Follow the unspecified rules about how various size properties on captions affect their size. - Improve linebreaking around atomics, which is tested by caption-related tests. This fixes intrinsic size calculation regarding soft wrap opportunities around atomic and also makes the code making these actual soft wrap opportunities a bit better. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Update web-platform-tests to revision ↵Servo WPT Sync2024-07-071-2/+0
| | | | | b'4e3b5de2eb8218cf18a1674618994efeb96e2cc0' (#32717) Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
* layout: Add support for table captions (#32657)Martin Robinson2024-07-0340-80/+0
| | | | | | | | | | | | | This adds initial support for table captions. To do this, the idea of the table wrapper becomes a bit more concrete. Even so, the wrapper is still reponsible for allocating space for the grid's border and padding, as those properties are specified on the wrapper and not grid in CSS. In order to account for this weirdness of HTML/CSS captions and grid are now laid out and placed with a negative offset in the table wrapper content rect. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* script: Implement the `FontFaceSet` DOM API (#32576)Mukilan Thiyagarajan2024-06-262-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a skeleton implementation of FontFaceSet interface with support for resolving the `document.fonts.ready` Promise when the loading of web fonts is completed. This change exposes new failures in the web platform tests. These were ERROR before the change because `document.fonts.ready` caused a `ReferenceError` causing the tests to be aborted and they now FAIL: - /css/CSS2/linebox/vertical-align-top-bottom-001.html - /css/css-flexbox/flex-one-sets-flex-basis-to-zero-px.html - /css/css-fonts/generic-family-keywords-001.html - /css/css-fonts/math-script-level-and-math-style/math-script-level-004.tentative.html - /css/css-fonts/math-script-level-and-math-style/math-script-level-002.tentative.html - /css/css-text/text-autospace/text-autospace-ligature-001.html - /css/css-values/calc-size/calc-size-width.tentative.html These were TIMEOUT before the change because `document.fonts.ready` was a ReferenceError and the tests were asynchronous (reftest-wait). These now FAIL because the assertions are now executed after fonts are loaded: - /css/css-fonts/matching/fixed-stretch-style-over-weight.html - /css/css-fonts/matching/range-descriptor-reversed.html - /css/css-fonts/matching/stretch-distance-over-weight-distance.html - /css/css-fonts/matching/style-ranges-over-weight-direction.html - /css/css-fonts/variations/variable-box-font.html - /css/css-fonts/variations/variable-gpos-m2b.html - /css/css-fonts/variations/variable-gsub.html - /css/css-fonts/variations/variable-opsz-size-adjust.html - /css/css-position/sticky/position-sticky-change-top.html - /css/css-position/sticky/position-sticky-fixed-ancestor.html - /css/css-position/sticky/position-sticky-flexbox.html - /css/css-position/sticky/position-sticky-grid.html - /css/css-position/sticky/position-sticky-inline.html - /css/css-position/sticky/position-sticky-rendering.html - /css/css-position/sticky/position-sticky-stacking-context.html - /css/css-position/sticky/position-sticky-table-td-left.html - /css/css-position/sticky/position-sticky-table-td-right.html - /css/css-position/sticky/position-sticky-table-tfoot-bottom.html - /css/css-position/sticky/position-sticky-table-th-right.html - /css/css-position/sticky/position-sticky-table-thead-top.html - /css/css-position/sticky/position-sticky-table-tr-bottom.html - /css/css-position/sticky/position-sticky-table-tr-top.html - /css/css-position/sticky/position-sticky-writing-modes.html - /css/css-pseudo/marker-intrinsic-contribution-001.html - /css/css-text/hyphens/hyphens-character.html These tests now PASS due to this patch: * FAIL -> PASS - /html/canvas/element/text/2d.text.draw.fill.maxWidth.fontface.html - /html/canvas/element/text/2d.text.measure.width.empty.html * TIMEOUT -> PASS - /css/css-fonts/variations/font-descriptor-range-reversed.html - /css/css-fonts/variations/variable-opsz.html - /css/css-position/sticky/position-sticky-table-th-left.html * ERROR -> PASS - /css/css-fonts/generic-family-keywords-002.html - /css/css-fonts/generic-family-keywords-003.html * These two tests only PASS in Layout 2020: - /css/CSS2/positioning/inline-static-position-001.html - /css/cssom-view/getBoundingClientRect-empty-inline.html These two tests have subtests that PASS intermittenttly: - /fetch/metadata/generated/css-font-face.sub.tentative.html - /css/css-fonts/generic-family-keywords-001.html These tests are new TIMEOUTS that used to FAIL because `documents.fonts.ready` was undefined: - /resource-timing/TAO-match.html - /resource-timing/content-type.html - /resource-timing/nextHopProtocol-is-tao-protected.https.html The failure in `/resize-observer/change-layout-in-error.html` could be due to an issue in the ResizeObserver implementation that is now exposed with this change, but this needs more investigation. Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* use app unit in box_fragement (#32349)atbrakhi2024-06-211-2/+0
|
* Fix and unify 'span' attribute for table columns (#32467)Oriol Brufau2024-06-1018-36/+0
| | | | | | | | The attribute was only taken into account on columns that are immediate children of tables, and on column groups. It was ignored on columns within column groups. This patch moves the logic into a helper function that is then called from the three consumers.
* Don't shrink table columns when handling cells with greater spanning (#32458)Oriol Brufau2024-06-075-10/+0
| | | | | | | | | | | | | For example: ```html <table border="1"> <tr> <td></td> <td></td> </tr> <tr> <td colspan="2"></td> </tr> </table> ``` We should initially size the columns according to the cells in the first row since they have a span of 1. Then we handle the cell in the second row with a span of 2, this should be able to increase the size of the columns, but never decrease them.
* build(deps): bump xml5ever from 0.18.0 to 0.18.1 (#32446)dependabot[bot]2024-06-062-4/+0
| | | | | | | | | | | | | | Bumps [xml5ever](https://github.com/servo/html5ever) from 0.18.0 to 0.18.1. - [Commits](https://github.com/servo/html5ever/compare/xml5ever-v0.18.0...xml5ever-x0.18.1) --- updated-dependencies: - dependency-name: xml5ever dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* layout: Don't default to fallback fonts for spaces (#32442)Martin Robinson2024-06-051-2/+0
| | | | | | | | | | | | Previously, when deciding the font for a space, preference was given to the previous used font. This could means that the font chosen was a fallback font instead of the first font that supporting the space character in the font preference list. This caused an issue rendering emojis surrounded by spaces with "Noto Color Emoji" which has a space character the same size as the emoji, leading to too much spacing between them. Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
* Implement 'visibility: collapse' on table parts (#32333)Oriol Brufau2024-05-212-4/+0
| | | | | https://drafts.csswg.org/css2/#dynamic-effects Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Implement 'empty-cells' for layout 2020 (#32331)Oriol Brufau2024-05-212-89/+0
| | | | | https://drafts.csswg.org/css-tables/#empty-cell-rendering Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* tables: Add a naive implementation of `border-collapse` (#32309)Martin Robinson2024-05-1810-105/+0
| | | | | | | | | This change adds a very simple implementation of `border-collapse` for tables. No harmonization or merging is done at all for borders. Instead, the largest border for every continuous border sets the size. Instead of merging different border styles, they are squashed to half size -- which isn't great, but ensures appropriate positioning. Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* layout: When line-height is not `Normal` use metrics of first font not ↵Martin Robinson2024-05-131-2/+0
| | | | | fallback (#32165) This fixes an issue revealed by more consistent font fallback.
* feat: Support font-relative `ch` and `ic` units (#32171)Andreu Botella2024-05-022-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat: Support font-relative `ch` and `ic` units After #31966, which made it possible for the first time to resolve font-relative CSS units, this change adds support for the `ch` and `ic` units. One difference with the `ex` unit that was added in that PR is that these units must reflect the advance width of a character (the zero digit in the case of `ch`, and the CJK water radical for `ic`) as it would be rendered by the current font group. This means that the size of these units don't only depend on the first available font, in the case where that font does not contain a glyph for that character. This is implemented by adding the advance width for these two characters as optional fields of `FontMetrics`, so the advance width computation happens in advance. Then, when the font metrics are queried as part of unit resolution, the font group is searched for the first font containing that character. This change only implements support for these units in upright typesetting modes, since Servo does not yet have support for vertical writing modes. This means that many of the WPT tests that test for the behavior of these units with vertical writing modes do not pass. This change also makes a number of WPT tests pass, which relied on the `ch` and `ic` units. It, however, also makes the test `/css/css-text/white-space/text-wrap-balance-overflow-002.html` fail, since it tests `text-wrap: balance`, which Servo does not yet implement, and it was only previously passing by chance due to the previous behavior of these units. * Revert Python 3.10-related changes to wss * Fix formatting * Remove test expectation
* fonts: Add support for more @font-face features (#32164)Martin Robinson2024-04-292-2/+2
| | | | | | | | | | | | | | | | | | | | | | | There are a couple major changes here: 1. Support is added for the `weight`, `style`, `stretch` and `unicode-range` declarations in `@font-face`. 2. Font matching in the font cache can return templates and `FontGroupFamily` can own mulitple templates. This is due to needing support for "composite fonts". These are `@font-face` declarations that only differ in their `unicode-range` definition. This fixes a lot of non-determinism in font selection especially when dealing with pages that define "composite faces." A notable example of such a page is servo.org, which now consistently displays the correct web font. One test starts to fail due to an uncovered bug, but this will be fixed in a followup change. Fixes #20686. Fixes #20684. Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* layout: Ensure empty list items are at least as tall as outside markers (#32152)Martin Robinson2024-04-296-10/+2
| | | | | | | | | | | | | | | | While <https://drafts.csswg.org/css-lists/#list-style-position-property> says: > The size or contents of the marker box may affect the height of the > principal block box and/or the height of its first line box, and in some > cases may cause the creation of a new line box; this interaction is also > not defined. All other browsers ensure that the first line of list item content is the same block size as the marker. Doing this is complicated, but we can ensure that the entire list item is at least as tall as the marker. This should handle the majority of cases and we can make refinements later for stranger situations, such as when the marker is very tall. Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Implement special table sizing for floats (#32150)Oriol Brufau2024-04-261-2/+0
| | | | | | | Tables should always be at least as big as their min-content size, even if we would expect a smaller size according to CSS sizing properties. #31455 implemented it for in-flow tables participting in flow layout, but a few cases remained. This patch addresses floated tables.
* layout: Add a basic support for `list-style-position: outside` (#32114)Martin Robinson2024-04-224-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds very basic support for `list-style-position`. Currently, the marker does not do any kind of baseline alignment with the rest of the list item contents and it also doesn't force the list item to be at least as tall as the marker. This adds a few new failures: - Four failures because markers do not ensure that list-items have at least the same block size as they do: - FAIL [expected PASS] /css/CSS2/lists/list-style-applies-to-012.xht - FAIL [expected PASS] /css/CSS2/lists/list-style-applies-to-014.xht - FAIL [expected PASS] /css/CSS2/lists/list-style-type-applies-to-012.xht - FAIL [expected PASS] /css/CSS2/lists/list-style-type-applies-to-014.xht - One failure because we don't yet support the `::marker` pseudo-selector: - FAIL [expected PASS] /css/css-position/position-absolute-dynamic-list-marker.html - One failure because we don't support the list item exception for the line height quirk: - FAIL [expected PASS] /quirks/line-height-in-list-item.tentative.html Co-authored-by: Oriol Brufau <obrufau@igalia.com> <!-- Please describe your changes on the following line: --> Fixes #27383. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #27383. - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* layout: Add support for `clear` on `<br>` elements (#32094)Martin Robinson2024-04-174-8/+0
| | | | | | | | `<br>` elements are a bit "special" in the sense that they defer a linebreak, but can also have `clear` applied to them. The `clear` that they supply should be applie *after* the linebreak is processed. This change adds special processing for this situation. Fixes #15402.
* layout: Add support for `background-attachment: fixed` (#32068)Martin Robinson2024-04-155-10/+0
| | | Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Keep 1st collapsible space after a preserved one (#32037)Oriol Brufau2024-04-151-2/+0
| | | | | | | | The logic was to remove any collapsible white space preceded by other white space. However, this should only happen if the preceding space is also collapsible. Also fixing the logic in ContentSizesComputation, which was wrong but previously it didn't matter.
* Treat indefinite percentages as auto for margin collapse (#32059)Oriol Brufau2024-04-121-2/+0
| | | | | | | The top and bottom margins of an element can collapse through if its height is auto or zero. Indefinite percentages behave as auto, so they shouldn't prevent the margins from collapsing. Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Obey min-height and max-height on floated elements (#32057)Oriol Brufau2024-04-121-2/+0
| | | Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* layout: Add a `FontMetricsProvider` for resolving font-relative units (#31966)Martin Robinson2024-04-0479-158/+0
| | | | | | | | | | | | | | | | | | | The only font relative unit that Servo knows how to resolve currently is `rem` (relative to the root font size). This is because Stylo cannot do any font queries. This adds a mechanism to allow this, exposing the ability to properly render `ex` units in Servo. This change only allows resolving some font size relative units thoug, as Servo doesn't collect all the FontMetrics it needs to resolve them all. This capability will be added in followup changes. Some new tests fail: - ex-unit-001.html: This test fails because Servo does not yet have support for setting the weight using @font-face rules on web fonts. - ex-unit-004.html: This test fails because Servo does not yet have support for setting the Unicode range of a web font using @font-face rules. - first-available-font-001.html: This test fails because the above two feature are missing.
* Don't update row baseline if cell is empty (#31831)Oriol Brufau2024-03-253-6/+0
| | | | | | | | Gecko, Blink and WebKit agree that the if a row only has empty cells, its baseline should be at the bottom, not at the top. There isn't interoperability when the cells are just empty-ish, so this patch takes the simplest approach, aligning with Blink: any out-of-flow or in-flow content other than collapsed whitespace counts as not empty.
* Fix WPT reference no_red_3x3_monospace_table-ref.xht (#31802)Richard Dushime2024-03-2184-168/+0
| | | | | * Fix WPT reference no_red_3x3_monospace_table-ref.xht * wpt Update manifest.json
* Don't trim leading whitespace of anonymous table cells (#31803)Oriol Brufau2024-03-217-14/+0
| | | | | | A sequence of whitespace shouldn't generate an anonymous table row/cell, but we can't just throw away the leading whitespace, because afterwards we may encounter some other content, and then the leading whitespace should appear in the cell (noticeable with e.g. `white-space: pre`).
* Update Stylo to 2023-09-01 (#31609)Oriol Brufau2024-03-181-2/+0
| | | | | | | | | | | | | | | | | | | | | * Update Stylo to 2023-09-01 * Fixup for https://phabricator.services.mozilla.com/D184929 * Fixup for https://phabricator.services.mozilla.com/D184526 * Fixup for https://phabricator.services.mozilla.com/D184525 * Fixup for https://phabricator.services.mozilla.com/D185154 * Fixup for https://phabricator.services.mozilla.com/D184685 * Fixup for https://phabricator.services.mozilla.com/D185916 * Fixup for https://phabricator.services.mozilla.com/D185492 * Fixup for https://phabricator.services.mozilla.com/D186626 * Update test expectations
* Sync WPT with upstream (17-03-2024) (#31715)Servo WPT Sync2024-03-171-2/+0
| | | | | | | | | | | * Update raw lags path for WPT import I forgot to do this in #31616 * Update web-platform-tests to revision b'298d1599dbf6255aea63506daaa1702ff0c4fdc5' --------- Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
* Don't null out the baselines of anonymous tables (#31704)Oriol Brufau2024-03-1529-58/+0
|
* Obey white-space when intrinsically sizing an IFC (#31660)Oriol Brufau2024-03-158-16/+0
| | | | | | | | | | | | | | | | | The old logic was assuming that all whitespace was a break opportunity, and that no newlines would be preserved. Note that text shaping considers the advance of a newline to be the same as a space. This was problematic because if we have a segment with a preserved space and newline, only the advance of the space should contrinute to the size of the block container. Therefore, I'm changing the breaker logic in other to have newline characters in their own segment. Then glyph_run_is_whitespace_ending_with_preserved_newline can just be renamed to glyph_run_is_preserved_newline. This patch is still not perfect because it doesn't check allow_wrap(), so `nowrap` is treated like `normal`, and `pre-wrap` like `pre`.
* Implement HTMLStyleElement.disabled attribute (#31682)Oriol Brufau2024-03-142-4/+0
| | | https://html.spec.whatwg.org/multipage/#dom-style-disabled
* layout: Properly parent table-row and table-row-group (#31619)Martin Robinson2024-03-141-0/+2
| | | | | | | | Put table cell content fragments into a hieararchy of fragments that include their table row and table row group fragments. This ensures that things like relative positioning and transforms set on rows and row groups properly affect cells and cell content. Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Fix vertical alignment at the root of an IFC (#31636)Oriol Brufau2024-03-131-2/+0
| | | | | | | | | | | | | | At the root of an inline formatting context, we used its vertical-align in order to compute the strut. That was wrong, since vertical-align on a block container shouldn't affect the contents, it should only affect the alignment of the block container (if it's inline-level) within the parent IFC. This was only working well if the block container was block-level, since effective_vertical_align_for_inline_layout returned `baseline` for block-level boxes. Instead of the outer display type, this patch changes the logic to check whether we are at the root of the IFC.
* layout: Propagate overflow values from `<body>` to root element (#31618)Martin Robinson2024-03-133-6/+0
| | | | | | | The specification gives instructions for how these values should be propagated. The other big changs here is that they aren't applied to the `<body>`. Co-authored-by: Oriol Brufau <obrufau@igalia.com>