| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 SVGViewSpec* SVGSVGElement::currentView() | 98 SVGViewSpec* SVGSVGElement::currentView() |
| 99 { | 99 { |
| 100 if (!m_viewSpec) | 100 if (!m_viewSpec) |
| 101 m_viewSpec = SVGViewSpec::create(this); | 101 m_viewSpec = SVGViewSpec::create(this); |
| 102 return m_viewSpec.get(); | 102 return m_viewSpec.get(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 float SVGSVGElement::currentScale() const | 105 float SVGSVGElement::currentScale() const |
| 106 { | 106 { |
| 107 if (!inShadowIncludingDocument() || !isOutermostSVGSVGElement()) | 107 if (!isConnected() || !isOutermostSVGSVGElement()) |
| 108 return 1; | 108 return 1; |
| 109 | 109 |
| 110 return m_currentScale; | 110 return m_currentScale; |
| 111 } | 111 } |
| 112 | 112 |
| 113 void SVGSVGElement::setCurrentScale(float scale) | 113 void SVGSVGElement::setCurrentScale(float scale) |
| 114 { | 114 { |
| 115 ASSERT(std::isfinite(scale)); | 115 ASSERT(std::isfinite(scale)); |
| 116 if (!inShadowIncludingDocument() || !isOutermostSVGSVGElement()) | 116 if (!isConnected() || !isOutermostSVGSVGElement()) |
| 117 return; | 117 return; |
| 118 | 118 |
| 119 m_currentScale = scale; | 119 m_currentScale = scale; |
| 120 updateUserTransform(); | 120 updateUserTransform(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 class SVGCurrentTranslateTearOff : public SVGPointTearOff { | 123 class SVGCurrentTranslateTearOff : public SVGPointTearOff { |
| 124 public: | 124 public: |
| 125 static SVGCurrentTranslateTearOff* create(SVGSVGElement* contextElement) | 125 static SVGCurrentTranslateTearOff* create(SVGSVGElement* contextElement) |
| 126 { | 126 { |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 LayoutObject* SVGSVGElement::createLayoutObject(const ComputedStyle&) | 493 LayoutObject* SVGSVGElement::createLayoutObject(const ComputedStyle&) |
| 494 { | 494 { |
| 495 if (isOutermostSVGSVGElement()) | 495 if (isOutermostSVGSVGElement()) |
| 496 return new LayoutSVGRoot(this); | 496 return new LayoutSVGRoot(this); |
| 497 | 497 |
| 498 return new LayoutSVGViewportContainer(this); | 498 return new LayoutSVGViewportContainer(this); |
| 499 } | 499 } |
| 500 | 500 |
| 501 Node::InsertionNotificationRequest SVGSVGElement::insertedInto(ContainerNode* ro
otParent) | 501 Node::InsertionNotificationRequest SVGSVGElement::insertedInto(ContainerNode* ro
otParent) |
| 502 { | 502 { |
| 503 if (rootParent->inShadowIncludingDocument()) { | 503 if (rootParent->isConnected()) { |
| 504 UseCounter::count(document(), UseCounter::SVGSVGElementInDocument); | 504 UseCounter::count(document(), UseCounter::SVGSVGElementInDocument); |
| 505 if (rootParent->document().isXMLDocument()) | 505 if (rootParent->document().isXMLDocument()) |
| 506 UseCounter::count(document(), UseCounter::SVGSVGElementInXMLDocument
); | 506 UseCounter::count(document(), UseCounter::SVGSVGElementInXMLDocument
); |
| 507 | 507 |
| 508 if (RuntimeEnabledFeatures::smilEnabled()) { | 508 if (RuntimeEnabledFeatures::smilEnabled()) { |
| 509 document().accessSVGExtensions().addTimeContainer(this); | 509 document().accessSVGExtensions().addTimeContainer(this); |
| 510 | 510 |
| 511 // Animations are started at the end of document parsing and after f
iring the load event, | 511 // Animations are started at the end of document parsing and after f
iring the load event, |
| 512 // but if we miss that train (deferred programmatic element insertio
n for example) we need | 512 // but if we miss that train (deferred programmatic element insertio
n for example) we need |
| 513 // to initialize the time container here. | 513 // to initialize the time container here. |
| 514 if (!document().parsing() && !document().processingLoadEvent() && do
cument().loadEventFinished() && !timeContainer()->isStarted()) | 514 if (!document().parsing() && !document().processingLoadEvent() && do
cument().loadEventFinished() && !timeContainer()->isStarted()) |
| 515 timeContainer()->begin(); | 515 timeContainer()->begin(); |
| 516 } | 516 } |
| 517 } | 517 } |
| 518 return SVGGraphicsElement::insertedInto(rootParent); | 518 return SVGGraphicsElement::insertedInto(rootParent); |
| 519 } | 519 } |
| 520 | 520 |
| 521 void SVGSVGElement::removedFrom(ContainerNode* rootParent) | 521 void SVGSVGElement::removedFrom(ContainerNode* rootParent) |
| 522 { | 522 { |
| 523 if (rootParent->inShadowIncludingDocument()) { | 523 if (rootParent->isConnected()) { |
| 524 SVGDocumentExtensions& svgExtensions = document().accessSVGExtensions(); | 524 SVGDocumentExtensions& svgExtensions = document().accessSVGExtensions(); |
| 525 svgExtensions.removeTimeContainer(this); | 525 svgExtensions.removeTimeContainer(this); |
| 526 svgExtensions.removeSVGRootWithRelativeLengthDescendents(this); | 526 svgExtensions.removeSVGRootWithRelativeLengthDescendents(this); |
| 527 } | 527 } |
| 528 | 528 |
| 529 SVGGraphicsElement::removedFrom(rootParent); | 529 SVGGraphicsElement::removedFrom(rootParent); |
| 530 } | 530 } |
| 531 | 531 |
| 532 void SVGSVGElement::pauseAnimations() | 532 void SVGSVGElement::pauseAnimations() |
| 533 { | 533 { |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 visitor->trace(m_width); | 736 visitor->trace(m_width); |
| 737 visitor->trace(m_height); | 737 visitor->trace(m_height); |
| 738 visitor->trace(m_translation); | 738 visitor->trace(m_translation); |
| 739 visitor->trace(m_timeContainer); | 739 visitor->trace(m_timeContainer); |
| 740 visitor->trace(m_viewSpec); | 740 visitor->trace(m_viewSpec); |
| 741 SVGGraphicsElement::trace(visitor); | 741 SVGGraphicsElement::trace(visitor); |
| 742 SVGFitToViewBox::trace(visitor); | 742 SVGFitToViewBox::trace(visitor); |
| 743 } | 743 } |
| 744 | 744 |
| 745 } // namespace blink | 745 } // namespace blink |
| OLD | NEW |