mirror of
https://github.com/servo/servo.git
synced 2025-10-01 17:19:16 +01:00
Auto merge of #18222 - canaltinova:font-feature-values-lookup, r=emilo,xidorn
stylo: Implement font feature values lookup This PR reviewed by emilio and xidorn on bugzilla --- <!-- 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/18222) <!-- Reviewable:end -->
This commit is contained in:
commit
76e77be041
8 changed files with 1182 additions and 718 deletions
|
@ -88,6 +88,7 @@ use style::gecko_bindings::structs::ServoElementSnapshotTable;
|
|||
use style::gecko_bindings::structs::ServoTraversalFlags;
|
||||
use style::gecko_bindings::structs::StyleRuleInclusion;
|
||||
use style::gecko_bindings::structs::URLExtraData;
|
||||
use style::gecko_bindings::structs::gfxFontFeatureValueSet;
|
||||
use style::gecko_bindings::structs::nsCSSValueSharedList;
|
||||
use style::gecko_bindings::structs::nsCompatibility;
|
||||
use style::gecko_bindings::structs::nsIDocument;
|
||||
|
@ -3519,6 +3520,30 @@ pub extern "C" fn Servo_StyleSet_GetCounterStyleRule(raw_data: RawServoStyleSetB
|
|||
}).unwrap_or(ptr::null_mut())
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleSet_BuildFontFeatureValueSet(
|
||||
raw_data: RawServoStyleSetBorrowed,
|
||||
set: *mut gfxFontFeatureValueSet
|
||||
) -> bool {
|
||||
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
||||
|
||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||
let guard = global_style_data.shared_lock.read();
|
||||
|
||||
let font_feature_values_iter = data.extra_style_data
|
||||
.iter_origins_rev()
|
||||
.flat_map(|(d, _)| d.font_feature_values.iter());
|
||||
|
||||
let mut any_rule = false;
|
||||
for src in font_feature_values_iter {
|
||||
any_rule = true;
|
||||
let rule = src.read_with(&guard);
|
||||
rule.set_at_rules(set);
|
||||
}
|
||||
|
||||
any_rule
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleSet_ResolveForDeclarations(
|
||||
raw_data: RawServoStyleSetBorrowed,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue