-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Merge normal and important declarations in style rules #12943
Conversation
Heads up! This PR modifies the following files:
|
bc8543d
to
2f500e9
Compare
@bors-servo try |
Merge normal and important declarations in style rules Have a single Vec instead of two. Fix #3426 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #3426. <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12943) <!-- Reviewable:end -->
⛄ The build was interrupted to prioritize another pull request. |
Merge normal and important declarations in style rules Have a single Vec instead of two. Fix #3426 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #3426. <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12943) <!-- Reviewable:end -->
💥 Test timed out |
declarations: declarations.normal, | ||
}) | ||
} | ||
pub declarations: Arc<Vec<(PropertyDeclaration, Importance)>>, |
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.
Important declarations in keyframes are ignored, so the previous implementation was correct. Please make this just a Vec<PropertyDeclaration>
, and point to https://drafts.csswg.org/css-animations/#keyframes:
None of the properties interact with the cascade (so using !important on them is invalid and will cause the
property to be ignored).
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.
style::animation::compute_style_for_animation_step
crates a style::selector_matching::DeclarationBlock
struct from this. That struct contains Arc<Vec<(PropertyDeclaration, Importance)>>
. So having dummy Importance::Normal
values in Keyframe
enables doing this by cloning an Arc
(incrementing a refcount) rather than creating a new Vec
.
I’ve added a doc-comment saying this.
Arguably should have reviewed commit by commit to avoid leaving so much noise, but it's probably late for that. The approach looks good to me. Probably @heycam may want to take a look at this too. I'm still confused by the @bors-servo: retry |
Merge normal and important declarations in style rules Have a single Vec instead of two. Fix #3426 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #3426. <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12943) <!-- Reviewable:end -->
💔 Test failed - linux-rel |
|
I’ve pushed These last three test failures were not intermittent. I could reliably reproduce them locally, and fixing the deduplication vs importance bug that you caught fixed them. @bors-servo try |
@bors-servo: r+ |
📌 Commit 023a3b7 has been approved by |
Merge normal and important declarations in style rules Have a single Vec instead of two. Fix #3426 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #3426. <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12943) <!-- Reviewable:end -->
💔 Test failed - linux-rel |
|
let declarations = Arc::make_mut(&mut declarations.declarations); | ||
for &mut (ref declaration, ref mut importance) in declarations { | ||
if properties.iter().any(|p| declaration.name() == **p) { | ||
*importance = new_importance |
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.
forgot to update the count in this one, that's why that test is failing, sorry for not catching it before.
… instead of the presence (`bool` flags) of each. This allows removing `recalc_any` which iterated over the `Vec`.
023a3b7
to
f9150af
Compare
@bors-servo r=emilio |
📌 Commit f9150af has been approved by |
⌛ Testing commit f9150af with merge f8b2be1... |
Merge normal and important declarations in style rules Have a single Vec instead of two. Fix #3426 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #3426. <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12943) <!-- Reviewable:end -->
☀️ Test successful - arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows-dev |
Have a single Vec instead of two. Fix #3426
./mach build -d
does not report any errors./mach test-tidy
does not report any errorsThis change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)