OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 19 matching lines...) Expand all Loading... | |
30 #include "core/svg/SVGSVGElement.h" | 30 #include "core/svg/SVGSVGElement.h" |
31 #include "core/svg/SVGViewSpec.h" | 31 #include "core/svg/SVGViewSpec.h" |
32 #include "core/svg/SVGZoomAndPan.h" | 32 #include "core/svg/SVGZoomAndPan.h" |
33 #include "core/svg/SVGZoomEvent.h" | 33 #include "core/svg/SVGZoomEvent.h" |
34 | 34 |
35 namespace WebCore { | 35 namespace WebCore { |
36 | 36 |
37 SVGDocument::SVGDocument(const DocumentInit& initializer) | 37 SVGDocument::SVGDocument(const DocumentInit& initializer) |
38 : XMLDocument(initializer, XMLDocumentClass | SVGDocumentClass) | 38 : XMLDocument(initializer, XMLDocumentClass | SVGDocumentClass) |
39 { | 39 { |
40 ScriptWrappable::init(this); | |
41 } | 40 } |
42 | 41 |
43 SVGSVGElement* SVGDocument::rootElement() const | 42 SVGSVGElement* SVGDocument::rootElement(const Document* document) |
44 { | 43 { |
45 Element* elem = documentElement(); | 44 Element* elem = document->documentElement(); |
Inactive
2014/01/24 00:23:47
do we need an isSVGDocument() check or will this d
| |
46 if (elem && elem->hasTagName(SVGNames::svgTag)) | 45 if (elem && elem->hasTagName(SVGNames::svgTag)) |
47 return toSVGSVGElement(elem); | 46 return toSVGSVGElement(elem); |
48 | 47 |
49 return 0; | 48 return 0; |
50 } | 49 } |
51 | 50 |
51 SVGSVGElement* SVGDocument::rootElement() const | |
52 { | |
53 return rootElement(this); | |
54 } | |
55 | |
52 void SVGDocument::dispatchZoomEvent(float prevScale, float newScale) | 56 void SVGDocument::dispatchZoomEvent(float prevScale, float newScale) |
53 { | 57 { |
54 RefPtr<SVGZoomEvent> event = SVGZoomEvent::create(); | 58 RefPtr<SVGZoomEvent> event = SVGZoomEvent::create(); |
55 event->initEvent(EventTypeNames::zoom, true, false); | 59 event->initEvent(EventTypeNames::zoom, true, false); |
56 event->setPreviousScale(prevScale); | 60 event->setPreviousScale(prevScale); |
57 event->setNewScale(newScale); | 61 event->setNewScale(newScale); |
58 rootElement()->dispatchEvent(event.release(), IGNORE_EXCEPTION); | 62 rootElement()->dispatchEvent(event.release(), IGNORE_EXCEPTION); |
59 } | 63 } |
60 | 64 |
61 void SVGDocument::dispatchScrollEvent() | 65 void SVGDocument::dispatchScrollEvent() |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 return toSVGSVGElement(&child)->isValid(); | 104 return toSVGSVGElement(&child)->isValid(); |
101 return true; | 105 return true; |
102 } | 106 } |
103 | 107 |
104 PassRefPtr<Document> SVGDocument::cloneDocumentWithoutChildren() | 108 PassRefPtr<Document> SVGDocument::cloneDocumentWithoutChildren() |
105 { | 109 { |
106 return create(DocumentInit(url())); | 110 return create(DocumentInit(url())); |
107 } | 111 } |
108 | 112 |
109 } | 113 } |
OLD | NEW |