Add logic for registering custom properties from script#325
Merged
Loirooriol merged 1 commit intoservo:mainfrom Mar 8, 2026
Merged
Add logic for registering custom properties from script#325Loirooriol merged 1 commit intoservo:mainfrom
Loirooriol merged 1 commit intoservo:mainfrom
Conversation
mrobinson
approved these changes
Mar 8, 2026
Member
mrobinson
left a comment
There was a problem hiding this comment.
Looks good, though:
- Let's wait for the upstream version to land.
- Please modernize the Rust a bit via the following suggestions, if they work.
Comment on lines
+2086
to
+2096
| if let Err(error) = | ||
| PropertyRegistration::validate_initial_value(&syntax, initial_value.as_deref()) | ||
| { | ||
| return match error { | ||
| PropertyRegistrationError::InitialValueNotComputationallyIndependent => { | ||
| InitialValueNotComputationallyIndependent | ||
| }, | ||
| PropertyRegistrationError::InvalidInitialValue => InvalidInitialValue, | ||
| PropertyRegistrationError::NoInitialValue => NoInitialValue, | ||
| }; | ||
| } |
Member
There was a problem hiding this comment.
I think you could use map_err here with ?.
Collaborator
Author
There was a problem hiding this comment.
I went with the Gecko version which returns RegisterCustomPropertyResult, so I can't use ?. The Servo version uses Result<(), RegisterPropertyError> but overall it didn't seem worth it.
This way it can be shared among Gecko and Servo. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
49fd91b to
6198d77
Compare
Collaborator
Author
|
The upstream version landed. I will export the review changes during the next sync. |
github-merge-queue Bot
pushed a commit
to servo/servo
that referenced
this pull request
Mar 8, 2026
…om script (#43085) Stylo PR: servo/stylo#325 Testing: Not needed, no behavior change Signed-off-by: Oriol Brufau <obrufau@igalia.com>
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.
This way it can be shared among Gecko and Servo.
Stylo PR: servo/servo#43085
Upstream: https://bugzilla.mozilla.org/show_bug.cgi?id=2021743