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

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

Issue 23685007: Have SVGURIReference API deal with Document references, not pointers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 if (!primitiveValue) 1152 if (!primitiveValue)
1153 return false; 1153 return false;
1154 int type = primitiveValue->primitiveType(); 1154 int type = primitiveValue->primitiveType();
1155 if (type == CSSPrimitiveValue::CSS_PERCENTAGE) { 1155 if (type == CSSPrimitiveValue::CSS_PERCENTAGE) {
1156 out = primitiveValue->getFloatValue() / 100.0f; 1156 out = primitiveValue->getFloatValue() / 100.0f;
1157 return true; 1157 return true;
1158 } 1158 }
1159 return numberToFloat(primitiveValue, out); 1159 return numberToFloat(primitiveValue, out);
1160 } 1160 }
1161 1161
1162 static String fragmentIdentifier(const CSSPrimitiveValue* primitiveValue, Docume nt* document) 1162 static String fragmentIdentifier(const CSSPrimitiveValue* primitiveValue, Docume nt& document)
1163 { 1163 {
1164 if (primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_URI) 1164 if (primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_URI)
1165 return String(); 1165 return String();
1166 return SVGURIReference::fragmentIdentifierFromIRIString(primitiveValue->getS tringValue(), document); 1166 return SVGURIReference::fragmentIdentifierFromIRIString(primitiveValue->getS tringValue(), document);
1167 } 1167 }
1168 1168
1169 static inline bool isValidVisitedLinkProperty(CSSPropertyID id) 1169 static inline bool isValidVisitedLinkProperty(CSSPropertyID id)
1170 { 1170 {
1171 switch (id) { 1171 switch (id) {
1172 case CSSPropertyBackgroundColor: 1172 case CSSPropertyBackgroundColor:
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
2271 HANDLE_SVG_INHERIT_AND_INITIAL(stopOpacity, StopOpacity) 2271 HANDLE_SVG_INHERIT_AND_INITIAL(stopOpacity, StopOpacity)
2272 float f = 0.0f; 2272 float f = 0.0f;
2273 if (percentageOrNumberToFloat(primitiveValue, f)) 2273 if (percentageOrNumberToFloat(primitiveValue, f))
2274 state.style()->accessSVGStyle()->setStopOpacity(f); 2274 state.style()->accessSVGStyle()->setStopOpacity(f);
2275 break; 2275 break;
2276 } 2276 }
2277 case CSSPropertyMarkerStart: 2277 case CSSPropertyMarkerStart:
2278 { 2278 {
2279 HANDLE_SVG_INHERIT_AND_INITIAL(markerStartResource, MarkerStartResource) 2279 HANDLE_SVG_INHERIT_AND_INITIAL(markerStartResource, MarkerStartResource)
2280 if (primitiveValue) 2280 if (primitiveValue)
2281 state.style()->accessSVGStyle()->setMarkerStartResource(fragmentIden tifier(primitiveValue, &state.document())); 2281 state.style()->accessSVGStyle()->setMarkerStartResource(fragmentIden tifier(primitiveValue, state.document()));
2282 break; 2282 break;
2283 } 2283 }
2284 case CSSPropertyMarkerMid: 2284 case CSSPropertyMarkerMid:
2285 { 2285 {
2286 HANDLE_SVG_INHERIT_AND_INITIAL(markerMidResource, MarkerMidResource) 2286 HANDLE_SVG_INHERIT_AND_INITIAL(markerMidResource, MarkerMidResource)
2287 if (primitiveValue) 2287 if (primitiveValue)
2288 state.style()->accessSVGStyle()->setMarkerMidResource(fragmentIdenti fier(primitiveValue, &state.document())); 2288 state.style()->accessSVGStyle()->setMarkerMidResource(fragmentIdenti fier(primitiveValue, state.document()));
2289 break; 2289 break;
2290 } 2290 }
2291 case CSSPropertyMarkerEnd: 2291 case CSSPropertyMarkerEnd:
2292 { 2292 {
2293 HANDLE_SVG_INHERIT_AND_INITIAL(markerEndResource, MarkerEndResource) 2293 HANDLE_SVG_INHERIT_AND_INITIAL(markerEndResource, MarkerEndResource)
2294 if (primitiveValue) 2294 if (primitiveValue)
2295 state.style()->accessSVGStyle()->setMarkerEndResource(fragmentIdenti fier(primitiveValue, &state.document())); 2295 state.style()->accessSVGStyle()->setMarkerEndResource(fragmentIdenti fier(primitiveValue, state.document()));
2296 break; 2296 break;
2297 } 2297 }
2298 case CSSPropertyStrokeMiterlimit: 2298 case CSSPropertyStrokeMiterlimit:
2299 { 2299 {
2300 HANDLE_SVG_INHERIT_AND_INITIAL(strokeMiterLimit, StrokeMiterLimit) 2300 HANDLE_SVG_INHERIT_AND_INITIAL(strokeMiterLimit, StrokeMiterLimit)
2301 float f = 0.0f; 2301 float f = 0.0f;
2302 if (numberToFloat(primitiveValue, f)) 2302 if (numberToFloat(primitiveValue, f))
2303 state.style()->accessSVGStyle()->setStrokeMiterLimit(f); 2303 state.style()->accessSVGStyle()->setStrokeMiterLimit(f);
2304 break; 2304 break;
2305 } 2305 }
2306 case CSSPropertyFilter: 2306 case CSSPropertyFilter:
2307 { 2307 {
2308 HANDLE_SVG_INHERIT_AND_INITIAL(filterResource, FilterResource) 2308 HANDLE_SVG_INHERIT_AND_INITIAL(filterResource, FilterResource)
2309 if (primitiveValue) 2309 if (primitiveValue)
2310 state.style()->accessSVGStyle()->setFilterResource(fragmentIdentifie r(primitiveValue, &state.document())); 2310 state.style()->accessSVGStyle()->setFilterResource(fragmentIdentifie r(primitiveValue, state.document()));
2311 break; 2311 break;
2312 } 2312 }
2313 case CSSPropertyMask: 2313 case CSSPropertyMask:
2314 { 2314 {
2315 HANDLE_SVG_INHERIT_AND_INITIAL(maskerResource, MaskerResource) 2315 HANDLE_SVG_INHERIT_AND_INITIAL(maskerResource, MaskerResource)
2316 if (primitiveValue) 2316 if (primitiveValue)
2317 state.style()->accessSVGStyle()->setMaskerResource(fragmentIdentifie r(primitiveValue, &state.document())); 2317 state.style()->accessSVGStyle()->setMaskerResource(fragmentIdentifie r(primitiveValue, state.document()));
2318 break; 2318 break;
2319 } 2319 }
2320 case CSSPropertyClipPath: 2320 case CSSPropertyClipPath:
2321 { 2321 {
2322 HANDLE_SVG_INHERIT_AND_INITIAL(clipperResource, ClipperResource) 2322 HANDLE_SVG_INHERIT_AND_INITIAL(clipperResource, ClipperResource)
2323 if (primitiveValue) 2323 if (primitiveValue)
2324 state.style()->accessSVGStyle()->setClipperResource(fragmentIdentifi er(primitiveValue, &state.document())); 2324 state.style()->accessSVGStyle()->setClipperResource(fragmentIdentifi er(primitiveValue, state.document()));
2325 break; 2325 break;
2326 } 2326 }
2327 case CSSPropertyStopColor: 2327 case CSSPropertyStopColor:
2328 { 2328 {
2329 HANDLE_SVG_INHERIT_AND_INITIAL(stopColor, StopColor); 2329 HANDLE_SVG_INHERIT_AND_INITIAL(stopColor, StopColor);
2330 if (value->isSVGColor()) 2330 if (value->isSVGColor())
2331 state.style()->accessSVGStyle()->setStopColor(colorFromSVGColorCSSVa lue(static_cast<SVGColor*>(value), state.style()->color())); 2331 state.style()->accessSVGStyle()->setStopColor(colorFromSVGColorCSSVa lue(static_cast<SVGColor*>(value), state.style()->color()));
2332 break; 2332 break;
2333 } 2333 }
2334 case CSSPropertyLightingColor: 2334 case CSSPropertyLightingColor:
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
2380 break; 2380 break;
2381 } 2381 }
2382 case CSSPropertyEnableBackground: 2382 case CSSPropertyEnableBackground:
2383 // Silently ignoring this property for now 2383 // Silently ignoring this property for now
2384 // http://bugs.webkit.org/show_bug.cgi?id=6022 2384 // http://bugs.webkit.org/show_bug.cgi?id=6022
2385 break; 2385 break;
2386 } 2386 }
2387 } 2387 }
2388 2388
2389 } // namespace WebCore 2389 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/resolver/FilterOperationResolver.cpp ('k') | Source/core/rendering/svg/RenderSVGResourceContainer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698