Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(431)

Unified Diff: Source/core/css/resolver/FontBuilder.cpp

Issue 1024473004: Do not treat '0' as 'none' for font-size-adjust (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/resolver/FontBuilder.h ('k') | Source/core/layout/style/LayoutStyle.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/FontBuilder.cpp
diff --git a/Source/core/css/resolver/FontBuilder.cpp b/Source/core/css/resolver/FontBuilder.cpp
index 28cebbcf4a2ddf7ff454393fd5d60a4840e8ef1d..e0ad871842175142093dd5f3bc8701cc68985723 100644
--- a/Source/core/css/resolver/FontBuilder.cpp
+++ b/Source/core/css/resolver/FontBuilder.cpp
@@ -329,21 +329,21 @@ void FontBuilder::updateSpecifiedSize(FontDescription& fontDescription, const La
void FontBuilder::updateAdjustedSize(FontDescription& fontDescription, const LayoutStyle& style, FontSelector* fontSelector)
{
- const float sizeAdjust = fontDescription.sizeAdjust();
const float specifiedSize = fontDescription.specifiedSize();
- if (!sizeAdjust || !specifiedSize)
+ if (!fontDescription.hasSizeAdjust() || !specifiedSize)
return;
// We need to create a temporal Font to get xHeight of a primary font.
// The aspect value is based on the xHeight of the font for the computed font size,
- // so we need to reset the adjustment.
- fontDescription.setAdjustedSize(0);
+ // so we need to reset the adjustedSize to computedSize. See FontDescription::effectiveFontSize.
+ fontDescription.setAdjustedSize(fontDescription.computedSize());
Font font(fontDescription);
font.update(fontSelector);
if (!font.fontMetrics().hasXHeight())
return;
+ const float sizeAdjust = fontDescription.sizeAdjust();
float aspectValue = font.fontMetrics().xHeight() / specifiedSize;
float adjustedSize = (sizeAdjust / aspectValue) * specifiedSize;
adjustedSize = getComputedSizeFromSpecifiedSize(fontDescription, style.effectiveZoom(), adjustedSize);
« no previous file with comments | « Source/core/css/resolver/FontBuilder.h ('k') | Source/core/layout/style/LayoutStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698