OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 SVGLengthContext lengthContext(element); | 118 SVGLengthContext lengthContext(element); |
119 float width = rect->width().value(lengthContext); | 119 float width = rect->width().value(lengthContext); |
120 if (width <= 0) | 120 if (width <= 0) |
121 return; | 121 return; |
122 float height = rect->height().value(lengthContext); | 122 float height = rect->height().value(lengthContext); |
123 if (height <= 0) | 123 if (height <= 0) |
124 return; | 124 return; |
125 float x = rect->x().value(lengthContext); | 125 float x = rect->x().value(lengthContext); |
126 float y = rect->y().value(lengthContext); | 126 float y = rect->y().value(lengthContext); |
127 bool hasRx = rect->hasAttribute(SVGNames::rxAttr); | 127 bool hasRx = rect->rx().value(lengthContext) > 0; |
128 bool hasRy = rect->hasAttribute(SVGNames::ryAttr); | 128 bool hasRy = rect->ry().value(lengthContext) > 0; |
129 if (hasRx || hasRy) { | 129 if (hasRx || hasRy) { |
130 float rx = rect->rx().value(lengthContext); | 130 float rx = rect->rx().value(lengthContext); |
131 float ry = rect->ry().value(lengthContext); | 131 float ry = rect->ry().value(lengthContext); |
132 if (!hasRx) | 132 if (!hasRx) |
133 rx = ry; | 133 rx = ry; |
134 else if (!hasRy) | 134 else if (!hasRy) |
135 ry = rx; | 135 ry = rx; |
136 // FIXME: We currently enforce using beziers here, as at least on CoreGr
aphics/Lion, as | 136 // FIXME: We currently enforce using beziers here, as at least on CoreGr
aphics/Lion, as |
137 // the native method uses a different line dash origin, causing svg/cust
om/dashOrigin.svg to fail. | 137 // the native method uses a different line dash origin, causing svg/cust
om/dashOrigin.svg to fail. |
138 // See bug https://bugs.webkit.org/show_bug.cgi?id=79932 which tracks th
is issue. | 138 // See bug https://bugs.webkit.org/show_bug.cgi?id=79932 which tracks th
is issue. |
(...skipping 20 matching lines...) Expand all Loading... |
159 map->set(SVGNames::polygonTag.localName().impl(), updatePathFromPolygonE
lement); | 159 map->set(SVGNames::polygonTag.localName().impl(), updatePathFromPolygonE
lement); |
160 map->set(SVGNames::polylineTag.localName().impl(), updatePathFromPolylin
eElement); | 160 map->set(SVGNames::polylineTag.localName().impl(), updatePathFromPolylin
eElement); |
161 map->set(SVGNames::rectTag.localName().impl(), updatePathFromRectElement
); | 161 map->set(SVGNames::rectTag.localName().impl(), updatePathFromRectElement
); |
162 } | 162 } |
163 | 163 |
164 if (PathUpdateFunction pathUpdateFunction = map->get(element->localName().im
pl())) | 164 if (PathUpdateFunction pathUpdateFunction = map->get(element->localName().im
pl())) |
165 (*pathUpdateFunction)(element, path); | 165 (*pathUpdateFunction)(element, path); |
166 } | 166 } |
167 | 167 |
168 } // namespace WebCore | 168 } // namespace WebCore |
OLD | NEW |