Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upTrack only the number of important declarations in a declaration block #12959
Comments
|
Please make a comment here if you intend to work on this issue. Thank you! |
|
Run |
|
I'd like to give it a go, but this would be my first foray into servo (and indeed rust). Should the field be removed completely, or should the calculation of it just be moved to the end of the parsing, when it can be calculated by subtracting the important ones from the total? If completely removed, then I guess some consideration is needed to components/script/dom/element.rs and components/style/selector_matching.rs, which both seem to reference the normal_count of a style rule/block. |
|
Sure, it's yours! :) Yes, the idea is removing it completely, and yes, the calculations in element.rs and selector_matching.rs should be modified appropriately. If you have any more doubts, don't hesitate in reaching out :) |
Track only the number of important declarations in a declaration block <!-- Please describe your changes on the following line: --> Track only the number of important declarations in a declaration block --- <!-- 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 #12959 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because "the existing tests should cover it" <!-- 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/12969) <!-- Reviewable:end -->
Once #12943 lands,
DeclarationBlockwill have two fields,normal_countandimportant_countthat track the amount of declarations with a given priority are in that block.We should be able to remove one of the two fields, and compute the other one in terms of the length of the
declarationsvector and the other, simplifying the code that computes it.Code:
components/style/properties/properties.mako.rsTests:
test/units/styleto take the change into account.