Changeset 125147 in webkit
- Timestamp:
- Aug 8, 2012 9:16:38 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r125140 r125147 1 2012-08-08 MORITA Hajime <morrita@google.com> 2 3 [SVG] load events shouldn't be fired during Node::insrtedInto() 4 https://bugs.webkit.org/show_bug.cgi?id=92969 5 6 Reviewed by Ryosuke Niwa. 7 8 * svg/custom/loadevents-async-expected.txt: Added. 9 * svg/custom/loadevents-async.html: Added. 10 1 11 2012-08-08 Tony Chang <tony@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r125146 r125147 1 2012-08-08 MORITA Hajime <morrita@google.com> 2 3 [SVG] load events shouldn't be fired during Node::insrtedInto() 4 https://bugs.webkit.org/show_bug.cgi?id=92969 5 6 Reviewed by Ryosuke Niwa. 7 8 Event dispatches during insertedInto() allow event handlers to 9 break DOM tree cosistency. This chagne makes them async for load 10 events which are dispatched during insertedInto() call. This 11 prevents event handlers from breaking tree consistency while the 12 notification traversal. 13 14 Test: svg/custom/loadevents-async.html 15 16 * svg/SVGElement.cpp: 17 (WebCore::SVGElement::sendSVGLoadEventIfPossibleAsynchronously): Added. 18 (WebCore): 19 (WebCore::SVGElement::svgLoadEventTimerFired): Added. 20 (WebCore::SVGElement::svgLoadEventTimer): 21 - Added a stub. Implemented in SVGScriptElement, SVGStopElement, SVGUseElement 22 where the load event happens. 23 * svg/SVGElement.h: 24 (SVGElement): 25 * svg/SVGExternalResourcesRequired.cpp: 26 (WebCore::SVGExternalResourcesRequired::insertedIntoDocument): 27 - Replaces event dispatch call with async version. 28 * svg/SVGScriptElement.h: 29 * svg/SVGStyleElement.h: 30 * svg/SVGUseElement.h: 31 1 32 2012-08-08 Adam Barth <abarth@webkit.org> 2 33 -
trunk/Source/WebCore/svg/SVGElement.cpp
r122449 r125147 476 476 break; 477 477 } 478 } 479 480 void SVGElement::sendSVGLoadEventIfPossibleAsynchronously() 481 { 482 svgLoadEventTimer()->startOneShot(0); 483 } 484 485 void SVGElement::svgLoadEventTimerFired(Timer<SVGElement>*) 486 { 487 sendSVGLoadEventIfPossible(); 488 } 489 490 Timer<SVGElement>* SVGElement::svgLoadEventTimer() 491 { 492 ASSERT_NOT_REACHED(); 493 return 0; 478 494 } 479 495 -
trunk/Source/WebCore/svg/SVGElement.h
r121330 r125147 28 28 #include "SVGPropertyInfo.h" 29 29 #include "StyledElement.h" 30 #include "Timer.h" 30 31 #include <wtf/HashMap.h> 31 32 … … 73 74 74 75 void sendSVGLoadEventIfPossible(bool sendParentLoadEvents = false); 76 void sendSVGLoadEventIfPossibleAsynchronously(); 77 void svgLoadEventTimerFired(Timer<SVGElement>*); 78 virtual Timer<SVGElement>* svgLoadEventTimer(); 75 79 76 80 virtual AffineTransform* supplementalTransform() { return 0; } -
trunk/Source/WebCore/svg/SVGExternalResourcesRequired.cpp
r117195 r125147 104 104 return; 105 105 setHaveFiredLoadEvent(true); 106 targetElement->sendSVGLoadEventIfPossible ();106 targetElement->sendSVGLoadEventIfPossibleAsynchronously(); 107 107 } 108 108 -
trunk/Source/WebCore/svg/SVGScriptElement.cpp
r118963 r125147 48 48 : SVGElement(tagName, document) 49 49 , ScriptElement(this, wasInsertedByParser, alreadyStarted) 50 , m_svgLoadEventTimer(this, &SVGElement::svgLoadEventTimerFired) 50 51 { 51 52 ASSERT(hasTagName(SVGNames::scriptTag)); -
trunk/Source/WebCore/svg/SVGScriptElement.h
r118963 r125147 76 76 virtual bool isParserInserted() const { return ScriptElement::isParserInserted(); } 77 77 virtual bool haveFiredLoadEvent() const { return ScriptElement::haveFiredLoadEvent(); } 78 virtual Timer<SVGElement>* svgLoadEventTimer() OVERRIDE { return &m_svgLoadEventTimer; } 78 79 79 80 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGScriptElement) … … 83 84 84 85 String m_type; 86 Timer<SVGElement> m_svgLoadEventTimer; 85 87 }; 86 88 -
trunk/Source/WebCore/svg/SVGStyleElement.cpp
r118192 r125147 38 38 : SVGElement(tagName, document) 39 39 , StyleElement(document, createdByParser) 40 , m_svgLoadEventTimer(this, &SVGElement::svgLoadEventTimerFired) 40 41 { 41 42 ASSERT(hasTagName(SVGNames::styleTag)); -
trunk/Source/WebCore/svg/SVGStyleElement.h
r118192 r125147 64 64 virtual bool sheetLoaded() { return StyleElement::sheetLoaded(document()); } 65 65 virtual void startLoadingDynamicSheet() { StyleElement::startLoadingDynamicSheet(document()); } 66 virtual Timer<SVGElement>* svgLoadEventTimer() OVERRIDE { return &m_svgLoadEventTimer; } 67 68 Timer<SVGElement> m_svgLoadEventTimer; 66 69 }; 67 70 -
trunk/Source/WebCore/svg/SVGUseElement.cpp
r122449 r125147 90 90 , m_haveFiredLoadEvent(false) 91 91 , m_needsShadowTreeRecreation(false) 92 , m_svgLoadEventTimer(this, &SVGElement::svgLoadEventTimerFired) 92 93 { 93 94 ASSERT(hasCustomCallbacks()); -
trunk/Source/WebCore/svg/SVGUseElement.h
r122449 r125147 125 125 virtual bool isParserInserted() const { return m_wasInsertedByParser; } 126 126 virtual bool haveFiredLoadEvent() const { return m_haveFiredLoadEvent; } 127 virtual Timer<SVGElement>* svgLoadEventTimer() OVERRIDE { return &m_svgLoadEventTimer; } 127 128 128 129 bool m_wasInsertedByParser; … … 131 132 RefPtr<SVGElementInstance> m_targetElementInstance; 132 133 CachedResourceHandle<CachedSVGDocument> m_cachedDocument; 134 Timer<SVGElement> m_svgLoadEventTimer; 133 135 }; 134 136
Note: See TracChangeset
for help on using the changeset viewer.