diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp index 369870fb6b3f..93390d7a7035 100644 --- a/gfx/thebes/gfxFont.cpp +++ b/gfx/thebes/gfxFont.cpp @@ -4617,41 +4617,34 @@ gfxFontStyle::gfxFontStyle(FontSlantStyle aStyle, FontWeight aWeight, noFallbackVariantFeatures(true) { MOZ_ASSERT(!std::isnan(size)); + switch (aSizeAdjust.tag) { + case FontSizeAdjust::Tag::None: + sizeAdjust = 0.0f; + break; + case FontSizeAdjust::Tag::ExHeight: + sizeAdjust = aSizeAdjust.AsExHeight(); + break; + case FontSizeAdjust::Tag::CapHeight: + sizeAdjust = aSizeAdjust.AsCapHeight(); + break; + case FontSizeAdjust::Tag::ChWidth: + sizeAdjust = aSizeAdjust.AsChWidth(); + break; + case FontSizeAdjust::Tag::IcWidth: + sizeAdjust = aSizeAdjust.AsIcWidth(); + break; + case FontSizeAdjust::Tag::IcHeight: + sizeAdjust = aSizeAdjust.AsIcHeight(); + break; + } + MOZ_ASSERT(!std::isnan(sizeAdjust)); + sizeAdjustBasis = uint8_t(aSizeAdjust.tag); // sizeAdjustBasis is currently a small bitfield, so let's assert that the // tag value was not truncated. MOZ_ASSERT(FontSizeAdjust::Tag(sizeAdjustBasis) == aSizeAdjust.tag, "gfxFontStyle.sizeAdjustBasis too small?"); - // If we're created with aSizeAdjust holding a FromFont value, we ignore it - // here; this is the style system retrieving font metrics in order to resolve - // FromFont to an actual ratio, which it can do using the unmodified metrics. - -#define HANDLE_TAG(TAG) \ - case FontSizeAdjust::Tag::TAG: \ - if (aSizeAdjust.As##TAG().IsFromFont()) { \ - sizeAdjustBasis = uint8_t(FontSizeAdjust::Tag::None); \ - sizeAdjust = 0.0f; \ - break; \ - } \ - sizeAdjust = aSizeAdjust.As##TAG().AsNumber(); \ - break; - - switch (aSizeAdjust.tag) { - case FontSizeAdjust::Tag::None: - sizeAdjust = 0.0f; - break; - HANDLE_TAG(ExHeight) - HANDLE_TAG(CapHeight) - HANDLE_TAG(ChWidth) - HANDLE_TAG(IcWidth) - HANDLE_TAG(IcHeight) - } - -#undef HANDLE_TAG - - MOZ_ASSERT(!std::isnan(sizeAdjust)); - if (weight > FontWeight::FromInt(1000)) { weight = FontWeight::FromInt(1000); } diff --git a/layout/base/StaticPresData.cpp b/layout/base/StaticPresData.cpp index c4a92d8aa959..6f92545b5103 100644 --- a/layout/base/StaticPresData.cpp +++ b/layout/base/StaticPresData.cpp @@ -187,8 +187,8 @@ void LangGroupFontPrefs::Initialize(nsStaticAtom* aLangGroupAtom) { nsAutoCString cvalue; Preferences::GetCString(pref.get(), cvalue); if (!cvalue.IsEmpty()) { - font->sizeAdjust = StyleFontSizeAdjust::ExHeight( - StyleFontSizeAdjustFactor::Number((float)atof(cvalue.get()))); + font->sizeAdjust = + StyleFontSizeAdjust::ExHeight((float)atof(cvalue.get())); } #ifdef DEBUG_rbs diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 4dadc01fb9e4..5fa97db56fd5 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -9792,30 +9792,29 @@ void nsLayoutUtils::ComputeSystemFont(nsFont* aSystemFont, aSystemFont->size = Length::FromPixels(fontStyle.size); // aSystemFont->langGroup = fontStyle.langGroup; - switch (StyleFontSizeAdjust::Tag(fontStyle.sizeAdjustBasis)) { case StyleFontSizeAdjust::Tag::None: aSystemFont->sizeAdjust = StyleFontSizeAdjust::None(); break; case StyleFontSizeAdjust::Tag::ExHeight: - aSystemFont->sizeAdjust = StyleFontSizeAdjust::ExHeight( - StyleFontSizeAdjustFactor::Number(fontStyle.sizeAdjust)); + aSystemFont->sizeAdjust = + StyleFontSizeAdjust::ExHeight(fontStyle.sizeAdjust); break; case StyleFontSizeAdjust::Tag::CapHeight: - aSystemFont->sizeAdjust = StyleFontSizeAdjust::CapHeight( - StyleFontSizeAdjustFactor::Number(fontStyle.sizeAdjust)); + aSystemFont->sizeAdjust = + StyleFontSizeAdjust::CapHeight(fontStyle.sizeAdjust); break; case StyleFontSizeAdjust::Tag::ChWidth: - aSystemFont->sizeAdjust = StyleFontSizeAdjust::ChWidth( - StyleFontSizeAdjustFactor::Number(fontStyle.sizeAdjust)); + aSystemFont->sizeAdjust = + StyleFontSizeAdjust::ChWidth(fontStyle.sizeAdjust); break; case StyleFontSizeAdjust::Tag::IcWidth: - aSystemFont->sizeAdjust = StyleFontSizeAdjust::IcWidth( - StyleFontSizeAdjustFactor::Number(fontStyle.sizeAdjust)); + aSystemFont->sizeAdjust = + StyleFontSizeAdjust::IcWidth(fontStyle.sizeAdjust); break; case StyleFontSizeAdjust::Tag::IcHeight: - aSystemFont->sizeAdjust = StyleFontSizeAdjust::IcHeight( - StyleFontSizeAdjustFactor::Number(fontStyle.sizeAdjust)); + aSystemFont->sizeAdjust = + StyleFontSizeAdjust::IcHeight(fontStyle.sizeAdjust); break; } diff --git a/layout/style/ServoBindings.toml b/layout/style/ServoBindings.toml index 7119900c69a1..59d55792bcc4 100644 --- a/layout/style/ServoBindings.toml +++ b/layout/style/ServoBindings.toml @@ -545,8 +545,7 @@ cbindgen-types = [ { gecko = "StyleGenericClipRect", servo = "crate::values::generics::GenericClipRect" }, { gecko = "StyleGenericCursorImage", servo = "crate::values::generics::ui::GenericCursorImage" }, { gecko = "StyleFontFamily", servo = "crate::values::computed::font::FontFamily" }, - { gecko = "StyleFontSizeAdjust", servo = "crate::values::computed::font::FontSizeAdjust" }, - { gecko = "StyleFontSizeAdjustFactor", servo = "crate::values::computed::font::FontSizeAdjustFactor" }, + { gecko = "StyleGenericFontSizeAdjust", servo = "crate::values::generics::font::GenericFontSizeAdjust" }, { gecko = "StyleFontFamilyNameSyntax", servo = "crate::values::computed::font::FontFamilyNameSyntax" }, { gecko = "StyleGenericColor", servo = "crate::values::generics::color::Color" }, { gecko = "StyleSystemColor", servo = "crate::values::specified::color::SystemColor" }, diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index 6df530de1cc6..20845dcbc5e6 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -5783,30 +5783,8 @@ var gCSSProperties = { applies_to_placeholder: true, applies_to_cue: true, initial_values: ["none"], - other_values: [ - "0.7", - "0.0", - "0", - "3", - "from-font", - "cap-height 0.8", - "ch-width 0.4", - "ic-width 0.4", - "ic-height 0.9", - "ch-width from-font", - ], - invalid_values: [ - "-0.3", - "-1", - "normal", - "none none", - "cap-height none", - "none from-font", - "from-font none", - "0.5 from-font", - "0.5 cap-height", - "cap-height, 0.8", - ], + other_values: ["0.3", "0.5", "0.7", "0.0", "0", "3"], + invalid_values: ["-0.3", "-1"], }, "font-stretch": { domProp: "fontStretch", diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index bfda60cd6675..492e9fe0ef4c 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -8450,6 +8450,13 @@ mirror: always rust: true +# Is the optional adjustment-basis value for font-size-adjust enabled? +- name: layout.css.font-size-adjust.basis.enabled + type: RelaxedAtomicBool + value: true + mirror: always + rust: true + # Is support for the tech() function in the @font-face src descriptor enabled? - name: layout.css.font-tech.enabled type: RelaxedAtomicBool diff --git a/servo/components/style/properties/cascade.rs b/servo/components/style/properties/cascade.rs index 883cb74d6b09..0b03622c2447 100644 --- a/servo/components/style/properties/cascade.rs +++ b/servo/components/style/properties/cascade.rs @@ -1221,61 +1221,6 @@ impl<'a, 'b: 'a> Cascade<'a, 'b> { font.mScriptUnconstrainedSize = NonNegative(new_unconstrained_size); } - /// If font-size-adjust used the from-font value, we need to resolve it to an actual number - /// using metrics from the font. - fn resolve_font_size_adjust_from_font_if_needed(&mut self) { - use crate::values::computed::font::{FontSizeAdjust, FontSizeAdjustFactor as Factor}; - - if !self.seen.contains(LonghandId::FontSizeAdjust) { - return; - } - - let font_metrics = |vertical| { - let orient = if vertical { - FontMetricsOrientation::MatchContextPreferVertical - } else { - FontMetricsOrientation::Horizontal - }; - let metrics = self.context.query_font_metrics(FontBaseSize::CurrentStyle, orient, false); - let font_size = self.context.style().get_font().clone_font_size().used_size.0; - (metrics, font_size) - }; - - // Macro to resolve a from-font value using the given metric field. If not present, - // returns the fallback value, or if that is negative, resolves using ascent instead - // of the missing field (this is the fallback for cap-height). - macro_rules! resolve { - ($basis:ident, $value:expr, $vertical:expr, $field:ident, $fallback:expr) => { - { - if $value != Factor::FromFont { - return; - } - let (metrics, font_size) = font_metrics($vertical); - let ratio = if let Some(metric) = metrics.$field { - metric / font_size - } else if $fallback >= 0.0 { - $fallback - } else { - metrics.ascent / font_size - }; - FontSizeAdjust::$basis(Factor::new(ratio)) - } - }; - } - - // If sizeAdjust is currently FromFont, we need to resolve it to a number. - let resolved = match self.context.builder.get_font().mFont.sizeAdjust { - FontSizeAdjust::None => return, - FontSizeAdjust::ExHeight(val) => resolve!(ExHeight, val, false, x_height, 0.5), - FontSizeAdjust::CapHeight(val) => resolve!(CapHeight, val, false, cap_height, -1.0 /* fall back to ascent */), - FontSizeAdjust::ChWidth(val) => resolve!(ChWidth, val, false, zero_advance_measure, 0.5), - FontSizeAdjust::IcWidth(val) => resolve!(IcWidth, val, false, ic_width, 1.0), - FontSizeAdjust::IcHeight(val) => resolve!(IcHeight, val, true, ic_width, 1.0), - }; - - self.context.builder.mutate_font().mFont.sizeAdjust = resolved - } - /// Various properties affect how font-size and font-family are computed. /// /// These need to be handled here, since relative lengths and ex / ch units @@ -1288,8 +1233,7 @@ impl<'a, 'b: 'a> Cascade<'a, 'b> { self.prioritize_user_fonts_if_needed(); self.recompute_keyword_font_size_if_needed(); self.recompute_math_font_size_if_needed(); - self.constrain_font_size_if_needed(); - self.resolve_font_size_adjust_from_font_if_needed() + self.constrain_font_size_if_needed() } } } diff --git a/servo/components/style/values/computed/font.rs b/servo/components/style/values/computed/font.rs index ee16b32a2975..725e527c0c00 100644 --- a/servo/components/style/values/computed/font.rs +++ b/servo/components/style/values/computed/font.rs @@ -746,20 +746,8 @@ impl FontFamilyList { } } -/// A factor for one of the font-size-adjust metrics, which may be either a number -/// or the `from-font` keyword. -pub type FontSizeAdjustFactor = generics::GenericNumberOrFromFont; - -impl FontSizeAdjustFactor { - #[inline] - /// Create a ratio from a raw number - pub fn new(val: f32) -> Self { - FontSizeAdjustFactor::Number(NonNegative(val)) - } -} - -/// Preserve the readability of text when font fallback occurs. -pub type FontSizeAdjust = generics::GenericFontSizeAdjust; +/// Preserve the readability of text when font fallback occurs +pub type FontSizeAdjust = generics::GenericFontSizeAdjust; impl FontSizeAdjust { #[inline] diff --git a/servo/components/style/values/computed/mod.rs b/servo/components/style/values/computed/mod.rs index 1543bb81b6e2..489bdafa3129 100644 --- a/servo/components/style/values/computed/mod.rs +++ b/servo/components/style/values/computed/mod.rs @@ -67,7 +67,7 @@ pub use self::effects::{BoxShadow, Filter, SimpleShadow}; pub use self::flex::FlexBasis; pub use self::font::{FontFamily, FontLanguageOverride, FontPalette, FontStyle}; pub use self::font::{FontFeatureSettings, FontVariantLigatures, FontVariantNumeric}; -pub use self::font::{FontSize, FontSizeAdjust, FontSizeAdjustFactor, FontStretch, FontSynthesis}; +pub use self::font::{FontSize, FontSizeAdjust, FontStretch, FontSynthesis}; pub use self::font::{FontVariantAlternates, FontWeight}; pub use self::font::{FontVariantEastAsian, FontVariationSettings}; pub use self::font::{MathDepth, MozScriptMinSize, MozScriptSizeMultiplier, XLang, XTextScale}; diff --git a/servo/components/style/values/generics/font.rs b/servo/components/style/values/generics/font.rs index a320d9bd5ecb..09ed542e97a0 100644 --- a/servo/components/style/values/generics/font.rs +++ b/servo/components/style/values/generics/font.rs @@ -213,36 +213,11 @@ pub enum FontStyle { Oblique(Angle), } -/// A generic value that holds either a generic Number or the keyword -/// `from-font`; used for values of font-size-adjust. -#[repr(u8)] -#[derive( - Animate, - Clone, - ComputeSquaredDistance, - Copy, - Debug, - MallocSizeOf, - Parse, - PartialEq, - SpecifiedValueInfo, - ToAnimatedValue, - ToAnimatedZero, - ToComputedValue, - ToResolvedValue, - ToCss, - ToShmem, -)] -pub enum GenericNumberOrFromFont { - /// An explicitly-specified number. - Number(N), - /// The from-font keyword: resolve the number from font metrics. - FromFont, -} - /// A generic value for the `font-size-adjust` property. /// -/// https://drafts.csswg.org/css-fonts-5/#font-size-adjust-prop +/// https://www.w3.org/TR/css-fonts-4/#font-size-adjust-prop +/// https://github.com/w3c/csswg-drafts/issues/6160 +/// https://github.com/w3c/csswg-drafts/issues/6288 #[allow(missing_docs)] #[repr(u8)] #[derive( @@ -261,22 +236,22 @@ pub enum GenericNumberOrFromFont { ToResolvedValue, ToShmem, )] -pub enum GenericFontSizeAdjust { +pub enum GenericFontSizeAdjust { #[animation(error)] None, // 'ex-height' is the implied basis, so the keyword can be omitted - ExHeight(Factor), + ExHeight(Number), #[value_info(starts_with_keyword)] - CapHeight(Factor), + CapHeight(Number), #[value_info(starts_with_keyword)] - ChWidth(Factor), + ChWidth(Number), #[value_info(starts_with_keyword)] - IcWidth(Factor), + IcWidth(Number), #[value_info(starts_with_keyword)] - IcHeight(Factor), + IcHeight(Number), } -impl ToCss for GenericFontSizeAdjust { +impl ToCss for GenericFontSizeAdjust { fn to_css(&self, dest: &mut CssWriter) -> fmt::Result where W: Write, diff --git a/servo/components/style/values/specified/font.rs b/servo/components/style/values/specified/font.rs index fcf0e12984e2..776a93da32bd 100644 --- a/servo/components/style/values/specified/font.rs +++ b/servo/components/style/values/specified/font.rs @@ -11,8 +11,9 @@ use crate::values::computed::Percentage as ComputedPercentage; use crate::values::computed::{font as computed, Length, NonNegativeLength}; use crate::values::computed::{CSSPixelLength, Context, ToComputedValue}; use crate::values::generics::font::VariationValue; -use crate::values::generics::font::{self as generics, FeatureTagValue, FontSettings, FontTag}; -use crate::values::generics::font::{GenericFontSizeAdjust, GenericNumberOrFromFont}; +use crate::values::generics::font::{ + self as generics, FeatureTagValue, FontSettings, FontTag, GenericFontSizeAdjust, +}; use crate::values::generics::NonNegative; use crate::values::specified::length::{FontBaseSize, PX_PER_PT}; use crate::values::specified::{AllowQuirks, Angle, Integer, LengthPercentage}; @@ -699,15 +700,8 @@ impl Parse for FamilyName { } } -/// A factor for one of the font-size-adjust metrics, which may be either a number -/// or the `from-font` keyword. -pub type FontSizeAdjustFactor = GenericNumberOrFromFont; - -/// Specified value for font-size-adjust, intended to help -/// preserve the readability of text when font fallback occurs. -/// -/// https://drafts.csswg.org/css-fonts-5/#font-size-adjust-prop -pub type FontSizeAdjust = GenericFontSizeAdjust; +/// Preserve the readability of text when font fallback occurs +pub type FontSizeAdjust = GenericFontSizeAdjust; impl Parse for FontSizeAdjust { fn parse<'i, 't>( @@ -715,27 +709,27 @@ impl Parse for FontSizeAdjust { input: &mut Parser<'i, 't>, ) -> Result> { let location = input.current_source_location(); - // First check if we have an adjustment factor without a metrics-basis keyword. - if let Ok(factor) = input.try_parse(|i| FontSizeAdjustFactor::parse(context, i)) { - return Ok(Self::ExHeight(factor)); + if let Ok(ident) = input.try_parse(|i| i.expect_ident_cloned()) { + let basis_enabled = static_prefs::pref!("layout.css.font-size-adjust.basis.enabled"); + let basis = match_ignore_ascii_case! { &ident, + "none" => return Ok(Self::None), + // Check for size adjustment basis keywords if enabled. + "ex-height" if basis_enabled => Self::ExHeight, + "cap-height" if basis_enabled => Self::CapHeight, + "ch-width" if basis_enabled => Self::ChWidth, + "ic-width" if basis_enabled => Self::IcWidth, + "ic-height" if basis_enabled => Self::IcHeight, + // Unknown (or disabled) keyword. + _ => return Err(location.new_custom_error( + SelectorParseErrorKind::UnexpectedIdent(ident) + )), + }; + let value = NonNegativeNumber::parse(context, input)?; + return Ok(basis(value)); } - - let ident = input.expect_ident()?; - let basis = match_ignore_ascii_case! { &ident, - "none" => return Ok(Self::None), - // Check for size adjustment basis keywords. - "ex-height" => Self::ExHeight, - "cap-height" => Self::CapHeight, - "ch-width" => Self::ChWidth, - "ic-width" => Self::IcWidth, - "ic-height" => Self::IcHeight, - // Unknown keyword. - _ => return Err(location.new_custom_error( - SelectorParseErrorKind::UnexpectedIdent(ident.clone()) - )), - }; - - Ok(basis(FontSizeAdjustFactor::parse(context, input)?)) + // Without a basis keyword, the number refers to the 'ex-height' metric. + let value = NonNegativeNumber::parse(context, input)?; + Ok(Self::ExHeight(value)) } } diff --git a/servo/components/style/values/specified/mod.rs b/servo/components/style/values/specified/mod.rs index ef64f5d239f0..e55ef7d3cf5c 100644 --- a/servo/components/style/values/specified/mod.rs +++ b/servo/components/style/values/specified/mod.rs @@ -55,7 +55,7 @@ pub use self::effects::{BoxShadow, Filter, SimpleShadow}; pub use self::flex::FlexBasis; pub use self::font::{FontFamily, FontLanguageOverride, FontPalette, FontStyle}; pub use self::font::{FontFeatureSettings, FontVariantLigatures, FontVariantNumeric}; -pub use self::font::{FontSize, FontSizeAdjust, FontSizeAdjustFactor, FontSizeKeyword, FontStretch, FontSynthesis}; +pub use self::font::{FontSize, FontSizeAdjust, FontSizeKeyword, FontStretch, FontSynthesis}; pub use self::font::{FontVariantAlternates, FontWeight}; pub use self::font::{FontVariantEastAsian, FontVariationSettings}; pub use self::font::{MathDepth, MozScriptMinSize, MozScriptSizeMultiplier, XLang, XTextScale}; diff --git a/testing/web-platform/meta/css/css-fonts/animations/font-size-adjust-interpolation.html.ini b/testing/web-platform/meta/css/css-fonts/animations/font-size-adjust-interpolation.html.ini new file mode 100644 index 000000000000..d969c148f208 --- /dev/null +++ b/testing/web-platform/meta/css/css-fonts/animations/font-size-adjust-interpolation.html.ini @@ -0,0 +1,2 @@ +[font-size-adjust-interpolation.html] + prefs: [layout.css.font-size-adjust.basis.enabled:true] diff --git a/testing/web-platform/meta/css/css-fonts/font-size-adjust-009.html.ini b/testing/web-platform/meta/css/css-fonts/font-size-adjust-009.html.ini new file mode 100644 index 000000000000..14c194fb6b18 --- /dev/null +++ b/testing/web-platform/meta/css/css-fonts/font-size-adjust-009.html.ini @@ -0,0 +1,2 @@ +[font-size-adjust-009.html] + prefs: [layout.css.font-size-adjust.basis.enabled:true] diff --git a/testing/web-platform/meta/css/css-fonts/font-size-adjust-010.html.ini b/testing/web-platform/meta/css/css-fonts/font-size-adjust-010.html.ini index 783e560280a2..3f0cd0a983f4 100644 --- a/testing/web-platform/meta/css/css-fonts/font-size-adjust-010.html.ini +++ b/testing/web-platform/meta/css/css-fonts/font-size-adjust-010.html.ini @@ -1,4 +1,5 @@ [font-size-adjust-010.html] + prefs: [layout.css.font-size-adjust.basis.enabled:true] fuzzy: if os == "linux": maxDifference=0-255;totalPixels=0-1024 if os == "win": maxDifference=0-255;totalPixels=0-256 diff --git a/testing/web-platform/meta/css/css-fonts/font-size-adjust-011.html.ini b/testing/web-platform/meta/css/css-fonts/font-size-adjust-011.html.ini index 8bfaf1627621..4c910afb1279 100644 --- a/testing/web-platform/meta/css/css-fonts/font-size-adjust-011.html.ini +++ b/testing/web-platform/meta/css/css-fonts/font-size-adjust-011.html.ini @@ -1,3 +1,4 @@ [font-size-adjust-011.html] + prefs: [layout.css.font-size-adjust.basis.enabled:true] fuzzy: if os == "win": maxDifference=0-255;totalPixels=0-256 diff --git a/testing/web-platform/meta/css/css-fonts/parsing/font-size-adjust-computed.html.ini b/testing/web-platform/meta/css/css-fonts/parsing/font-size-adjust-computed.html.ini new file mode 100644 index 000000000000..1b724f2a8e07 --- /dev/null +++ b/testing/web-platform/meta/css/css-fonts/parsing/font-size-adjust-computed.html.ini @@ -0,0 +1,21 @@ +[font-size-adjust-computed.html] + prefs: [layout.css.font-size-adjust.basis.enabled:true] + expected: + if (os == "android") and fission: [OK, TIMEOUT] + [Property font-size-adjust value 'from-font'] + expected: FAIL + + [Property font-size-adjust value 'ex-height from-font'] + expected: FAIL + + [Property font-size-adjust value 'cap-height from-font'] + expected: FAIL + + [Property font-size-adjust value 'ch-width from-font'] + expected: FAIL + + [Property font-size-adjust value 'ic-width from-font'] + expected: FAIL + + [Property font-size-adjust value 'ic-height from-font'] + expected: FAIL diff --git a/testing/web-platform/meta/css/css-fonts/parsing/font-size-adjust-invalid.html.ini b/testing/web-platform/meta/css/css-fonts/parsing/font-size-adjust-invalid.html.ini new file mode 100644 index 000000000000..55f46b3066b2 --- /dev/null +++ b/testing/web-platform/meta/css/css-fonts/parsing/font-size-adjust-invalid.html.ini @@ -0,0 +1,3 @@ +[font-size-adjust-invalid.html] + expected: + if (os == "android") and fission: [OK, TIMEOUT] diff --git a/testing/web-platform/meta/css/css-fonts/parsing/font-size-adjust-valid.html.ini b/testing/web-platform/meta/css/css-fonts/parsing/font-size-adjust-valid.html.ini new file mode 100644 index 000000000000..6e7504f4ff2b --- /dev/null +++ b/testing/web-platform/meta/css/css-fonts/parsing/font-size-adjust-valid.html.ini @@ -0,0 +1,21 @@ +[font-size-adjust-valid.html] + prefs: [layout.css.font-size-adjust.basis.enabled:true] + expected: + if (os == "android") and fission: [OK, TIMEOUT] + [e.style['font-size-adjust'\] = "from-font" should set the property value] + expected: FAIL + + [e.style['font-size-adjust'\] = "ex-height from-font" should set the property value] + expected: FAIL + + [e.style['font-size-adjust'\] = "cap-height from-font" should set the property value] + expected: FAIL + + [e.style['font-size-adjust'\] = "ch-width from-font" should set the property value] + expected: FAIL + + [e.style['font-size-adjust'\] = "ic-width from-font" should set the property value] + expected: FAIL + + [e.style['font-size-adjust'\] = "ic-height from-font" should set the property value] + expected: FAIL diff --git a/testing/web-platform/tests/css/css-fonts/font-size-adjust-012-ref.html b/testing/web-platform/tests/css/css-fonts/font-size-adjust-012-ref.html index ac93186a23c7..e60769737dad 100644 --- a/testing/web-platform/tests/css/css-fonts/font-size-adjust-012-ref.html +++ b/testing/web-platform/tests/css/css-fonts/font-size-adjust-012-ref.html @@ -20,9 +20,8 @@ .test { font-family: var(--primary-font), var(--secondary-font); font-size: 100px; - line-height: 1; color: peru; - height: 100px; + height: 200px; } .primary-font { font-family: var(--primary-font); diff --git a/testing/web-platform/tests/css/css-fonts/font-size-adjust-012.html b/testing/web-platform/tests/css/css-fonts/font-size-adjust-012.html index 450a5517fb71..426349542760 100644 --- a/testing/web-platform/tests/css/css-fonts/font-size-adjust-012.html +++ b/testing/web-platform/tests/css/css-fonts/font-size-adjust-012.html @@ -24,9 +24,8 @@ .test { font-family: var(--primary-font), var(--secondary-font); font-size: 100px; - line-height: 1; color: peru; - height: 100px; + height: 200px; } .primary-font { font-family: var(--primary-font); diff --git a/testing/web-platform/tests/css/css-fonts/font-size-adjust-013-ref.html b/testing/web-platform/tests/css/css-fonts/font-size-adjust-013-ref.html index 61b3ae355b73..ad336b943baa 100644 --- a/testing/web-platform/tests/css/css-fonts/font-size-adjust-013-ref.html +++ b/testing/web-platform/tests/css/css-fonts/font-size-adjust-013-ref.html @@ -19,9 +19,7 @@ font-size: 100px; color: peru; height: 200px; - margin-top: -20px; - margin-bottom: -80px; - line-height: 1; + margin-bottom: 24px; } .tall-inline-block { display: inline-block; diff --git a/testing/web-platform/tests/css/css-fonts/font-size-adjust-013.html b/testing/web-platform/tests/css/css-fonts/font-size-adjust-013.html index 9f404ce3559d..04e4e10e3815 100644 --- a/testing/web-platform/tests/css/css-fonts/font-size-adjust-013.html +++ b/testing/web-platform/tests/css/css-fonts/font-size-adjust-013.html @@ -23,9 +23,7 @@ font-size: 100px; color: peru; height: 200px; - margin-top: -20px; - margin-bottom: -80px; - line-height: 1; + margin-bottom: 24px; } .tall-inline-block { display: inline-block; diff --git a/testing/web-platform/tests/css/css-fonts/font-size-adjust-014-ref.html b/testing/web-platform/tests/css/css-fonts/font-size-adjust-014-ref.html deleted file mode 100644 index be552aade1b8..000000000000 --- a/testing/web-platform/tests/css/css-fonts/font-size-adjust-014-ref.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - CSS Reference: font-size-adjust property - - - -
-
- All four instances of "foobar" should be the same size; the font of the outer div - should not affect font-size-adjust:from-font on the inner. -
-
- - foobar - -
-
- - foobar - -
-
- - foobar - -
-
- - foobar - -
-
- diff --git a/testing/web-platform/tests/css/css-fonts/font-size-adjust-014.html b/testing/web-platform/tests/css/css-fonts/font-size-adjust-014.html deleted file mode 100644 index a6e87ff0edbd..000000000000 --- a/testing/web-platform/tests/css/css-fonts/font-size-adjust-014.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - CSS Test: font-size-adjust property - - - - - - -
-
- All four instances of "foobar" should be the same size; the font of the outer div - should not affect font-size-adjust:from-font on the inner. -
-
- - foobar - -
-
- - foobar - -
-
- - foobar - -
-
- - foobar - -
-
- diff --git a/testing/web-platform/tests/css/css-fonts/parsing/ahem-ex-500.otf b/testing/web-platform/tests/css/css-fonts/parsing/ahem-ex-500.otf deleted file mode 100644 index 9966da1929c0..000000000000 Binary files a/testing/web-platform/tests/css/css-fonts/parsing/ahem-ex-500.otf and /dev/null differ diff --git a/testing/web-platform/tests/css/css-fonts/parsing/font-size-adjust-computed.html b/testing/web-platform/tests/css/css-fonts/parsing/font-size-adjust-computed.html index 4910ddd28456..cec5a0d13ed2 100644 --- a/testing/web-platform/tests/css/css-fonts/parsing/font-size-adjust-computed.html +++ b/testing/web-platform/tests/css/css-fonts/parsing/font-size-adjust-computed.html @@ -8,43 +8,25 @@ -
diff --git a/testing/web-platform/tests/lint.ignore b/testing/web-platform/tests/lint.ignore index 1033a191aaa0..255a50e0d1ce 100644 --- a/testing/web-platform/tests/lint.ignore +++ b/testing/web-platform/tests/lint.ignore @@ -614,12 +614,9 @@ AHEM SYSTEM FONT: css/css-fonts/font-size-adjust-012.html AHEM SYSTEM FONT: css/css-fonts/font-size-adjust-012-ref.html AHEM SYSTEM FONT: css/css-fonts/font-size-adjust-013.html AHEM SYSTEM FONT: css/css-fonts/font-size-adjust-013-ref.html -AHEM SYSTEM FONT: css/css-fonts/font-size-adjust-014.html -AHEM SYSTEM FONT: css/css-fonts/font-size-adjust-014-ref.html AHEM SYSTEM FONT: css/css-fonts/font-size-adjust-metrics-override.html AHEM SYSTEM FONT: css/css-fonts/font-size-adjust-metrics-override-ref.html AHEM SYSTEM FONT: css/css-fonts/line-gap-override.html -AHEM SYSTEM FONT: css/css-fonts/parsing/font-size-adjust-computed.html AHEM SYSTEM FONT: html/dom/render-blocking/remove-attr-unblocks-rendering.optional.html AHEM SYSTEM FONT: html/dom/render-blocking/remove-element-unblocks-rendering.optional.html