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

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

Issue 2527483002: 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 52f838534546151afd49ff3a41f589996f509d5a..c3182045b3795df1d94ca11987543054e0ef9624 100644
--- a/third_party/WebKit/Source/core/layout/TextAutosizer.cpp
+++ b/third_party/WebKit/Source/core/layout/TextAutosizer.cpp
@@ -1038,10 +1038,15 @@ void TextAutosizer::applyMultiplier(LayoutObject* layoutObject,
ASSERT(layoutObject);
ComputedStyle& currentStyle = layoutObject->mutableStyleRef();
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;
+ // 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. 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