script: Fix small things with existing commands#44529
Merged
Merged
Conversation
|
🔨 Triggering try run (#24981561315) for Linux (WPT) |
|
Test results for linux-wpt from try job (#24981561315): Flaky unexpected result (31)
Stable unexpected results that are known to be intermittent (17)
Stable unexpected results (1)
|
|
|
dcabd34 to
9e144d8
Compare
jdm
approved these changes
Apr 28, 2026
Comment on lines
+73
to
+79
| if let Some(ancestor_font) = element.downcast::<HTMLFontElement>() { | ||
| let face = ancestor_font.Face(); | ||
| if !face.is_empty() { | ||
| return Some(face); | ||
| } | ||
| } | ||
| style.clone_font_family().to_css_string() |
Member
There was a problem hiding this comment.
I'm confused by this change. With the following testcase:
<font id=f face="arial"><span id=hi>hello there</span></font>
<script>
console.log(getComputedStyle(hi).fontFamily);
console.log(getComputedStyle(f).fontFamily);
</script>Firefox, Safari, Chrome, and Servo (8ced3d1) all print "arial" twice. Why is this change needed?
Contributor
Author
There was a problem hiding this comment.
I was confused by this as well. Turns out, for detached font elements, it's empty:
const fontElement = document.createElement('font');
fontElement.setAttribute('face', 'arial');
console.log(window.getComputedStyle(fontElement).fontFamily);
Since the contenteditable code creates an element before appending it to DOM, it doesn't have a fontFamily set yet. Will add a code comment to make this clear.
In the initial implementations, not all tests were passing as expected. Turns out these were small things that were missed, or where browsers do different things compared to the spec. Part of servo#25005 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
9e144d8 to
23f3dec
Compare
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.
In the initial implementations, not all tests were passing as expected. Turns out these were small things that were missed, or where browsers do different things compared to the spec.
Part of #25005
Testing: WPT