script: Clean up attribute access a little bit in Element#43064
Merged
Conversation
|
🔨 Triggering try run (#22770059652) for Linux (WPT) |
yezhizhen
approved these changes
Mar 6, 2026
| @@ -2306,11 +2311,10 @@ impl Element { | |||
|
|
|||
| pub(crate) fn get_url_attribute(&self, local_name: &LocalName) -> USVString { | |||
| assert!(*local_name == local_name.to_ascii_lowercase()); | |||
Member
There was a problem hiding this comment.
Suggested change
| assert!(*local_name == local_name.to_ascii_lowercase()); |
This should be removed.
Member
Author
There was a problem hiding this comment.
I remove this and some other instances of similar code.
e492c0d to
2f8fb49
Compare
|
Test results for linux-wpt from try job (#22770059652): Flaky unexpected result (21)
Stable unexpected results that are known to be intermittent (19)
Stable unexpected results (6)
|
|
|
2f8fb49 to
c701ccd
Compare
c701ccd to
7705917
Compare
Member
Author
|
It seems that there are a few places in the DOM that do allow accepting attribute names that are not ASCII lowercase, but these always also accept a namespace. So I've exposed two attribute getters that follow the behavior of two specification concepts and what we expect internally in Servo:
|
- Use modern Rust conveniences such as `unwrap_or_default` - Unabbreviate `attr` - Unify the lowercase ASCII name assertion and make it a debug assertion - Use `unreachable!` instead of panic Signed-off-by: Martin Robinson <[email protected]>
7705917 to
0ee2a96
Compare
|
🔨 Triggering try run (#22778607422) for Linux (WPT) |
|
Test results for linux-wpt from try job (#22778607422): Flaky unexpected result (27)
Stable unexpected results that are known to be intermittent (15)
Stable unexpected results (1)
|
|
|
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.
unwrap_or_defaultattrunreachable!instead of panicTesting: This should not really change behavior so should be covered by existing tests.