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

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

Issue 23241010: Support subpixel values for text-shadow and box-shadow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: all working! 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 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueNone); 919 ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueNone);
920 return PassRefPtr<ShadowList>(); 920 return PassRefPtr<ShadowList>();
921 } 921 }
922 922
923 const CSSValueList* valueList = toCSSValueList(value); 923 const CSSValueList* valueList = toCSSValueList(value);
924 size_t shadowCount = valueList->length(); 924 size_t shadowCount = valueList->length();
925 float zoom = state.style()->effectiveZoom(); 925 float zoom = state.style()->effectiveZoom();
926 ShadowDataVector shadows; 926 ShadowDataVector shadows;
927 for (size_t i = 0; i < shadowCount; ++i) { 927 for (size_t i = 0; i < shadowCount; ++i) {
928 const CSSShadowValue* item = toCSSShadowValue(valueList->item(i)); 928 const CSSShadowValue* item = toCSSShadowValue(valueList->item(i));
929 int x = item->x->computeLength<int>(state.style(), state.rootElementStyl e(), zoom); 929 LayoutUnit x = item->x->computeLength<float>(state.style(), state.rootEl ementStyle(), zoom);
930 int y = item->y->computeLength<int>(state.style(), state.rootElementStyl e(), zoom); 930 LayoutUnit y = item->y->computeLength<float>(state.style(), state.rootEl ementStyle(), zoom);
931 int blur = item->blur ? item->blur->computeLength<int>(state.style(), st ate.rootElementStyle(), zoom) : 0; 931 LayoutUnit blur = item->blur ? item->blur->computeLength<float>(state.st yle(), state.rootElementStyle(), zoom) : 0;
932 int spread = item->spread ? item->spread->computeLength<int>(state.style (), state.rootElementStyle(), zoom) : 0; 932 LayoutUnit spread = item->spread ? item->spread->computeLength<float>(st ate.style(), state.rootElementStyle(), zoom) : 0;
933 ShadowStyle shadowStyle = item->style && item->style->getValueID() == CS SValueInset ? Inset : Normal; 933 ShadowStyle shadowStyle = item->style && item->style->getValueID() == CS SValueInset ? Inset : Normal;
934 Color color; 934 Color color;
935 if (item->color) 935 if (item->color)
936 color = state.document().textLinkColors().colorFromPrimitiveValue(it em->color.get(), state.style()->visitedDependentColor(CSSPropertyColor)); 936 color = state.document().textLinkColors().colorFromPrimitiveValue(it em->color.get(), state.style()->visitedDependentColor(CSSPropertyColor));
937 else 937 else
938 color = state.style()->color(); 938 color = state.style()->color();
939 939
940 if (!color.isValid()) 940 if (!color.isValid())
941 color = Color::transparent; 941 color = Color::transparent;
942 shadows.append(ShadowData(IntPoint(x, y), blur, spread, shadowStyle, col or)); 942 shadows.append(ShadowData(LayoutPoint(x, y), blur, spread, shadowStyle, color));
943 } 943 }
944 return ShadowList::adopt(shadows); 944 return ShadowList::adopt(shadows);
945 } 945 }
946 946
947 float StyleBuilderConverter::convertSpacing(StyleResolverState& state, CSSValue* value) 947 float StyleBuilderConverter::convertSpacing(StyleResolverState& state, CSSValue* value)
948 { 948 {
949 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 949 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
950 if (primitiveValue->getValueID() == CSSValueNormal) 950 if (primitiveValue->getValueID() == CSSValueNormal)
951 return 0; 951 return 0;
952 float zoom = state.useSVGZoomRules() ? 1.0f : state.style()->effectiveZoom() ; 952 float zoom = state.useSVGZoomRules() ? 1.0f : state.style()->effectiveZoom() ;
(...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after
2307 break; 2307 break;
2308 } 2308 }
2309 case CSSPropertyEnableBackground: 2309 case CSSPropertyEnableBackground:
2310 // Silently ignoring this property for now 2310 // Silently ignoring this property for now
2311 // http://bugs.webkit.org/show_bug.cgi?id=6022 2311 // http://bugs.webkit.org/show_bug.cgi?id=6022
2312 break; 2312 break;
2313 } 2313 }
2314 } 2314 }
2315 2315
2316 } // namespace WebCore 2316 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698