mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
Auto merge of #18241 - canaltinova:font-feature-values-lookup, r=emilio,xidorn
stylo: Implement font feature values lookup This PR reviewed by emilio and xidorn on bugzilla. That is backed out because of Windows build problems. Fixed and landing it again. --- <!-- 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 [Bug 1355721](https://bugzilla.mozilla.org/show_bug.cgi?id=1355721) <!-- 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/18241) <!-- Reviewable:end -->
This commit is contained in:
commit
dc8f26432f
8 changed files with 1183 additions and 718 deletions
|
@ -2513,8 +2513,12 @@ fn static_assert() {
|
|||
|
||||
<% impl_simple_type_with_conversion("font_language_override", "mFont.languageOverride") %>
|
||||
|
||||
pub fn set_font_variant_alternates(&mut self, v: longhands::font_variant_alternates::computed_value::T) {
|
||||
pub fn set_font_variant_alternates(&mut self,
|
||||
v: longhands::font_variant_alternates::computed_value::T,
|
||||
device: &Device) {
|
||||
use gecko_bindings::bindings::{Gecko_ClearAlternateValues, Gecko_AppendAlternateValues};
|
||||
use gecko_bindings::bindings::Gecko_nsFont_ResetFontFeatureValuesLookup;
|
||||
use gecko_bindings::bindings::Gecko_nsFont_SetFontFeatureValuesLookup;
|
||||
% for value in "normal swash stylistic ornaments annotation styleset character_variant historical".split():
|
||||
use gecko_bindings::structs::NS_FONT_VARIANT_ALTERNATES_${value.upper()};
|
||||
% endfor
|
||||
|
@ -2526,6 +2530,8 @@ fn static_assert() {
|
|||
|
||||
if v.0.is_empty() {
|
||||
self.gecko.mFont.variantAlternates = NS_FONT_VARIANT_ALTERNATES_NORMAL as u16;
|
||||
unsafe { Gecko_nsFont_ResetFontFeatureValuesLookup(&mut self.gecko.mFont); }
|
||||
return;
|
||||
}
|
||||
|
||||
for val in v.0.iter() {
|
||||
|
@ -2557,6 +2563,10 @@ fn static_assert() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe {
|
||||
Gecko_nsFont_SetFontFeatureValuesLookup(&mut self.gecko.mFont, device.pres_context());
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
|
|
|
@ -2730,12 +2730,13 @@ impl<'a> StyleBuilder<'a> {
|
|||
&mut self,
|
||||
value: longhands::${property.ident}::computed_value::T
|
||||
) {
|
||||
<% props_need_device = ["content", "list_style_type", "font_variant_alternates"] %>
|
||||
self.${property.style_struct.ident}.mutate()
|
||||
.set_${property.ident}(
|
||||
value,
|
||||
% if property.logical:
|
||||
self.writing_mode,
|
||||
% elif product == "gecko" and property.ident in ["content", "list_style_type"]:
|
||||
% elif product == "gecko" and property.ident in props_need_device:
|
||||
self.device,
|
||||
% endif
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue