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

Unified Diff: third_party/WebKit/Source/core/layout/TextAutosizer.cpp

Issue 2514733005: Only apply accessibility font scale factor when autosizing inflates (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | third_party/WebKit/Source/core/layout/TextAutosizerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/TextAutosizer.cpp
diff --git a/third_party/WebKit/Source/core/layout/TextAutosizer.cpp b/third_party/WebKit/Source/core/layout/TextAutosizer.cpp
index ddd7f298880d43e9be1a6c5e07b7d6cd6919436a..9c5dc91b6d2a7ca9002cdbd0f249cf60f458bb17 100644
--- a/third_party/WebKit/Source/core/layout/TextAutosizer.cpp
+++ b/third_party/WebKit/Source/core/layout/TextAutosizer.cpp
@@ -1056,9 +1056,13 @@ void TextAutosizer::applyMultiplier(LayoutObject* layoutObject,
if (!currentStyle.getTextSizeAdjust().isAuto()) {
// The accessibility font scale factor is applied by the autosizer so we
// need to apply that scale factor on top of the text-size-adjust
- // multiplier.
- multiplier = currentStyle.getTextSizeAdjust().multiplier() *
- m_pageInfo.m_accessibilityFontScaleFactor;
+ // multiplier. Only apply the accessibility factor if the autosizer has
+ // determined a multiplier should be applied so that text-size-adjust:none
+ // does not cause a multiplier to be applied when it wouldn't be otherwise.
+ bool shouldApplyAccessibilityFontScaleFactor = multiplier > 1;
+ multiplier = currentStyle.getTextSizeAdjust().multiplier();
+ if (shouldApplyAccessibilityFontScaleFactor)
+ multiplier *= m_pageInfo.m_accessibilityFontScaleFactor;
} else if (multiplier < 1) {
// Unlike text-size-adjust, the text autosizer should only inflate fonts.
multiplier = 1;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/TextAutosizerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698