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

Side by Side Diff: Source/core/layout/svg/LayoutSVGRect.cpp

Issue 955033002: [svg2] Make 'rx' and 'ry' presentation attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add tests Created 5 years, 10 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) 2011 University of Szeged 2 * Copyright (C) 2011 University of Szeged
3 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> 3 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org>
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 FloatSize boundingBoxSize(rect->width()->currentValue()->value(lengthContext ), rect->height()->currentValue()->value(lengthContext)); 57 FloatSize boundingBoxSize(rect->width()->currentValue()->value(lengthContext ), rect->height()->currentValue()->value(lengthContext));
58 58
59 // Spec: "A negative value is an error." 59 // Spec: "A negative value is an error."
60 if (boundingBoxSize.width() < 0 || boundingBoxSize.height() < 0) 60 if (boundingBoxSize.width() < 0 || boundingBoxSize.height() < 0)
61 return; 61 return;
62 62
63 // Spec: "A value of zero disables rendering of the element." 63 // Spec: "A value of zero disables rendering of the element."
64 if (!boundingBoxSize.isEmpty()) { 64 if (!boundingBoxSize.isEmpty()) {
65 // Fallback to LayoutSVGShape and path-based hit detection if the rect 65 // Fallback to LayoutSVGShape and path-based hit detection if the rect
66 // has rounded corners or a non-scaling or non-simple stroke. 66 // has rounded corners or a non-scaling or non-simple stroke.
67 if (rect->rx()->currentValue()->value(lengthContext) > 0 67 if (lengthContext.valueForLength(style()->svgStyle().rx(), styleRef(), L engthModeWidth) > 0
68 || rect->ry()->currentValue()->value(lengthContext) > 0 68 || lengthContext.valueForLength(style()->svgStyle().ry(), styleRef() , LengthModeHeight) > 0
69 || hasNonScalingStroke() 69 || hasNonScalingStroke()
70 || !definitelyHasSimpleStroke()) { 70 || !definitelyHasSimpleStroke()) {
71 LayoutSVGShape::updateShapeFromElement(); 71 LayoutSVGShape::updateShapeFromElement();
72 m_usePathFallback = true; 72 m_usePathFallback = true;
73 return; 73 return;
74 } 74 }
75 } 75 }
76 76
77 m_fillBoundingBox = FloatRect( 77 m_fillBoundingBox = FloatRect(
78 FloatPoint( 78 FloatPoint(
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // An approximation of sqrt(2) is used here because at certain precise 134 // An approximation of sqrt(2) is used here because at certain precise
135 // miterlimits, the join style used might not be correct (e.g. a miterlimit 135 // miterlimits, the join style used might not be correct (e.g. a miterlimit
136 // of 1.4142135 should result in bevel joins, but may be drawn using miter 136 // of 1.4142135 should result in bevel joins, but may be drawn using miter
137 // joins). 137 // joins).
138 return svgStyle.strokeDashArray()->isEmpty() 138 return svgStyle.strokeDashArray()->isEmpty()
139 && svgStyle.joinStyle() == MiterJoin 139 && svgStyle.joinStyle() == MiterJoin
140 && svgStyle.strokeMiterLimit() >= 1.5; 140 && svgStyle.strokeMiterLimit() >= 1.5;
141 } 141 }
142 142
143 } 143 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698