Commit 6b5a2b11 authored by hayato@chromium.org's avatar hayato@chromium.org

Support SVG in event.path.

The SVG instance tree was recently removed which also removed most of the gnarly event handling in SVG. Now we can support SVG also in event.path.

BUG=402721

Review URL: https://codereview.chromium.org/477883003

git-svn-id: svn://svn.chromium.org/blink/trunk@180364 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent fafe7f85
#circle, [object SVGSVGElement], [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], length: 5
#circle, [object SVGSVGElement], [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], length: 5
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<script src="resources/shadow-dom.js"></script>
<pre id="console"></pre>
<svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg" width="100%">
<circle id="circle" cx="128" cy="128" r="128"/>
</svg>
<script>
function handler(evnet) {
debug(dumpNodeList(event.path));
}
circle.addEventListener('click', handler);
document.addEventListener('click', handler);
circle.dispatchEvent(new MouseEvent('click', {bubbles: true}));
</script>
......@@ -237,9 +237,6 @@ PassRefPtrWillBeRawPtr<StaticNodeList> Event::path() const
if (!m_currentTarget->toNode())
return StaticNodeList::createEmpty();
Node* node = m_currentTarget->toNode();
// FIXME: Support SVG Elements.
if (node->isSVGElement())
return StaticNodeList::createEmpty();
size_t eventPathSize = m_eventPath->size();
for (size_t i = 0; i < eventPathSize; ++i) {
if (node == (*m_eventPath)[i].node()) {
......
......@@ -28,18 +28,13 @@
#include "core/events/EventPath.h"
#include "core/EventNames.h"
#include "core/SVGNames.h"
#include "core/dom/FullscreenElementStack.h"
#include "core/dom/Document.h"
#include "core/dom/Touch.h"
#include "core/dom/TouchList.h"
#include "core/dom/shadow/InsertionPoint.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/events/FocusEvent.h"
#include "core/events/MouseEvent.h"
#include "core/events/TouchEvent.h"
#include "core/events/TouchEventContext.h"
#include "core/svg/SVGUseElement.h"
#include "platform/RuntimeEnabledFeatures.h"
namespace blink {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment