Changeset 214322 in webkit
- Timestamp:
- Mar 23, 2017, 3:40:50 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r214321 r214322 1 2017-03-23 Chris Dumez <cdumez@apple.com> 2 3 SVG animations are not paused when inserted into a hidden page 4 https://bugs.webkit.org/show_bug.cgi?id=170026 5 <rdar://problem/31228704> 6 7 Reviewed by Andreas Kling. 8 9 Add layout test coverage. 10 11 * svg/animations/animations-paused-when-inserted-in-hidden-document-expected.txt: Added. 12 * svg/animations/animations-paused-when-inserted-in-hidden-document.html: Added. 13 * svg/animations/animations-paused-when-inserted-in-hidden-document2-expected.txt: Added. 14 * svg/animations/animations-paused-when-inserted-in-hidden-document2.html: Added. 15 1 16 == Rolled over to ChangeLog-2017-03-23 == -
trunk/Source/WebCore/ChangeLog
r214321 r214322 1 2017-03-23 Chris Dumez <cdumez@apple.com> 2 3 SVG animations are not paused when inserted into a hidden page 4 https://bugs.webkit.org/show_bug.cgi?id=170026 5 <rdar://problem/31228704> 6 7 Reviewed by Andreas Kling. 8 9 SVG animations were not paused when inserted into a hidden page. We would pause 10 animations in a page when the page becomes hidden. However, new animations 11 inserted in the page after this point would start, despite the page being 12 hidden. 13 14 Tests: 15 - svg/animations/animations-paused-when-inserted-in-hidden-document.html 16 - svg/animations/animations-paused-when-inserted-in-hidden-document2.html 17 18 * dom/Document.cpp: 19 (WebCore::Document::accessSVGExtensions): 20 * svg/SVGDocumentExtensions.cpp: 21 (WebCore::SVGDocumentExtensions::SVGDocumentExtensions): 22 (WebCore::SVGDocumentExtensions::addTimeContainer): 23 (WebCore::reportMessage): 24 * svg/SVGDocumentExtensions.h: 25 * testing/Internals.cpp: 26 (WebCore::Internals::areSVGAnimationsPaused): 27 * testing/Internals.h: 28 * testing/Internals.idl: 29 1 30 == Rolled over to ChangeLog-2017-03-23 == -
trunk/Source/WebCore/dom/Document.cpp
r214203 r214322 4874 4874 { 4875 4875 if (!m_svgExtensions) 4876 m_svgExtensions = std::make_unique<SVGDocumentExtensions>( this);4876 m_svgExtensions = std::make_unique<SVGDocumentExtensions>(*this); 4877 4877 return *m_svgExtensions; 4878 4878 } -
trunk/Source/WebCore/svg/SVGDocumentExtensions.cpp
r211612 r214322 28 28 #include "Frame.h" 29 29 #include "FrameLoader.h" 30 #include "Page.h" 30 31 #include "SMILTimeContainer.h" 31 32 #include "SVGElement.h" … … 40 41 namespace WebCore { 41 42 42 SVGDocumentExtensions::SVGDocumentExtensions(Document *document)43 SVGDocumentExtensions::SVGDocumentExtensions(Document& document) 43 44 : m_document(document) 44 45 , m_resourcesCache(std::make_unique<SVGResourcesCache>()) 46 , m_areAnimationsPaused(!document.page() || !document.page()->isVisible()) 45 47 { 46 48 } … … 53 55 { 54 56 m_timeContainers.add(element); 57 if (m_areAnimationsPaused) 58 element->pauseAnimations(); 55 59 } 56 60 … … 125 129 } 126 130 127 static void reportMessage(Document *document, MessageLevel level, const String& message)128 { 129 if (document ->frame())130 document ->addConsoleMessage(MessageSource::Rendering, level, message);131 static void reportMessage(Document& document, MessageLevel level, const String& message) 132 { 133 if (document.frame()) 134 document.addConsoleMessage(MessageSource::Rendering, level, message); 131 135 } 132 136 -
trunk/Source/WebCore/svg/SVGDocumentExtensions.h
r211612 r214322 41 41 public: 42 42 typedef HashSet<Element*> PendingElements; 43 explicit SVGDocumentExtensions(Document *);43 explicit SVGDocumentExtensions(Document&); 44 44 ~SVGDocumentExtensions(); 45 45 … … 78 78 79 79 private: 80 Document * m_document; // weak reference80 Document& m_document; 81 81 HashSet<SVGSVGElement*> m_timeContainers; // For SVG 1.2 support this will need to be made more general. 82 82 #if ENABLE(SVG_FONTS) … … 90 90 91 91 Vector<SVGElement*> m_rebuildElements; 92 bool m_areAnimationsPaused { false }; // For testing.92 bool m_areAnimationsPaused; 93 93 94 94 public: -
trunk/Source/WebCore/testing/Internals.cpp
r214266 r214322 518 518 } 519 519 520 boolInternals::areSVGAnimationsPaused() const520 ExceptionOr<bool> Internals::areSVGAnimationsPaused() const 521 521 { 522 522 auto* document = contextDocument(); 523 523 if (!document) 524 return false;524 return Exception { INVALID_ACCESS_ERR, ASCIILiteral("No context document") }; 525 525 526 526 if (!document->svgExtensions()) 527 return false;527 return Exception { NOT_FOUND_ERR, ASCIILiteral("No SVG animations") }; 528 528 529 529 return document->accessSVGExtensions().areAnimationsPaused(); -
trunk/Source/WebCore/testing/Internals.h
r214113 r214322 267 267 InternalSettings* settings() const; 268 268 unsigned workerThreadCount() const; 269 boolareSVGAnimationsPaused() const;269 ExceptionOr<bool> areSVGAnimationsPaused() const; 270 270 ExceptionOr<double> svgAnimationsInterval(SVGSVGElement&) const; 271 271 -
trunk/Source/WebCore/testing/Internals.idl
r214113 r214322 250 250 readonly attribute unsigned long workerThreadCount; 251 251 252 readonly attribute boolean areSVGAnimationsPaused;252 [MayThrowException] readonly attribute boolean areSVGAnimationsPaused; 253 253 [MayThrowException] double svgAnimationsInterval(SVGSVGElement element); 254 254
Note:
See TracChangeset
for help on using the changeset viewer.