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

Side by Side 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, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 || rareInheritedData->hyphenationString != other.rareInheritedData-> hyphenationString 580 || rareInheritedData->hyphenationString != other.rareInheritedData-> hyphenationString
581 || rareInheritedData->m_respectImageOrientation != other.rareInherit edData->m_respectImageOrientation 581 || rareInheritedData->m_respectImageOrientation != other.rareInherit edData->m_respectImageOrientation
582 || rareInheritedData->m_rubyPosition != other.rareInheritedData->m_r ubyPosition 582 || rareInheritedData->m_rubyPosition != other.rareInheritedData->m_r ubyPosition
583 || rareInheritedData->textEmphasisMark != other.rareInheritedData->t extEmphasisMark 583 || rareInheritedData->textEmphasisMark != other.rareInheritedData->t extEmphasisMark
584 || rareInheritedData->textEmphasisPosition != other.rareInheritedDat a->textEmphasisPosition 584 || rareInheritedData->textEmphasisPosition != other.rareInheritedDat a->textEmphasisPosition
585 || rareInheritedData->textEmphasisCustomMark != other.rareInheritedD ata->textEmphasisCustomMark 585 || rareInheritedData->textEmphasisCustomMark != other.rareInheritedD ata->textEmphasisCustomMark
586 || rareInheritedData->m_textJustify != other.rareInheritedData->m_te xtJustify 586 || rareInheritedData->m_textJustify != other.rareInheritedData->m_te xtJustify
587 || rareInheritedData->m_textOrientation != other.rareInheritedData-> m_textOrientation 587 || rareInheritedData->m_textOrientation != other.rareInheritedData-> m_textOrientation
588 || rareInheritedData->m_textCombine != other.rareInheritedData->m_te xtCombine 588 || rareInheritedData->m_textCombine != other.rareInheritedData->m_te xtCombine
589 || rareInheritedData->m_tabSize != other.rareInheritedData->m_tabSiz e 589 || rareInheritedData->m_tabSize != other.rareInheritedData->m_tabSiz e
590 || rareInheritedData->m_textSizeAdjust != other.rareInheritedData->m _textSizeAdjust
590 || rareInheritedData->listStyleImage != other.rareInheritedData->lis tStyleImage 591 || rareInheritedData->listStyleImage != other.rareInheritedData->lis tStyleImage
591 || rareInheritedData->m_snapHeightUnit != other.rareInheritedData->m _snapHeightUnit 592 || rareInheritedData->m_snapHeightUnit != other.rareInheritedData->m _snapHeightUnit
592 || rareInheritedData->m_snapHeightPosition != other.rareInheritedDat a->m_snapHeightPosition 593 || rareInheritedData->m_snapHeightPosition != other.rareInheritedDat a->m_snapHeightPosition
593 || rareInheritedData->textStrokeWidth != other.rareInheritedData->te xtStrokeWidth) 594 || rareInheritedData->textStrokeWidth != other.rareInheritedData->te xtStrokeWidth)
594 return true; 595 return true;
595 596
596 if (!rareInheritedData->shadowDataEquivalent(*other.rareInheritedData.ge t())) 597 if (!rareInheritedData->shadowDataEquivalent(*other.rareInheritedData.ge t()))
597 return true; 598 return true;
598 599
599 if (!rareInheritedData->quotesDataEquivalent(*other.rareInheritedData.ge t())) 600 if (!rareInheritedData->quotesDataEquivalent(*other.rareInheritedData.ge t()))
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 if (!std::isfinite(size) || size < 0) 1401 if (!std::isfinite(size) || size < 0)
1401 size = 0; 1402 size = 0;
1402 else 1403 else
1403 size = std::min(maximumAllowedFontSize, size); 1404 size = std::min(maximumAllowedFontSize, size);
1404 1405
1405 FontSelector* currentFontSelector = font().getFontSelector(); 1406 FontSelector* currentFontSelector = font().getFontSelector();
1406 FontDescription desc(getFontDescription()); 1407 FontDescription desc(getFontDescription());
1407 desc.setSpecifiedSize(size); 1408 desc.setSpecifiedSize(size);
1408 desc.setComputedSize(size); 1409 desc.setComputedSize(size);
1409 1410
1410 if (multiplier > 1) { 1411 float autosizedFontSize = TextAutosizer::computeAutosizedFontSize(size, mult iplier);
1411 float autosizedFontSize = TextAutosizer::computeAutosizedFontSize(size, multiplier); 1412 desc.setComputedSize(std::max(std::min(maximumAllowedFontSize, autosizedFont Size), 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
1412 desc.setComputedSize(std::min(maximumAllowedFontSize, autosizedFontSize) );
1413 }
1414 1413
1415 setFontDescription(desc); 1414 setFontDescription(desc);
1416 font().update(currentFontSelector); 1415 font().update(currentFontSelector);
1417 } 1416 }
1418 1417
1419 void ComputedStyle::addAppliedTextDecoration(const AppliedTextDecoration& decora tion) 1418 void ComputedStyle::addAppliedTextDecoration(const AppliedTextDecoration& decora tion)
1420 { 1419 {
1421 RefPtr<AppliedTextDecorationList>& list = rareInheritedData.access()->applie dTextDecorations; 1420 RefPtr<AppliedTextDecorationList>& list = rareInheritedData.access()->applie dTextDecorations;
1422 1421
1423 if (!list) 1422 if (!list)
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
1874 if (value < 0) 1873 if (value < 0)
1875 fvalue -= 0.5f; 1874 fvalue -= 0.5f;
1876 else 1875 else
1877 fvalue += 0.5f; 1876 fvalue += 0.5f;
1878 } 1877 }
1879 1878
1880 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 1879 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
1881 } 1880 }
1882 1881
1883 } // namespace blink 1882 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698