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

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: found one more spot Created 7 years, 4 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 | 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 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 return id == CSSPropertyTextShadow ? state.style()->setTextShadow(nu llptr) : state.style()->setBoxShadow(nullptr); 1454 return id == CSSPropertyTextShadow ? state.style()->setTextShadow(nu llptr) : state.style()->setBoxShadow(nullptr);
1455 1455
1456 if (!value->isValueList()) 1456 if (!value->isValueList())
1457 return; 1457 return;
1458 1458
1459 for (CSSValueListIterator i = value; i.hasMore(); i.advance()) { 1459 for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
1460 CSSValue* currValue = i.value(); 1460 CSSValue* currValue = i.value();
1461 if (!currValue->isShadowValue()) 1461 if (!currValue->isShadowValue())
1462 continue; 1462 continue;
1463 ShadowValue* item = static_cast<ShadowValue*>(currValue); 1463 ShadowValue* item = static_cast<ShadowValue*>(currValue);
1464 int x = item->x->computeLength<int>(state.style(), state.rootElement Style(), zoomFactor); 1464 LayoutUnit x = item->x->computeLength<float>(state.style(), state.ro otElementStyle(), zoomFactor);
1465 int y = item->y->computeLength<int>(state.style(), state.rootElement Style(), zoomFactor); 1465 LayoutUnit y = item->y->computeLength<float>(state.style(), state.ro otElementStyle(), zoomFactor);
1466 int blur = item->blur ? item->blur->computeLength<int>(state.style() , state.rootElementStyle(), zoomFactor) : 0; 1466 LayoutUnit blur = item->blur ? item->blur->computeLength<float>(stat e.style(), state.rootElementStyle(), zoomFactor) : 0;
1467 int spread = item->spread ? item->spread->computeLength<int>(state.s tyle(), state.rootElementStyle(), zoomFactor) : 0; 1467 LayoutUnit spread = item->spread ? item->spread->computeLength<float >(state.style(), state.rootElementStyle(), zoomFactor) : 0;
1468 ShadowStyle shadowStyle = item->style && item->style->getValueID() = = CSSValueInset ? Inset : Normal; 1468 ShadowStyle shadowStyle = item->style && item->style->getValueID() = = CSSValueInset ? Inset : Normal;
1469 StyleColor color; 1469 StyleColor color;
1470 if (item->color) 1470 if (item->color)
1471 color = state.document()->textLinkColors().colorFromPrimitiveVal ue(item->color.get()); 1471 color = state.document()->textLinkColors().colorFromPrimitiveVal ue(item->color.get());
1472 else if (state.style()) 1472 else if (state.style())
1473 color = state.style()->color(); 1473 color = state.style()->color();
1474 1474
1475 if (!color.isValid()) 1475 if (!color.isValid())
1476 color = Color::transparent; 1476 color = Color::transparent;
1477 OwnPtr<ShadowData> shadow = ShadowData::create(IntPoint(x, y), blur, spread, shadowStyle, color); 1477 OwnPtr<ShadowData> shadow = ShadowData::create(LayoutPoint(x, y), bl ur, spread, shadowStyle, color);
1478 if (id == CSSPropertyTextShadow) 1478 if (id == CSSPropertyTextShadow)
1479 state.style()->setTextShadow(shadow.release(), i.index()); // ad d to the list if this is not the first entry 1479 state.style()->setTextShadow(shadow.release(), i.index()); // ad d to the list if this is not the first entry
1480 else 1480 else
1481 state.style()->setBoxShadow(shadow.release(), i.index()); // add to the list if this is not the first entry 1481 state.style()->setBoxShadow(shadow.release(), i.index()); // add to the list if this is not the first entry
1482 } 1482 }
1483 return; 1483 return;
1484 } 1484 }
1485 case CSSPropertyWebkitBoxReflect: { 1485 case CSSPropertyWebkitBoxReflect: {
1486 HANDLE_INHERIT_AND_INITIAL(boxReflect, BoxReflect) 1486 HANDLE_INHERIT_AND_INITIAL(boxReflect, BoxReflect)
1487 if (primitiveValue) { 1487 if (primitiveValue) {
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
2337 break; 2337 break;
2338 } 2338 }
2339 case CSSPropertyEnableBackground: 2339 case CSSPropertyEnableBackground:
2340 // Silently ignoring this property for now 2340 // Silently ignoring this property for now
2341 // http://bugs.webkit.org/show_bug.cgi?id=6022 2341 // http://bugs.webkit.org/show_bug.cgi?id=6022
2342 break; 2342 break;
2343 } 2343 }
2344 } 2344 }
2345 2345
2346 } // namespace WebCore 2346 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698