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

Side by Side Diff: sky/engine/core/css/resolver/StyleBuilderCustom.cpp

Issue 1076623002: Remove our impressive amount of CSS Cursor code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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.
(...skipping 26 matching lines...) Expand all
37 */ 37 */
38 38
39 #include "sky/engine/config.h" 39 #include "sky/engine/config.h"
40 40
41 #include "gen/sky/core/CSSPropertyNames.h" 41 #include "gen/sky/core/CSSPropertyNames.h"
42 #include "gen/sky/core/CSSValueKeywords.h" 42 #include "gen/sky/core/CSSValueKeywords.h"
43 #include "gen/sky/core/StyleBuilderFunctions.h" 43 #include "gen/sky/core/StyleBuilderFunctions.h"
44 #include "gen/sky/core/StylePropertyShorthand.h" 44 #include "gen/sky/core/StylePropertyShorthand.h"
45 #include "sky/engine/core/css/BasicShapeFunctions.h" 45 #include "sky/engine/core/css/BasicShapeFunctions.h"
46 #include "sky/engine/core/css/CSSAspectRatioValue.h" 46 #include "sky/engine/core/css/CSSAspectRatioValue.h"
47 #include "sky/engine/core/css/CSSCursorImageValue.h"
48 #include "sky/engine/core/css/CSSFontValue.h" 47 #include "sky/engine/core/css/CSSFontValue.h"
49 #include "sky/engine/core/css/CSSGradientValue.h" 48 #include "sky/engine/core/css/CSSGradientValue.h"
50 #include "sky/engine/core/css/CSSHelper.h" 49 #include "sky/engine/core/css/CSSHelper.h"
51 #include "sky/engine/core/css/CSSImageSetValue.h" 50 #include "sky/engine/core/css/CSSImageSetValue.h"
52 #include "sky/engine/core/css/CSSLineBoxContainValue.h" 51 #include "sky/engine/core/css/CSSLineBoxContainValue.h"
53 #include "sky/engine/core/css/CSSPrimitiveValueMappings.h" 52 #include "sky/engine/core/css/CSSPrimitiveValueMappings.h"
54 #include "sky/engine/core/css/CSSPropertyMetadata.h" 53 #include "sky/engine/core/css/CSSPropertyMetadata.h"
55 #include "sky/engine/core/css/Pair.h" 54 #include "sky/engine/core/css/Pair.h"
56 #include "sky/engine/core/css/StylePropertySet.h" 55 #include "sky/engine/core/css/StylePropertySet.h"
57 #include "sky/engine/core/css/StyleRule.h" 56 #include "sky/engine/core/css/StyleRule.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 110 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
112 // As per the spec, 'color: currentColor' is treated as 'color: inherit' 111 // As per the spec, 'color: currentColor' is treated as 'color: inherit'
113 if (primitiveValue->getValueID() == CSSValueCurrentcolor) { 112 if (primitiveValue->getValueID() == CSSValueCurrentcolor) {
114 applyInheritCSSPropertyColor(state); 113 applyInheritCSSPropertyColor(state);
115 return; 114 return;
116 } 115 }
117 116
118 state.style()->setColor(StyleBuilderConverter::convertColor(state, value)); 117 state.style()->setColor(StyleBuilderConverter::convertColor(state, value));
119 } 118 }
120 119
121 void StyleBuilderFunctions::applyInitialCSSPropertyCursor(StyleResolverState& st ate)
122 {
123 state.style()->clearCursorList();
124 state.style()->setCursor(RenderStyle::initialCursor());
125 }
126
127 void StyleBuilderFunctions::applyInheritCSSPropertyCursor(StyleResolverState& st ate)
128 {
129 state.style()->setCursor(state.parentStyle()->cursor());
130 state.style()->setCursorList(state.parentStyle()->cursors());
131 }
132
133 void StyleBuilderFunctions::applyValueCSSPropertyCursor(StyleResolverState& stat e, CSSValue* value)
134 {
135 state.style()->clearCursorList();
136 if (value->isValueList()) {
137 CSSValueList* list = toCSSValueList(value);
138 int len = list->length();
139 state.style()->setCursor(CURSOR_AUTO);
140 for (int i = 0; i < len; i++) {
141 CSSValue* item = list->item(i);
142 if (item->isCursorImageValue()) {
143 CSSCursorImageValue* image = toCSSCursorImageValue(item);
144 state.style()->addCursor(state.styleImage(CSSPropertyCursor, ima ge), image->hotSpot());
145 } else {
146 state.style()->setCursor(*toCSSPrimitiveValue(item));
147 }
148 }
149 } else {
150 state.style()->setCursor(*toCSSPrimitiveValue(value));
151 }
152 }
153
154 void StyleBuilderFunctions::applyValueCSSPropertyDirection(StyleResolverState& s tate, CSSValue* value) 120 void StyleBuilderFunctions::applyValueCSSPropertyDirection(StyleResolverState& s tate, CSSValue* value)
155 { 121 {
156 state.style()->setDirection(*toCSSPrimitiveValue(value)); 122 state.style()->setDirection(*toCSSPrimitiveValue(value));
157 } 123 }
158 124
159 void StyleBuilderFunctions::applyInitialCSSPropertyFontFamily(StyleResolverState & state) 125 void StyleBuilderFunctions::applyInitialCSSPropertyFontFamily(StyleResolverState & state)
160 { 126 {
161 state.fontBuilder().setFontFamilyInitial(); 127 state.fontBuilder().setFontFamilyInitial();
162 } 128 }
163 129
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 state.style()->setPerspective(perspectiveValue); 789 state.style()->setPerspective(perspectiveValue);
824 } 790 }
825 791
826 void StyleBuilderFunctions::applyValueCSSPropertyWebkitTextOrientation(StyleReso lverState& state, CSSValue* value) 792 void StyleBuilderFunctions::applyValueCSSPropertyWebkitTextOrientation(StyleReso lverState& state, CSSValue* value)
827 { 793 {
828 if (value->isPrimitiveValue()) 794 if (value->isPrimitiveValue())
829 state.setTextOrientation(*toCSSPrimitiveValue(value)); 795 state.setTextOrientation(*toCSSPrimitiveValue(value));
830 } 796 }
831 797
832 } // namespace blink 798 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/css/resolver/ElementStyleResources.cpp ('k') | sky/engine/core/css/resolver/StyleResourceLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698