OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Inc. All rights reserved. |
3 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> |
4 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 4 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
15 * | 15 * |
16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
20 */ | 20 */ |
21 | 21 |
22 #include "core/svg/SVGDocumentExtensions.h" | 22 #include "core/svg/SVGDocumentExtensions.h" |
23 | 23 |
24 #include "core/dom/Document.h" | 24 #include "core/dom/Document.h" |
25 #include "core/inspector/ConsoleMessage.h" | |
26 #include "core/svg/SVGSVGElement.h" | 25 #include "core/svg/SVGSVGElement.h" |
27 #include "core/svg/animation/SMILTimeContainer.h" | 26 #include "core/svg/animation/SMILTimeContainer.h" |
28 #include "wtf/AutoReset.h" | 27 #include "wtf/AutoReset.h" |
29 | 28 |
30 namespace blink { | 29 namespace blink { |
31 | 30 |
32 SVGDocumentExtensions::SVGDocumentExtensions(Document* document) | 31 SVGDocumentExtensions::SVGDocumentExtensions(Document* document) |
33 : m_document(document) | 32 : m_document(document) |
34 { | 33 { |
35 } | 34 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 continue; | 105 continue; |
107 | 106 |
108 // Don't dispatch the load event document is not wellformed (for | 107 // Don't dispatch the load event document is not wellformed (for |
109 // XML/standalone svg). | 108 // XML/standalone svg). |
110 if (outerSVG->document().wellFormed() || | 109 if (outerSVG->document().wellFormed() || |
111 !outerSVG->document().isSVGDocument()) | 110 !outerSVG->document().isSVGDocument()) |
112 outerSVG->sendSVGLoadEventIfPossible(); | 111 outerSVG->sendSVGLoadEventIfPossible(); |
113 } | 112 } |
114 } | 113 } |
115 | 114 |
116 void SVGDocumentExtensions::reportError(const String& message) { | |
117 ConsoleMessage* consoleMessage = ConsoleMessage::create( | |
118 RenderingMessageSource, ErrorMessageLevel, "Error: " + message); | |
119 m_document->addConsoleMessage(consoleMessage); | |
120 } | |
121 | |
122 void SVGDocumentExtensions::addSVGRootWithRelativeLengthDescendents( | 115 void SVGDocumentExtensions::addSVGRootWithRelativeLengthDescendents( |
123 SVGSVGElement* svgRoot) { | 116 SVGSVGElement* svgRoot) { |
124 ASSERT(!m_inRelativeLengthSVGRootsInvalidation); | 117 ASSERT(!m_inRelativeLengthSVGRootsInvalidation); |
125 m_relativeLengthSVGRoots.insert(svgRoot); | 118 m_relativeLengthSVGRoots.insert(svgRoot); |
126 } | 119 } |
127 | 120 |
128 void SVGDocumentExtensions::removeSVGRootWithRelativeLengthDescendents( | 121 void SVGDocumentExtensions::removeSVGRootWithRelativeLengthDescendents( |
129 SVGSVGElement* svgRoot) { | 122 SVGSVGElement* svgRoot) { |
130 ASSERT(!m_inRelativeLengthSVGRootsInvalidation); | 123 ASSERT(!m_inRelativeLengthSVGRootsInvalidation); |
131 m_relativeLengthSVGRoots.erase(svgRoot); | 124 m_relativeLengthSVGRoots.erase(svgRoot); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 } | 170 } |
178 | 171 |
179 DEFINE_TRACE(SVGDocumentExtensions) { | 172 DEFINE_TRACE(SVGDocumentExtensions) { |
180 visitor->trace(m_document); | 173 visitor->trace(m_document); |
181 visitor->trace(m_timeContainers); | 174 visitor->trace(m_timeContainers); |
182 visitor->trace(m_webAnimationsPendingSVGElements); | 175 visitor->trace(m_webAnimationsPendingSVGElements); |
183 visitor->trace(m_relativeLengthSVGRoots); | 176 visitor->trace(m_relativeLengthSVGRoots); |
184 } | 177 } |
185 | 178 |
186 } // namespace blink | 179 } // namespace blink |
OLD | NEW |