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

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: Update virtual expectation, minor cleanup. 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..003c2ec05952912fbc2552b4ebe374f9f24e04df 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
@@ -1407,10 +1408,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::max(std::min(maximumAllowedFontSize, autosizedFontSize), 0.f));
skobes 2016/06/27 21:37:03 I think TextAutosizer should avoid setting a multi
pdr. 2016/06/27 22:29:43 Good idea. I added a DCHECK in TextAutosizer::com
setFontDescription(desc);
font().update(currentFontSelector);

Powered by Google App Engine
This is Rietveld 408576698