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

Side by Side Diff: Source/core/rendering/style/RenderStyle.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) 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 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 void RenderStyle::getShadowExtent(const ShadowData* shadow, LayoutUnit &top, Lay outUnit &right, LayoutUnit &bottom, LayoutUnit &left) const 1226 void RenderStyle::getShadowExtent(const ShadowData* shadow, LayoutUnit &top, Lay outUnit &right, LayoutUnit &bottom, LayoutUnit &left) const
1227 { 1227 {
1228 top = 0; 1228 top = 0;
1229 right = 0; 1229 right = 0;
1230 bottom = 0; 1230 bottom = 0;
1231 left = 0; 1231 left = 0;
1232 1232
1233 for ( ; shadow; shadow = shadow->next()) { 1233 for ( ; shadow; shadow = shadow->next()) {
1234 if (shadow->style() == Inset) 1234 if (shadow->style() == Inset)
1235 continue; 1235 continue;
1236 int blurAndSpread = shadow->blur() + shadow->spread(); 1236 LayoutUnit blurAndSpread = shadow->blur() + shadow->spread();
1237 1237
1238 top = min<LayoutUnit>(top, shadow->y() - blurAndSpread); 1238 top = min<LayoutUnit>(top, shadow->y() - blurAndSpread);
1239 right = max<LayoutUnit>(right, shadow->x() + blurAndSpread); 1239 right = max<LayoutUnit>(right, shadow->x() + blurAndSpread);
1240 bottom = max<LayoutUnit>(bottom, shadow->y() + blurAndSpread); 1240 bottom = max<LayoutUnit>(bottom, shadow->y() + blurAndSpread);
1241 left = min<LayoutUnit>(left, shadow->x() - blurAndSpread); 1241 left = min<LayoutUnit>(left, shadow->x() - blurAndSpread);
1242 } 1242 }
1243 } 1243 }
1244 1244
1245 LayoutBoxExtent RenderStyle::getShadowInsetExtent(const ShadowData* shadow) cons t 1245 LayoutBoxExtent RenderStyle::getShadowInsetExtent(const ShadowData* shadow) cons t
1246 { 1246 {
1247 LayoutUnit top = 0; 1247 LayoutUnit top = 0;
1248 LayoutUnit right = 0; 1248 LayoutUnit right = 0;
1249 LayoutUnit bottom = 0; 1249 LayoutUnit bottom = 0;
1250 LayoutUnit left = 0; 1250 LayoutUnit left = 0;
1251 1251
1252 for ( ; shadow; shadow = shadow->next()) { 1252 for ( ; shadow; shadow = shadow->next()) {
1253 if (shadow->style() == Normal) 1253 if (shadow->style() == Normal)
1254 continue; 1254 continue;
1255 int blurAndSpread = shadow->blur() + shadow->spread(); 1255 LayoutUnit blurAndSpread = shadow->blur() + shadow->spread();
1256 top = max<LayoutUnit>(top, shadow->y() + blurAndSpread); 1256 top = max<LayoutUnit>(top, shadow->y() + blurAndSpread);
1257 right = min<LayoutUnit>(right, shadow->x() - blurAndSpread); 1257 right = min<LayoutUnit>(right, shadow->x() - blurAndSpread);
1258 bottom = min<LayoutUnit>(bottom, shadow->y() - blurAndSpread); 1258 bottom = min<LayoutUnit>(bottom, shadow->y() - blurAndSpread);
1259 left = max<LayoutUnit>(left, shadow->x() + blurAndSpread); 1259 left = max<LayoutUnit>(left, shadow->x() + blurAndSpread);
1260 } 1260 }
1261 1261
1262 return LayoutBoxExtent(top, right, bottom, left); 1262 return LayoutBoxExtent(top, right, bottom, left);
1263 } 1263 }
1264 1264
1265 void RenderStyle::getShadowHorizontalExtent(const ShadowData* shadow, LayoutUnit &left, LayoutUnit &right) const 1265 void RenderStyle::getShadowHorizontalExtent(const ShadowData* shadow, LayoutUnit &left, LayoutUnit &right) const
1266 { 1266 {
1267 left = 0; 1267 left = 0;
1268 right = 0; 1268 right = 0;
1269 1269
1270 for ( ; shadow; shadow = shadow->next()) { 1270 for ( ; shadow; shadow = shadow->next()) {
1271 if (shadow->style() == Inset) 1271 if (shadow->style() == Inset)
1272 continue; 1272 continue;
1273 int blurAndSpread = shadow->blur() + shadow->spread(); 1273 LayoutUnit blurAndSpread = shadow->blur() + shadow->spread();
1274 1274
1275 left = min<LayoutUnit>(left, shadow->x() - blurAndSpread); 1275 left = min<LayoutUnit>(left, shadow->x() - blurAndSpread);
1276 right = max<LayoutUnit>(right, shadow->x() + blurAndSpread); 1276 right = max<LayoutUnit>(right, shadow->x() + blurAndSpread);
1277 } 1277 }
1278 } 1278 }
1279 1279
1280 void RenderStyle::getShadowVerticalExtent(const ShadowData* shadow, LayoutUnit & top, LayoutUnit &bottom) const 1280 void RenderStyle::getShadowVerticalExtent(const ShadowData* shadow, LayoutUnit & top, LayoutUnit &bottom) const
1281 { 1281 {
1282 top = 0; 1282 top = 0;
1283 bottom = 0; 1283 bottom = 0;
1284 1284
1285 for ( ; shadow; shadow = shadow->next()) { 1285 for ( ; shadow; shadow = shadow->next()) {
1286 if (shadow->style() == Inset) 1286 if (shadow->style() == Inset)
1287 continue; 1287 continue;
1288 int blurAndSpread = shadow->blur() + shadow->spread(); 1288 LayoutUnit blurAndSpread = shadow->blur() + shadow->spread();
1289 1289
1290 top = min<LayoutUnit>(top, shadow->y() - blurAndSpread); 1290 top = min<LayoutUnit>(top, shadow->y() - blurAndSpread);
1291 bottom = max<LayoutUnit>(bottom, shadow->y() + blurAndSpread); 1291 bottom = max<LayoutUnit>(bottom, shadow->y() + blurAndSpread);
1292 } 1292 }
1293 } 1293 }
1294 1294
1295 StyleColor RenderStyle::colorIncludingFallback(int colorProperty, bool visitedLi nk) const 1295 StyleColor RenderStyle::colorIncludingFallback(int colorProperty, bool visitedLi nk) const
1296 { 1296 {
1297 StyleColor result; 1297 StyleColor result;
1298 EBorderStyle borderStyle = BNONE; 1298 EBorderStyle borderStyle = BNONE;
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
1565 surround.access()->border.m_image.setOutset(outset); 1565 surround.access()->border.m_image.setOutset(outset);
1566 } 1566 }
1567 1567
1568 ShapeValue* RenderStyle::initialShapeInside() 1568 ShapeValue* RenderStyle::initialShapeInside()
1569 { 1569 {
1570 DEFINE_STATIC_LOCAL(RefPtr<ShapeValue>, sOutsideValue, (ShapeValue::createOu tsideValue())); 1570 DEFINE_STATIC_LOCAL(RefPtr<ShapeValue>, sOutsideValue, (ShapeValue::createOu tsideValue()));
1571 return sOutsideValue.get(); 1571 return sOutsideValue.get();
1572 } 1572 }
1573 1573
1574 } // namespace WebCore 1574 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698