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

Side by Side Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.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, 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) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7 * Copyright (C) 2015 Google Inc. All rights reserved. 7 * Copyright (C) 2015 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public 10 * modify it under the terms of the GNU Lesser General Public
(...skipping 1828 matching lines...) Expand 10 before | Expand all | Expand 10 after
1839 return CSSPrimitiveValue::create(mapToColumnBreakValue(style.breakBefore ())); 1839 return CSSPrimitiveValue::create(mapToColumnBreakValue(style.breakBefore ()));
1840 case CSSPropertyWebkitColumnBreakInside: 1840 case CSSPropertyWebkitColumnBreakInside:
1841 return CSSPrimitiveValue::create(mapToColumnBreakValue(style.breakInside ())); 1841 return CSSPrimitiveValue::create(mapToColumnBreakValue(style.breakInside ()));
1842 case CSSPropertyColumnWidth: 1842 case CSSPropertyColumnWidth:
1843 if (style.hasAutoColumnWidth()) 1843 if (style.hasAutoColumnWidth())
1844 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 1844 return CSSPrimitiveValue::createIdentifier(CSSValueAuto);
1845 return zoomAdjustedPixelValue(style.columnWidth(), style); 1845 return zoomAdjustedPixelValue(style.columnWidth(), style);
1846 case CSSPropertyTabSize: 1846 case CSSPropertyTabSize:
1847 return CSSPrimitiveValue::create( 1847 return CSSPrimitiveValue::create(
1848 style.getTabSize().getPixelSize(1.0), style.getTabSize().isSpaces() ? CSSPrimitiveValue::UnitType::Number : CSSPrimitiveValue::UnitType::Pixels); 1848 style.getTabSize().getPixelSize(1.0), style.getTabSize().isSpaces() ? CSSPrimitiveValue::UnitType::Number : CSSPrimitiveValue::UnitType::Pixels);
1849 case CSSPropertyTextSizeAdjust:
1850 if (style.getTextSizeAdjust().isAuto())
1851 return CSSPrimitiveValue::createIdentifier(CSSValueAuto);
1852 return CSSPrimitiveValue::create(style.getTextSizeAdjust().multiplier() * 100, CSSPrimitiveValue::UnitType::Percentage);
1849 case CSSPropertyCursor: { 1853 case CSSPropertyCursor: {
1850 CSSValueList* list = nullptr; 1854 CSSValueList* list = nullptr;
1851 CursorList* cursors = style.cursors(); 1855 CursorList* cursors = style.cursors();
1852 if (cursors && cursors->size() > 0) { 1856 if (cursors && cursors->size() > 0) {
1853 list = CSSValueList::createCommaSeparated(); 1857 list = CSSValueList::createCommaSeparated();
1854 for (unsigned i = 0; i < cursors->size(); ++i) { 1858 for (unsigned i = 0; i < cursors->size(); ++i) {
1855 if (StyleImage* image = cursors->at(i).image()) 1859 if (StyleImage* image = cursors->at(i).image())
1856 list->append(*CSSCursorImageValue::create(image->computedCSS Value(), cursors->at(i).hotSpotSpecified(), cursors->at(i).hotSpot())); 1860 list->append(*CSSCursorImageValue::create(image->computedCSS Value(), cursors->at(i).hotSpotSpecified(), cursors->at(i).hotSpot()));
1857 } 1861 }
1858 } 1862 }
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after
2999 case CSSPropertyAll: 3003 case CSSPropertyAll:
3000 return nullptr; 3004 return nullptr;
3001 default: 3005 default:
3002 break; 3006 break;
3003 } 3007 }
3004 ASSERT_NOT_REACHED(); 3008 ASSERT_NOT_REACHED();
3005 return nullptr; 3009 return nullptr;
3006 } 3010 }
3007 3011
3008 } // namespace blink 3012 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698