Repository navigation
script: Implement margin dimension attributes for <img> - #48605
Merged
Merged
Conversation
mrobinson
approved these changes
Oct 5, 2026
mrobinson
left a comment
Member
There was a problem hiding this comment.
Looks good to me with a few small things to fix before landing.
Comment on lines
+1471
to
+1475
| let margin_right_left = if let Some(this) = self.downcast::<HTMLImageElement>() { | ||
| this.get_margin_right_left() | ||
| } else { | ||
| LengthOrPercentageOrAuto::Auto | ||
| }; |
Member
There was a problem hiding this comment.
I think that if you map this into an Option<LengthPercentage> with a helper you could make this a bit shorter and avoid so much repetition below.
Contributor
Author
There was a problem hiding this comment.
Unfortunately Stylo doesn't export LengthPercentage as an from_length_percentage. Therefore, it wasn't possible for me to get that and I need to use from_dimension instead.
The structure here is the same as for width and height. I will tackle these as a whole in a follow-up to make them all four consistent with each other.
TimvdLippe
force-pushed
the
img-margin-dimensions
branch
from
October 6, 2026 08:28
f3512d6 to
8666d80
Compare
TimvdLippe
force-pushed
the
img-margin-dimensions
branch
from
October 6, 2026 08:36
8666d80 to
169eb5a
Compare
TimvdLippe
enabled auto-merge
October 6, 2026 08:36
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 6, 2026
Part of servo#48604 Testing: new WPT test passes Signed-off-by: Tim van der Lippe <[email protected]>
TimvdLippe
force-pushed
the
img-margin-dimensions
branch
from
October 6, 2026 17:45
169eb5a to
aee6d51
Compare
TimvdLippe
enabled auto-merge
October 6, 2026 17:45
hhhwsqhhh
pushed a commit
to hhhwsqhhh/servo
that referenced
this pull request
Oct 12, 2026
Part of servo#48604 Testing: new WPT test passes Signed-off-by: Tim van der Lippe <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #48604
Testing: new WPT test passes