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 upAdd gecko glue for font-feature-settings property #15975
Comments
|
Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the If you intend to work on this issue, then add |
|
I'd love to sink my teeth into this. It will be my first foray into an open source project so I hope it wouldn't be too troublesome if I asked some questions every now and then. Thanks! |
|
Asking questions is encouraged! |
|
@WholeGrainGoats Have you made any progress? Need help with this? |
|
@wafflespeanut Yes, sorry for the hiatus. I'm trying to find out what I should name the functions that I write. Like if there is a standard you have set up for things like this. |
|
Oh, you'd be writing two functions |
|
@wafflespeanut I've looked over the code but I see that the T enum from here has a value Normal. I looked at the MDN link here and see that the specification calls to insert default values. My question is what would those values be, or perhaps what should be done when that case is encountered? What should I do with fontFeatureSettings in that case? |
|
Good question! Looking at the gecko code, it seems like an empty |
|
@wafflespeanut I've written the two functions you've asked for, converted the value to be a u32 for feature tag, and added the necessary changes to the parsing code to use u32. I'm having some difficulty testing this code, however. I inserted a print statement, changed one of the files to include font-feature-settings in the css, and it appears that the function is not being called. It could just be my confusion but am I supposed to personally test this code? If so, could you offer some assistance with this, or point me to some info on how this should be done? |
|
Nah, you won't be able to test it unless you have a Stylo build (sadly). Feel free to make a PR, and we'll test this in gecko's try server :) |
font-feature-settings gecko glue code <!-- Please describe your changes on the following line: --> FeatureTagValue value property changed to use u32. ToCss for FeatureTagValue changed to allow conversion from u32 to string. Parse for the same struct updated to convert from string to u32. Added two functions to transfer settings to gecko and copy settings. --- <!-- 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 #15975 (github issue number if applicable). <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- 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/16568) <!-- Reviewable:end -->
Servo has had parsing and serialization code for
font-feature-settingsproperty, but we need to add glue to make it usable in Gecko.The existing parsing and serialization code is
servo/components/style/properties/longhand/font.mako.rs
Lines 634 to 742 in d309782
The glue code should be added under
servo/components/style/properties/gecko.mako.rs
Lines 1165 to 1167 in d309782
It seems to me that the existing property code in font.mako.rs also needs some tweak. The feature tag can be represented as a
u32, so we should not useStringfor it. Also in Gecko's style struct,gfxFontFeature::mTagis au32as well.The target struct can be find in components/style/gecko_bindings/struct_debug.rs (GitHub doesn't display this file because it's too large). It should be
nsFont::fontFeatureSettings. It is annsTArray, butgfxFontFeatureseems to be a POD type, so we can usensTArray::set_len_podfor initializing its length.