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

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

Issue 17450016: Implementation of CSS3 nav-up/down/left/right properties from CSS3 UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added tests 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
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.
11 * Copyright (C) 2013 Opera Software ASA. All rights reserved.
11 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 12 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
12 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions are 14 * modification, are permitted provided that the following conditions are
14 * met: 15 * met:
15 * 16 *
16 * * Redistributions of source code must retain the above copyright 17 * * Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer. 18 * notice, this list of conditions and the following disclaimer.
18 * * Redistributions in binary form must reproduce the above 19 * * Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following disclaimer 20 * copyright notice, this list of conditions and the following disclaimer
20 * in the documentation and/or other materials provided with the 21 * in the documentation and/or other materials provided with the
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 #include "core/platform/graphics/FontDescription.h" 71 #include "core/platform/graphics/FontDescription.h"
71 #include "core/rendering/style/CounterContent.h" 72 #include "core/rendering/style/CounterContent.h"
72 #include "core/rendering/style/CursorList.h" 73 #include "core/rendering/style/CursorList.h"
73 #include "core/rendering/style/QuotesData.h" 74 #include "core/rendering/style/QuotesData.h"
74 #include "core/rendering/style/RenderStyle.h" 75 #include "core/rendering/style/RenderStyle.h"
75 #include "core/rendering/style/RenderStyleConstants.h" 76 #include "core/rendering/style/RenderStyleConstants.h"
76 #include "core/rendering/style/SVGRenderStyle.h" 77 #include "core/rendering/style/SVGRenderStyle.h"
77 #include "core/rendering/style/SVGRenderStyleDefs.h" 78 #include "core/rendering/style/SVGRenderStyleDefs.h"
78 #include "core/rendering/style/ShadowData.h" 79 #include "core/rendering/style/ShadowData.h"
79 #include "core/rendering/style/StyleGeneratedImage.h" 80 #include "core/rendering/style/StyleGeneratedImage.h"
81 #include "core/rendering/style/StyleNavigationValue.h"
80 #include "core/svg/SVGColor.h" 82 #include "core/svg/SVGColor.h"
81 #include "core/svg/SVGPaint.h" 83 #include "core/svg/SVGPaint.h"
82 #include "core/svg/SVGURIReference.h" 84 #include "core/svg/SVGURIReference.h"
83 #include "wtf/MathExtras.h" 85 #include "wtf/MathExtras.h"
84 #include "wtf/StdLibExtras.h" 86 #include "wtf/StdLibExtras.h"
85 #include "wtf/Vector.h" 87 #include "wtf/Vector.h"
86 88
87 namespace WebCore { 89 namespace WebCore {
88 90
89 static Length clipConvertToLength(StyleResolverState& state, CSSPrimitiveValue* value) 91 static Length clipConvertToLength(StyleResolverState& state, CSSPrimitiveValue* value)
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 case CSSPropertyWebkitMaskRepeat: 1231 case CSSPropertyWebkitMaskRepeat:
1230 case CSSPropertyWebkitTextEmphasis: 1232 case CSSPropertyWebkitTextEmphasis:
1231 case CSSPropertyWebkitTextStroke: 1233 case CSSPropertyWebkitTextStroke:
1232 case CSSPropertyWebkitTransition: 1234 case CSSPropertyWebkitTransition:
1233 case CSSPropertyWebkitTransformOrigin: 1235 case CSSPropertyWebkitTransformOrigin:
1234 ASSERT(isExpandedShorthand(id)); 1236 ASSERT(isExpandedShorthand(id));
1235 ASSERT_NOT_REACHED(); 1237 ASSERT_NOT_REACHED();
1236 break; 1238 break;
1237 1239
1238 // CSS3 Properties 1240 // CSS3 Properties
1241 case CSSPropertyNavDown:
1242 case CSSPropertyNavLeft:
1243 case CSSPropertyNavRight:
1244 case CSSPropertyNavUp: {
1245 StyleNavigationValue navigationValue;
esprehn 2013/08/08 03:39:40 This should be handled by individual functions ins
Krzysztof Olczyk 2013/12/04 13:56:50 Done.
1246
1247 if (isInitial) {
1248 navigationValue = StyleNavigationValue();
1249 } else if (primitiveValue) {
1250 navigationValue = StyleNavigationValue(primitiveValue->getStringValu e());
1251 } else if (value->isValueList()) {
1252 AtomicString vals[2];
1253 CSSValueListIterator iterator = value;
1254
1255 for (int i = 0; i < 2 && iterator.hasMore(); iterator.advance()) {
1256 CSSValue* item = iterator.value();
1257 if (!item->isPrimitiveValue())
1258 continue;
1259 vals[i++] = (static_cast<CSSPrimitiveValue*>(item))->getStringVa lue();
1260 }
1261
1262 navigationValue = StyleNavigationValue(vals[0], vals[1]);
1263 }
1264
1265 switch (id) {
1266 case CSSPropertyNavDown:
1267 state.style()->setNavDown(navigationValue);
1268 return;
1269 case CSSPropertyNavLeft:
1270 state.style()->setNavLeft(navigationValue);
1271 return;
1272 case CSSPropertyNavRight:
1273 state.style()->setNavRight(navigationValue);
1274 return;
1275 case CSSPropertyNavUp:
1276 state.style()->setNavUp(navigationValue);
1277 return;
1278 }
1279 }
1239 case CSSPropertyTextShadow: 1280 case CSSPropertyTextShadow:
1240 case CSSPropertyBoxShadow: 1281 case CSSPropertyBoxShadow:
1241 case CSSPropertyWebkitBoxShadow: { 1282 case CSSPropertyWebkitBoxShadow: {
1242 if (isInherit) { 1283 if (isInherit) {
1243 if (id == CSSPropertyTextShadow) 1284 if (id == CSSPropertyTextShadow)
1244 return state.style()->setTextShadow(cloneShadow(state.parentStyl e()->textShadow())); 1285 return state.style()->setTextShadow(cloneShadow(state.parentStyl e()->textShadow()));
1245 return state.style()->setBoxShadow(cloneShadow(state.parentStyle()-> boxShadow())); 1286 return state.style()->setBoxShadow(cloneShadow(state.parentStyle()-> boxShadow()));
1246 } 1287 }
1247 if (isInitial || primitiveValue) // initial | none 1288 if (isInitial || primitiveValue) // initial | none
1248 return id == CSSPropertyTextShadow ? state.style()->setTextShadow(nu llptr) : state.style()->setBoxShadow(nullptr); 1289 return id == CSSPropertyTextShadow ? state.style()->setTextShadow(nu llptr) : state.style()->setBoxShadow(nullptr);
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
2123 break; 2164 break;
2124 } 2165 }
2125 case CSSPropertyEnableBackground: 2166 case CSSPropertyEnableBackground:
2126 // Silently ignoring this property for now 2167 // Silently ignoring this property for now
2127 // http://bugs.webkit.org/show_bug.cgi?id=6022 2168 // http://bugs.webkit.org/show_bug.cgi?id=6022
2128 break; 2169 break;
2129 } 2170 }
2130 } 2171 }
2131 2172
2132 } // namespace WebCore 2173 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698