Changeset 247826 in webkit
- Timestamp:
- Jul 25, 2019 10:56:45 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r247825 r247826 1 2019-07-25 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 REGRESSION (r244995): Assertion failure when addEventListener to an SVGElement which has an. instance in shadow tree 4 https://bugs.webkit.org/show_bug.cgi?id=200083 5 6 Reviewed by Ryosuke Niwa. 7 8 * svg/custom/add-event-listener-shadow-tree-element-expected.txt: Added. 9 * svg/custom/add-event-listener-shadow-tree-element.html: Added. 10 1 11 2019-07-25 Truitt Savell <tsavell@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r247825 r247826 1 2019-07-25 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 REGRESSION (r244995): Assertion failure when addEventListener to an SVGElement which has an. instance in shadow tree 4 https://bugs.webkit.org/show_bug.cgi?id=200083 5 6 Reviewed by Ryosuke Niwa. 7 8 When adding an event listener to an SVGElement, the same event listener 9 has to be add to all the instances of SVGElement in the shadow tree. See 10 SVGElement::addEventListener(). 11 12 In r244995, an assertion was added to ensure if the event listener is 13 attached to an event target, the new event target has be the same as the 14 attached one. This assertion isn't correct for the event targets which 15 were copied from the targetElement sub tree of an SVGUseElement to the 16 shadow tree. 17 18 Test: svg/custom/add-event-listener-shadow-tree-element.html 19 20 * bindings/js/JSLazyEventListener.cpp: 21 (WebCore::isCloneInShadowTreeOfSVGUseElement): 22 (WebCore::JSLazyEventListener::checkValidityForEventTarget): 23 1 24 2019-07-25 Truitt Savell <tsavell@apple.com> 2 25 -
trunk/Source/WebCore/bindings/js/JSLazyEventListener.cpp
r246490 r247826 27 27 #include "JSNode.h" 28 28 #include "QualifiedName.h" 29 #include "SVGElement.h" 29 30 #include "ScriptController.h" 30 31 #include <JavaScriptCore/CatchScope.h> … … 81 82 82 83 #if !ASSERT_DISABLED 84 static inline bool isCloneInShadowTreeOfSVGUseElement(Node& originalNode, EventTarget& eventTarget) 85 { 86 if (!eventTarget.isNode()) 87 return false; 88 89 auto& node = downcast<Node>(eventTarget); 90 if (!is<SVGElement>(node)) 91 return false; 92 93 auto& element = downcast<SVGElement>(node); 94 if (!element.correspondingElement()) 95 return false; 96 97 ASSERT(element.isInShadowTree()); 98 return &originalNode == element.correspondingElement(); 99 } 100 83 101 // This is to help find the underlying cause of <rdar://problem/24314027>. 84 102 void JSLazyEventListener::checkValidityForEventTarget(EventTarget& eventTarget) … … 86 104 if (eventTarget.isNode()) { 87 105 ASSERT(m_originalNode); 88 ASSERT(static_cast<EventTarget*>(m_originalNode.get()) == &eventTarget );106 ASSERT(static_cast<EventTarget*>(m_originalNode.get()) == &eventTarget || isCloneInShadowTreeOfSVGUseElement(*m_originalNode, eventTarget)); 89 107 } else 90 108 ASSERT(!m_originalNode);
Note: See TracChangeset
for help on using the changeset viewer.