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 up`font` shorthand should be serialized to empty when some of its subproperties have non-default value #15036
Comments
|
@zploskey What about this one? It requires modifying the implementation of |
|
@jdm That sounds doable. I'll get started. Thanks! |
|
I've written a test and enabled the commented out test for the font module that was already there, with a couple of changes. I think I've made the changes necessary to resolve this issue, but when I run The tests won't be able to pass until I figure out why this is happening. Once I get that part sorted out I'll make any necessary refinements and send a pull request. |
|
@Manishearth Any idea what's going on? |
|
The Properties defined for specific products are enabled in tests. The conditional ifs are not. |
|
I guess I need to come up with an appropriate way to check if a struct has a field or not. Open to suggestions. I had been using |
|
No, you should use if product == gecko. It just means that your tests won't be able to cover that code perfectly. We have tests in gecko for this (but they're harder to run right now) |
|
In that case, I'm not sure how to test this issue at all, but I'll go ahead and open a work-in-progress pull request and let you have a look. |
|
Sure. I might try to make the shorthand code more testable later. |
Fixes font shorthand serialization so that it serializes to "" when non-default subproperties are defined. These subproperties are those defined in servo#15033. Adds tests: - should_serialize_to_empty_if_there_are_nondefault_subproperties - font_should_serialize_all_available_properties The first test passes by default but has not been tested in a way that enables product = "gecko" or "none". Might be worth trying to configure that to work in the unit tests. The second of test was previously commented and underwent some minor cleanup. Bugfix: servo#15036
Fixes font shorthand serialization so that it serializes to "" when non-default subproperties are defined. These subproperties are those defined in servo#15033. Adds tests: - should_serialize_to_empty_if_there_are_nondefault_subproperties - font_should_serialize_all_available_properties The first test passes by default but has not been tested in a way that enables product = "gecko" or "none". Might be worth trying to configure that to work in the unit tests. The second of test was previously commented and underwent some minor cleanup. Bugfix: servo#15036
Fixes font shorthand serialization so that it serializes to "" when non-default subproperties are defined. Subproperties which cause the font shorthand to serialize to an empty string are: - font-size-adjust - font-kerning - font-variant-caps - font-variant-position - font-language-override Fixes servo#15036.
Fixes font shorthand serialization so that it serializes to "" when non-default subproperties are defined. Subproperties which cause the font shorthand to serialize to an empty string are: - font-size-adjust - font-kerning - font-variant-caps - font-variant-position - font-language-override Fixes servo#15036.
Fixes font shorthand serialization so that it serializes to Ok(()) when non-default subproperties are defined. Subproperties which cause the font shorthand to serialize to an empty string are: - font-size-adjust - font-kerning - font-variant-caps - font-variant-position - font-language-override Fixes servo#15036.
Fixes font shorthand serialization so that it serializes to Ok(()) when non-default subproperties are defined. Subproperties which cause the font shorthand to serialize to an empty string are: - font-size-adjust - font-kerning - font-variant-caps - font-variant-position - font-language-override Fixes servo#15036.
…=SimonSapin serialize font: to empty on non-default subprops Fixes font shorthand serialization so that it serializes to "" when non-default subproperties are defined. These subproperties are those defined in #15033. Adds tests: - should_serialize_to_empty_if_there_are_nondefault_subproperties - font_should_serialize_all_available_properties The first test passes, but has not been tested in a way that enables product = "gecko" or "none". Might be worth trying to configure that to work in the unit tests. The second test was previously commented out and underwent some minor cleanup to make it run. --- <!-- 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 #15036 <!-- Either: --> - [X] There are tests for these changes <!-- 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/15604) <!-- Reviewable:end -->
Fixes font shorthand serialization so that it serializes to "" when non-default subproperties are defined. Subproperties which cause the font shorthand to serialize to "" are: - font-size-adjust - font-kerning - font-variant-caps - font-variant-position - font-language-override Fixes servo#15036. This change also enables the above subproperties during testing.
…=SimonSapin serialize font: to empty on non-default subprops Fixes font shorthand serialization so that it serializes to "" when non-default subproperties are defined. These subproperties are those defined in #15033. Adds tests: - font_should_serialize_to_empty_if_there_are_nondefault_subproperties - font_should_serialize_all_available_properties The second test was previously commented out and underwent some cleanup to make it run. --- <!-- 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 #15036 <!-- Either: --> - [X] There are tests for these changes <!-- 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/15604) <!-- Reviewable:end -->
…=SimonSapin serialize font: to empty on non-default subprops Fixes font shorthand serialization so that it serializes to "" when non-default subproperties are defined. These subproperties are those defined in #15033. Adds tests: - font_should_serialize_to_empty_if_there_are_nondefault_subproperties - font_should_serialize_all_available_properties The second test was previously commented out and underwent some cleanup to make it run. --- <!-- 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 #15036 <!-- Either: --> - [X] There are tests for these changes <!-- 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/15604) <!-- Reviewable:end -->
…=SimonSapin serialize font: to empty on non-default subprops Fixes font shorthand serialization so that it serializes to "" when non-default subproperties are defined. These subproperties are those defined in #15033. Adds tests: - font_should_serialize_to_empty_if_there_are_nondefault_subproperties - font_should_serialize_all_available_properties The second test was previously commented out and underwent some cleanup to make it run. --- <!-- 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 #15036 <!-- Either: --> - [X] There are tests for these changes <!-- 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/15604) <!-- Reviewable:end -->
There are many subproperties of
fontshorthand which cannot present infontshorthand (see #15033). When any of those properties have non-default value,fontshorthand should be serialized to empty string.