New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
layout: Add support for box-shadow to Layout 2020 #31453
Conversation
🔨 Triggering try run (#8099794318) for Linux WPT |
Test results for linux-wpt-layout-2020 from try job (#8099794318): Flaky unexpected result (20)
Stable unexpected results that are known to be intermittent (14)
|
✨ Try run (#8099794318) succeeded. |
Why does box-shadow support live in the layout crate(s) (AFAIK shadows don't affect layout)? Is this just a case of there not being a better place to put this code? |
Box shadow is part of CSS (https://drafts.csswg.org/css-backgrounds/#box-shadow), so depends on both computed values and style. In addition, since it's part of CSS it also has a place in the stacking order of CSS content (https://www.w3.org/TR/CSS22/zindex.html). Layout is the component of the web engine that combines style and DOM to produce display lists. There's really no reasonable way to add these shadows apart from during this process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but note this doesn't follow https://drafts.csswg.org/css-backgrounds-3/#shadow-layers
If the affected box has multiple fragments, the shadows are applied as specified in
box-decoration-break
.
The initial value is slice
, but this seems to behave as clone
.
<!DOCTYPE html>
<div style="width: 370px; border: solid cyan; font: 12px / 30px monospace">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris <span style="box-shadow: 0px 0px 0px 5px">libero sem, facilisis nec purus pretium, tempor hendrerit mauris. Sed dignissim commodo ex, sit amet fermentum est interdum at. Nam venenatis lobortis libero</span>, vel iaculis dolor sodales in.
</div>
But this can be addressed in a follow-up.
@Loirooriol Thanks for the review! |
A couple tests fail because they rely on
text-shadow
support which is alsomissing.
./mach build -d
does not report any errors./mach test-tidy
does not report any errors