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 upIntroduce a PropertyId enum and use it instead of strings of property names #14535
Conversation
highfive
commented
Dec 9, 2016
|
Heads up! This PR modifies the following files:
|
* `LonghandId` and `ShorthandId` are C-like enums * `Atom` is used for the name of custom properties. * `PropertyDeclarationId` is the identifier for `PropertyDeclaration`, after parsing and shorthand expansion. (Longhand or custom property.) * `PropertyId` represents any CSS property, e.g. in CSSOM. (Longhand, shorthand, or custom.) Using these instead of strings avoids some memory allocations and copies.
|
@upsuper I’ve added a first pass at |
|
r=mbrubeck with this
|
|
-S-awaiting-review +S-needs-code-changes Reviewed 5 of 5 files at r1, 10 of 10 files at r2, 7 of 7 files at r3, 8 of 8 files at r4, 6 of 6 files at r5, 2 of 2 files at r6, 1 of 1 files at r7. Comments from Reviewable |
|
Fixed. @bors-servo r=mbrubeck |
|
|
Introduce a PropertyId enum and use it instead of strings of property names <!-- Please describe your changes on the following line: --> * `LonghandId` and `ShorthandId` are C-like enums * `Atom` is used for the name of custom properties. * `PropertyDeclarationId` is the identifier for `PropertyDeclaration`, after parsing and shorthand expansion. (Longhand or custom property.) * `PropertyId` represents any CSS property, e.g. in CSSOM. (Longhand, shorthand, or custom.) CC @upsuper --- <!-- 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 - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] 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/14535) <!-- Reviewable:end -->
|
|
SimonSapin commentedDec 9, 2016
•
edited
LonghandIdandShorthandIdare C-like enumsAtomis used for the name of custom properties.PropertyDeclarationIdis the identifier forPropertyDeclaration,after parsing and shorthand expansion. (Longhand or custom property.)
PropertyIdrepresents any CSS property, e.g. in CSSOM.(Longhand, shorthand, or custom.)
CC @upsuper
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is