mirror of
https://github.com/servo/servo.git
synced 2025-08-18 03:45:33 +01:00
Auto merge of #17517 - canaltinova:font-lang-override, r=SimonSapin
stylo: Implement font-language-override descriptor for @font-face rule Generally we use computed values for `@font-face` rule descriptors but that descriptor is a bit different than the others in gecko side. It accepts strings instead of unsigned integer(which is computed value of this property). So we had to use SpecifiedValue for that in here. --- <!-- 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 [Bug 1355364](https://bugzilla.mozilla.org/show_bug.cgi?id=1355364) <!-- 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/17517) <!-- Reviewable:end -->
This commit is contained in:
commit
2843eb5ddf
3 changed files with 27 additions and 2 deletions
|
@ -15,6 +15,7 @@ use gecko_bindings::structs::{self, nsCSSFontFaceRule, nsCSSValue};
|
|||
use gecko_bindings::structs::{nsCSSCounterDesc, nsCSSCounterStyleRule};
|
||||
use gecko_bindings::sugar::ns_css_value::ToNsCssValue;
|
||||
use gecko_bindings::sugar::refptr::{RefPtr, UniqueRefPtr};
|
||||
use properties::longhands::font_language_override;
|
||||
use shared_lock::{ToCssWithGuard, SharedRwLockReadGuard};
|
||||
use std::{fmt, str};
|
||||
use values::generics::FontSettings;
|
||||
|
@ -67,6 +68,17 @@ impl ToNsCssValue for font_feature_settings::T {
|
|||
}
|
||||
}
|
||||
|
||||
impl ToNsCssValue for font_language_override::SpecifiedValue {
|
||||
fn convert(self, nscssvalue: &mut nsCSSValue) {
|
||||
match self {
|
||||
font_language_override::SpecifiedValue::Normal => nscssvalue.set_normal(),
|
||||
font_language_override::SpecifiedValue::Override(ref lang) => nscssvalue.set_string(&*lang),
|
||||
// This path is unreachable because the descriptor is only specified by the user.
|
||||
font_language_override::SpecifiedValue::System(_) => unreachable!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
macro_rules! map_enum {
|
||||
(
|
||||
$(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue