OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2007 Apple Inc. All rights reserved. |
5 * Copyright (C) 2014 Google, Inc. | 5 * Copyright (C) 2014 Google, Inc. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #include "platform/LengthFunctions.h" | 59 #include "platform/LengthFunctions.h" |
60 #include "platform/geometry/FloatRect.h" | 60 #include "platform/geometry/FloatRect.h" |
61 #include "platform/transforms/AffineTransform.h" | 61 #include "platform/transforms/AffineTransform.h" |
62 #include "wtf/StdLibExtras.h" | 62 #include "wtf/StdLibExtras.h" |
63 | 63 |
64 namespace WebCore { | 64 namespace WebCore { |
65 | 65 |
66 inline SVGSVGElement::SVGSVGElement(Document& doc) | 66 inline SVGSVGElement::SVGSVGElement(Document& doc) |
67 : SVGGraphicsElement(SVGNames::svgTag, doc) | 67 : SVGGraphicsElement(SVGNames::svgTag, doc) |
68 , SVGFitToViewBox(this) | 68 , SVGFitToViewBox(this) |
69 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth))) | 69 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth), AllowNegativeLengths)) |
70 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight))) | 70 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight), AllowNegativeLengths)) |
71 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth))) | 71 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth), ForbidNegativeLengths)) |
72 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight))) | 72 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) |
73 , m_useCurrentView(false) | 73 , m_useCurrentView(false) |
74 , m_timeContainer(SMILTimeContainer::create(*this)) | 74 , m_timeContainer(SMILTimeContainer::create(*this)) |
75 , m_translation(SVGPoint::create()) | 75 , m_translation(SVGPoint::create()) |
76 { | 76 { |
77 ScriptWrappable::init(this); | 77 ScriptWrappable::init(this); |
78 | 78 |
79 m_width->setDefaultValueAsString("100%"); | 79 m_width->setDefaultValueAsString("100%"); |
80 m_height->setDefaultValueAsString("100%"); | 80 m_height->setDefaultValueAsString("100%"); |
81 | 81 |
82 addToPropertyMap(m_x); | 82 addToPropertyMap(m_x); |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 | 260 |
261 if (setListener) | 261 if (setListener) |
262 return; | 262 return; |
263 } | 263 } |
264 | 264 |
265 if (name == HTMLNames::onabortAttr) { | 265 if (name == HTMLNames::onabortAttr) { |
266 document().setWindowAttributeEventListener(EventTypeNames::abort, create
AttributeEventListener(document().frame(), name, value)); | 266 document().setWindowAttributeEventListener(EventTypeNames::abort, create
AttributeEventListener(document().frame(), name, value)); |
267 } else if (name == HTMLNames::onerrorAttr) { | 267 } else if (name == HTMLNames::onerrorAttr) { |
268 document().setWindowAttributeEventListener(EventTypeNames::error, create
AttributeEventListener(document().frame(), name, value)); | 268 document().setWindowAttributeEventListener(EventTypeNames::error, create
AttributeEventListener(document().frame(), name, value)); |
269 } else if (name == SVGNames::xAttr) { | 269 } else if (name == SVGNames::xAttr) { |
270 m_x->setBaseValueAsString(value, AllowNegativeLengths, parseError); | 270 m_x->setBaseValueAsString(value, parseError); |
271 } else if (name == SVGNames::yAttr) { | 271 } else if (name == SVGNames::yAttr) { |
272 m_y->setBaseValueAsString(value, AllowNegativeLengths, parseError); | 272 m_y->setBaseValueAsString(value, parseError); |
273 } else if (name == SVGNames::widthAttr) { | 273 } else if (name == SVGNames::widthAttr) { |
274 m_width->setBaseValueAsString(value, ForbidNegativeLengths, parseError); | 274 m_width->setBaseValueAsString(value, parseError); |
275 } else if (name == SVGNames::heightAttr) { | 275 } else if (name == SVGNames::heightAttr) { |
276 m_height->setBaseValueAsString(value, ForbidNegativeLengths, parseError)
; | 276 m_height->setBaseValueAsString(value, parseError); |
277 } else if (SVGFitToViewBox::parseAttribute(name, value, document(), parseErr
or)) { | 277 } else if (SVGFitToViewBox::parseAttribute(name, value, document(), parseErr
or)) { |
278 } else if (SVGZoomAndPan::parseAttribute(name, value)) { | 278 } else if (SVGZoomAndPan::parseAttribute(name, value)) { |
279 } else { | 279 } else { |
280 SVGGraphicsElement::parseAttribute(name, value); | 280 SVGGraphicsElement::parseAttribute(name, value); |
281 } | 281 } |
282 | 282 |
283 reportAttributeParsingError(parseError, name, value); | 283 reportAttributeParsingError(parseError, name, value); |
284 } | 284 } |
285 | 285 |
286 void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName) | 286 void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName) |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 // Fall back to traversing our subtree. Duplicate ids are allowed, the first
found will | 825 // Fall back to traversing our subtree. Duplicate ids are allowed, the first
found will |
826 // be returned. | 826 // be returned. |
827 for (Element* element = ElementTraversal::firstWithin(*this); element; eleme
nt = ElementTraversal::next(*element, this)) { | 827 for (Element* element = ElementTraversal::firstWithin(*this); element; eleme
nt = ElementTraversal::next(*element, this)) { |
828 if (element->getIdAttribute() == id) | 828 if (element->getIdAttribute() == id) |
829 return element; | 829 return element; |
830 } | 830 } |
831 return 0; | 831 return 0; |
832 } | 832 } |
833 | 833 |
834 } | 834 } |
OLD | NEW |