Repository navigation
Implement the aspect-ratio property for replaced elements - #32800
Conversation
|
🔨 Triggering try run (#9982811571) for Linux WPT |
|
Test results for linux-wpt-layout-2020 from try job (#9982811571): Flaky unexpected result (24)
Stable unexpected results that are known to be intermittent (12)
|
|
✨ Try run (#9982811571) succeeded. |
|
This still needs a bit more work--I need to enable the aspect-ratio WPT tests and fix a bug relating to max-width and border-box |
4c34643 to
30e40c9
Compare
|
🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#47187) with upstreamable changes. |
|
Turns out the "bug" was me forgetting to rebuild. On the plus side, I did create some web platform tests (WPT tests? Has that "ATM machine" ring to it) for testing the behavior of Most of the existing Not sure why the WPT Export step is failing--doesn't seem to be anything related to the contents of the tests themselves. |
This might be related to the commit from #32803 somehow. Hopefully once you rebase it will improve, but I'll watch it. |
Signed-off-by: valadaptive <[email protected]>
30e40c9 to
08b4fda
Compare
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#47187). |
|
Seems to have been caused by force-pushing while the initial WPT sync action was running; I believe it tried to create the PR twice? |
08b4fda to
1fc33b1
Compare
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#47187). |
|
About the regressions: replaced-element-024 and replaced-element-026 regress because we don't implement |
1fc33b1 to
f602976
Compare
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#47187). |
mrobinson
left a comment
There was a problem hiding this comment.
Excellent work. I have a few nits, but I'll apply them myself and try to land this.
| if let PreferredRatio::Ratio(ratio) = preferred_ratio { | ||
| if ratio.is_degenerate() { | ||
| preferred_ratio = PreferredRatio::None; | ||
| } | ||
| } |
There was a problem hiding this comment.
| if let PreferredRatio::Ratio(ratio) = preferred_ratio { | |
| if ratio.is_degenerate() { | |
| preferred_ratio = PreferredRatio::None; | |
| } | |
| } | |
| if matches!(preferred_ratio, PreferredRatio::Ratio(ratio) if ratio.is_degenerate()) { | |
| preferred_ratio = PreferredRatio::None; | |
| } |
|
|
||
| /// Resolve the preferred aspect ratio according to the given natural aspect | ||
| /// ratio and the `aspect-ratio` property. | ||
| /// https://drafts.csswg.org/css-sizing-4/#aspect-ratio |
There was a problem hiding this comment.
Raw URLS in rustdoc comments lead to rustdoc warnings:
| /// https://drafts.csswg.org/css-sizing-4/#aspect-ratio | |
| /// <https://drafts.csswg.org/css-sizing-4/#aspect-ratio> |
| /// border-box, and the aspect-ratio property does not contain "auto", then | ||
| /// the aspect ratio is in respect to the border box. This will then contain | ||
| /// the summed sizes of the padding and border. Otherwise, it's 0. | ||
| pb_adjust: LogicalVec2<Au>, |
There was a problem hiding this comment.
Let's just calling this box_sizing_adjustment.
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 <[email protected]>
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#47187). |
) * Add WPT tests for box-sizing with aspect-ratio Signed-off-by: valadaptive <[email protected]> * 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 <[email protected]> --------- Signed-off-by: valadaptive <[email protected]>
First step towards fully implementing
aspect-ratio. This is probably the easy part since replaced elements are already known to have an intrinsic aspect ratio and treated as such.This PR touches the same code as #32777 and therefore depends on it.
This will require the
aspect-ratioproperty to be enabled for layout 2020 in Stylo--I currently have it pointed to my fork which does so../mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThese changes fix #___ (GitHub issue number if applicable)