Commit 9597601b authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Reland: Use computed font-size for em/rem resolution.

Removed unrelated failing rebaselines in the original CL.

Original description below:

This makes us match how Firefox applies minimum font-size and makes us
not break relative length computation when pages use a font-size less
than the user's minimum font-size as a basis for widths, heights,
margins, padding, etc.

This is a behavioral change for relative lengths for the following
cases:

- minimum-font-size does not affect em lengths
- minimum-logical-font-size does not affect em lengths
- text autosizing does not affect em lengths
- text scaling accessibility setting in Chrome for Android does not
  affect em lengths

Test expectation changes and reasons:

Text scaling no longer applies to relative lengths (text zoom set from testRunner):

svg/zoom/text/zoom-hixie-mixed-008.xml
svg/zoom/text/zoom-hixie-rendering-model-004.xhtml
svg/zoom/text/zoom-svg-float-border-padding.xml

Minimum logical font-size not applying to relative lengths (minimum logical font-size set to
9px when running layout tests):

fast/backgrounds/background-position-parsing.html
virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x.html
http/tests/misc/object-embedding-svg-delayed-size-negotiation-2.htm

TBR=eae@chromium.org

Bug: 308862
Change-Id: I8fb07c118eb2bf828ce5b391f7ed90254c0dbfe1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1813077Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697950}
parent 2fa15b0a
...@@ -47,8 +47,8 @@ CSSToLengthConversionData::FontSizes::FontSizes(float em, ...@@ -47,8 +47,8 @@ CSSToLengthConversionData::FontSizes::FontSizes(float em,
CSSToLengthConversionData::FontSizes::FontSizes(const ComputedStyle* style, CSSToLengthConversionData::FontSizes::FontSizes(const ComputedStyle* style,
const ComputedStyle* root_style) const ComputedStyle* root_style)
: FontSizes(style->ComputedFontSize(), : FontSizes(style->SpecifiedFontSize(),
root_style ? root_style->ComputedFontSize() : 1.0f, root_style ? root_style->SpecifiedFontSize() : 1.0f,
&style->GetFont(), &style->GetFont(),
style->EffectiveZoom()) {} style->EffectiveZoom()) {}
...@@ -175,13 +175,13 @@ double CSSToLengthConversionData::ZoomedComputedPixels( ...@@ -175,13 +175,13 @@ double CSSToLengthConversionData::ZoomedComputedPixels(
// as well as enforcing the implicit "smart minimum." // as well as enforcing the implicit "smart minimum."
case CSSPrimitiveValue::UnitType::kEms: case CSSPrimitiveValue::UnitType::kEms:
case CSSPrimitiveValue::UnitType::kQuirkyEms: case CSSPrimitiveValue::UnitType::kQuirkyEms:
return value * EmFontSize(); return value * EmFontSize() * Zoom();
case CSSPrimitiveValue::UnitType::kExs: case CSSPrimitiveValue::UnitType::kExs:
return value * ExFontSize(); return value * ExFontSize();
case CSSPrimitiveValue::UnitType::kRems: case CSSPrimitiveValue::UnitType::kRems:
return value * RemFontSize(); return value * RemFontSize() * Zoom();
case CSSPrimitiveValue::UnitType::kChs: case CSSPrimitiveValue::UnitType::kChs:
return value * ChFontSize(); return value * ChFontSize();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment