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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2100013002: Implement the new text-size-adjust CSS property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup convertTextSizeAdjust and add a test that better covers it Created 4 years, 6 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
Index: third_party/WebKit/Source/core/style/ComputedStyle.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index e4dbee9d9494015e774495a2097b10fe579e7b46..166d5ce705f17e22163d50a1858dff4089abccf0 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -587,6 +587,7 @@ bool ComputedStyle::diffNeedsFullLayoutAndPaintInvalidation(const ComputedStyle&
|| rareInheritedData->m_textOrientation != other.rareInheritedData->m_textOrientation
|| rareInheritedData->m_textCombine != other.rareInheritedData->m_textCombine
|| rareInheritedData->m_tabSize != other.rareInheritedData->m_tabSize
+ || rareInheritedData->m_textSizeAdjust != other.rareInheritedData->m_textSizeAdjust
|| rareInheritedData->listStyleImage != other.rareInheritedData->listStyleImage
|| rareInheritedData->m_snapHeightUnit != other.rareInheritedData->m_snapHeightUnit
|| rareInheritedData->m_snapHeightPosition != other.rareInheritedData->m_snapHeightPosition
@@ -1348,9 +1349,10 @@ Length ComputedStyle::lineHeight() const
// recalculated on demand as we only store the specified line height.
// FIXME: Should consider scaling the fixed part of any calc expressions
// too, though this involves messily poking into CalcExpressionLength.
- float multiplier = textAutosizingMultiplier();
- if (multiplier > 1 && lh.isFixed())
+ if (lh.isFixed()) {
+ float multiplier = textAutosizingMultiplier();
return Length(TextAutosizer::computeAutosizedFontSize(lh.value(), multiplier), Fixed);
+ }
return lh;
}
@@ -1407,10 +1409,8 @@ void ComputedStyle::setTextAutosizingMultiplier(float multiplier)
desc.setSpecifiedSize(size);
desc.setComputedSize(size);
- if (multiplier > 1) {
- float autosizedFontSize = TextAutosizer::computeAutosizedFontSize(size, multiplier);
- desc.setComputedSize(std::min(maximumAllowedFontSize, autosizedFontSize));
- }
+ float autosizedFontSize = TextAutosizer::computeAutosizedFontSize(size, multiplier);
+ desc.setComputedSize(std::min(maximumAllowedFontSize, autosizedFontSize));
setFontDescription(desc);
font().update(currentFontSelector);

Powered by Google App Engine
This is Rietveld 408576698