| 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 "config.h" | 22 #include "config.h" |
| 23 #include "core/svg/SVGDocumentExtensions.h" | 23 #include "core/svg/SVGDocumentExtensions.h" |
| 24 | 24 |
| 25 #include "core/dom/Document.h" | 25 #include "core/dom/Document.h" |
| 26 #include "core/inspector/ConsoleMessage.h" | 26 #include "core/inspector/ConsoleMessage.h" |
| 27 #include "core/layout/svg/SVGResourcesCache.h" | 27 #include "core/layout/svg/SVGResourcesCache.h" |
| 28 #include "core/svg/SVGSVGElement.h" | 28 #include "core/svg/SVGSVGElement.h" |
| 29 #include "core/svg/SVGViewSpec.h" | |
| 30 #include "core/svg/SVGZoomAndPan.h" | |
| 31 #include "core/svg/animation/SMILTimeContainer.h" | 29 #include "core/svg/animation/SMILTimeContainer.h" |
| 32 #include "wtf/TemporaryChange.h" | 30 #include "wtf/TemporaryChange.h" |
| 33 #include "wtf/text/AtomicString.h" | 31 #include "wtf/text/AtomicString.h" |
| 34 | 32 |
| 35 namespace blink { | 33 namespace blink { |
| 36 | 34 |
| 37 SVGDocumentExtensions::SVGDocumentExtensions(Document* document) | 35 SVGDocumentExtensions::SVGDocumentExtensions(Document* document) |
| 38 : m_document(document) | 36 : m_document(document) |
| 39 , m_resourcesCache(adoptPtr(new SVGResourcesCache)) | 37 , m_resourcesCache(adoptPtr(new SVGResourcesCache)) |
| 40 #if ENABLE(ASSERT) | 38 #if ENABLE(ASSERT) |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 #if ENABLE(ASSERT) | 316 #if ENABLE(ASSERT) |
| 319 TemporaryChange<bool> inRelativeLengthSVGRootsChange(m_inRelativeLengthSVGRo
otsInvalidation, true); | 317 TemporaryChange<bool> inRelativeLengthSVGRootsChange(m_inRelativeLengthSVGRo
otsInvalidation, true); |
| 320 #endif | 318 #endif |
| 321 | 319 |
| 322 for (SVGSVGElement* element : m_relativeLengthSVGRoots) | 320 for (SVGSVGElement* element : m_relativeLengthSVGRoots) |
| 323 element->invalidateRelativeLengthClients(scope); | 321 element->invalidateRelativeLengthClients(scope); |
| 324 } | 322 } |
| 325 | 323 |
| 326 bool SVGDocumentExtensions::zoomAndPanEnabled() const | 324 bool SVGDocumentExtensions::zoomAndPanEnabled() const |
| 327 { | 325 { |
| 328 if (SVGSVGElement* svg = rootElement(*m_document)) { | 326 if (SVGSVGElement* svg = rootElement(*m_document)) |
| 329 if (svg->useCurrentView()) { | 327 return svg->zoomAndPanEnabled(); |
| 330 if (svg->currentView()) | |
| 331 return svg->currentView()->zoomAndPan() == SVGZoomAndPanMagnify; | |
| 332 } else { | |
| 333 return svg->zoomAndPan() == SVGZoomAndPanMagnify; | |
| 334 } | |
| 335 } | |
| 336 | |
| 337 return false; | 328 return false; |
| 338 } | 329 } |
| 339 | 330 |
| 340 void SVGDocumentExtensions::startPan(const FloatPoint& start) | 331 void SVGDocumentExtensions::startPan(const FloatPoint& start) |
| 341 { | 332 { |
| 342 if (SVGSVGElement* svg = rootElement(*m_document)) | 333 if (SVGSVGElement* svg = rootElement(*m_document)) |
| 343 m_translate = FloatPoint(start.x() - svg->currentTranslate().x(), start.
y() - svg->currentTranslate().y()); | 334 m_translate = FloatPoint(start.x() - svg->currentTranslate().x(), start.
y() - svg->currentTranslate().y()); |
| 344 } | 335 } |
| 345 | 336 |
| 346 void SVGDocumentExtensions::updatePan(const FloatPoint& pos) const | 337 void SVGDocumentExtensions::updatePan(const FloatPoint& pos) const |
| (...skipping 19 matching lines...) Expand all Loading... |
| 366 #if ENABLE(OILPAN) | 357 #if ENABLE(OILPAN) |
| 367 visitor->trace(m_document); | 358 visitor->trace(m_document); |
| 368 visitor->trace(m_timeContainers); | 359 visitor->trace(m_timeContainers); |
| 369 visitor->trace(m_relativeLengthSVGRoots); | 360 visitor->trace(m_relativeLengthSVGRoots); |
| 370 visitor->trace(m_pendingResources); | 361 visitor->trace(m_pendingResources); |
| 371 visitor->trace(m_pendingResourcesForRemoval); | 362 visitor->trace(m_pendingResourcesForRemoval); |
| 372 #endif | 363 #endif |
| 373 } | 364 } |
| 374 | 365 |
| 375 } | 366 } |
| OLD | NEW |