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

Side by Side Diff: Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 40733004: Replace compile flag with runtime check for text-underline-position (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed a typo in static function compileUnderlineOffset signature / Rebase Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 791
792 if (primitiveValue->getValueID() == CSSValueFilled || primitiveValue->getVal ueID() == CSSValueOpen) { 792 if (primitiveValue->getValueID() == CSSValueFilled || primitiveValue->getVal ueID() == CSSValueOpen) {
793 state.style()->setTextEmphasisFill(*primitiveValue); 793 state.style()->setTextEmphasisFill(*primitiveValue);
794 state.style()->setTextEmphasisMark(TextEmphasisMarkAuto); 794 state.style()->setTextEmphasisMark(TextEmphasisMarkAuto);
795 } else { 795 } else {
796 state.style()->setTextEmphasisFill(TextEmphasisFillFilled); 796 state.style()->setTextEmphasisFill(TextEmphasisFillFilled);
797 state.style()->setTextEmphasisMark(*primitiveValue); 797 state.style()->setTextEmphasisMark(*primitiveValue);
798 } 798 }
799 } 799 }
800 800
801 #if ENABLE(CSS3_TEXT) 801 void StyleBuilderFunctions::applyValueCSSPropertyTextUnderlinePosition(StyleReso lverState& state, CSSValue* value)
802 void StyleBuilderFunctions::applyValueCSSPropertyWebkitTextUnderlinePosition(Sty leResolverState& state, CSSValue* value)
803 { 802 {
804 // This is true if value is 'auto' or 'alphabetic'. 803 // This is true if value is 'auto' or 'alphabetic'.
805 if (value->isPrimitiveValue()) { 804 if (value->isPrimitiveValue()) {
806 TextUnderlinePosition t = *toCSSPrimitiveValue(value); 805 TextUnderlinePosition t = *toCSSPrimitiveValue(value);
807 state.style()->setTextUnderlinePosition(t); 806 state.style()->setTextUnderlinePosition(t);
808 return; 807 return;
809 } 808 }
810 809
811 unsigned t = 0; 810 unsigned t = 0;
812 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) { 811 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
813 CSSValue* item = i.value(); 812 CSSValue* item = i.value();
814 TextUnderlinePosition t2 = *toCSSPrimitiveValue(item); 813 TextUnderlinePosition t2 = *toCSSPrimitiveValue(item);
815 t |= t2; 814 t |= t2;
816 } 815 }
817 state.style()->setTextUnderlinePosition(static_cast<TextUnderlinePosition>(t )); 816 state.style()->setTextUnderlinePosition(static_cast<TextUnderlinePosition>(t ));
818 } 817 }
819 #endif // CSS3_TEXT
820 818
821 Length StyleBuilderConverter::convertLength(StyleResolverState& state, CSSValue* value) 819 Length StyleBuilderConverter::convertLength(StyleResolverState& state, CSSValue* value)
822 { 820 {
823 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 821 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
824 Length result = primitiveValue->convertToLength<FixedIntegerConversion | Per centConversion>(state.style(), state.rootElementStyle(), state.style()->effectiv eZoom()); 822 Length result = primitiveValue->convertToLength<FixedIntegerConversion | Per centConversion>(state.style(), state.rootElementStyle(), state.style()->effectiv eZoom());
825 ASSERT(!result.isUndefined()); 823 ASSERT(!result.isUndefined());
826 result.setQuirk(primitiveValue->isQuirkValue()); 824 result.setQuirk(primitiveValue->isQuirkValue());
827 return result; 825 return result;
828 } 826 }
829 827
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after
2086 case CSSPropertyWebkitPerspectiveOriginX: 2084 case CSSPropertyWebkitPerspectiveOriginX:
2087 case CSSPropertyWebkitPerspectiveOriginY: 2085 case CSSPropertyWebkitPerspectiveOriginY:
2088 case CSSPropertyWebkitPrintColorAdjust: 2086 case CSSPropertyWebkitPrintColorAdjust:
2089 case CSSPropertyWebkitRegionBreakAfter: 2087 case CSSPropertyWebkitRegionBreakAfter:
2090 case CSSPropertyWebkitRegionBreakBefore: 2088 case CSSPropertyWebkitRegionBreakBefore:
2091 case CSSPropertyWebkitRegionBreakInside: 2089 case CSSPropertyWebkitRegionBreakInside:
2092 case CSSPropertyWebkitRegionFragment: 2090 case CSSPropertyWebkitRegionFragment:
2093 case CSSPropertyWebkitRtlOrdering: 2091 case CSSPropertyWebkitRtlOrdering:
2094 case CSSPropertyWebkitRubyPosition: 2092 case CSSPropertyWebkitRubyPosition:
2095 case CSSPropertyWebkitTextCombine: 2093 case CSSPropertyWebkitTextCombine:
2096 #if ENABLE(CSS3_TEXT) 2094 case CSSPropertyTextUnderlinePosition:
2097 case CSSPropertyWebkitTextUnderlinePosition:
2098 #endif // CSS3_TEXT
2099 case CSSPropertyWebkitTextEmphasisColor: 2095 case CSSPropertyWebkitTextEmphasisColor:
2100 case CSSPropertyWebkitTextEmphasisPosition: 2096 case CSSPropertyWebkitTextEmphasisPosition:
2101 case CSSPropertyWebkitTextEmphasisStyle: 2097 case CSSPropertyWebkitTextEmphasisStyle:
2102 case CSSPropertyWebkitTextFillColor: 2098 case CSSPropertyWebkitTextFillColor:
2103 case CSSPropertyWebkitTextSecurity: 2099 case CSSPropertyWebkitTextSecurity:
2104 case CSSPropertyWebkitTextStrokeColor: 2100 case CSSPropertyWebkitTextStrokeColor:
2105 case CSSPropertyWebkitTransformOriginX: 2101 case CSSPropertyWebkitTransformOriginX:
2106 case CSSPropertyWebkitTransformOriginY: 2102 case CSSPropertyWebkitTransformOriginY:
2107 case CSSPropertyWebkitTransformOriginZ: 2103 case CSSPropertyWebkitTransformOriginZ:
2108 case CSSPropertyWebkitTransformStyle: 2104 case CSSPropertyWebkitTransformStyle:
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
2402 break; 2398 break;
2403 } 2399 }
2404 case CSSPropertyEnableBackground: 2400 case CSSPropertyEnableBackground:
2405 // Silently ignoring this property for now 2401 // Silently ignoring this property for now
2406 // http://bugs.webkit.org/show_bug.cgi?id=6022 2402 // http://bugs.webkit.org/show_bug.cgi?id=6022
2407 break; 2403 break;
2408 } 2404 }
2409 } 2405 }
2410 2406
2411 } // namespace WebCore 2407 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698