Changeset 70985 in webkit


Ignore:
Timestamp:
Oct 30, 2010 11:48:23 AM (13 years ago)
Author:
Dimitri Glazkov
Message:

2010-10-30 Dimitri Glazkov <Dimitri Glazkov>

Unreviewed, rolling out r70984.
http://trac.webkit.org/changeset/70984
https://bugs.webkit.org/show_bug.cgi?id=46015

Made media/audio-delete-while-slider-thumb-clicked.html crash.

  • fast/events/shadow-boundary-crossing.html:

2010-10-30 Dimitri Glazkov <Dimitri Glazkov>

Unreviewed, rolling out r70984.
http://trac.webkit.org/changeset/70984
https://bugs.webkit.org/show_bug.cgi?id=46015

Made media/audio-delete-while-slider-thumb-clicked.html crash.

  • Android.mk:
  • CMakeLists.txt:
  • GNUmakefile.am:
  • WebCore.gypi:
  • WebCore.pro:
  • WebCore.xcodeproj/project.pbxproj:
  • dom/ContainerNode.cpp: (WebCore::notifyChildInserted):
  • dom/EventContext.cpp: Removed.
  • dom/EventContext.h: Removed.
  • dom/Node.cpp: (WebCore::Node::markAncestorsWithChildNeedsStyleRecalc): (WebCore::Node::createRendererIfNeeded): (WebCore::Node::eventParentNode): (WebCore::Node::enclosingLinkEventParentOrSelf): (WebCore::eventTargetAsSVGElementInstance): (WebCore::eventTargetRespectingSVGTargetRules): (WebCore::Node::eventAncestors): (WebCore::Node::dispatchGenericEvent):
  • dom/Node.h:
  • dom/Text.cpp: (WebCore::Text::createRenderer):
  • dom/WindowEventContext.cpp: Removed.
  • dom/WindowEventContext.h: Removed.
  • inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::getEventListenersForNode):
  • inspector/InspectorInstrumentation.cpp: (WebCore::eventHasListeners): (WebCore::InspectorInstrumentation::willDispatchEventImpl):
  • inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::willDispatchEvent):
  • page/EventHandler.cpp: (WebCore::EventHandler::updateMouseEventTargetNode):
  • svg/SVGElement.cpp: (WebCore::SVGElement::eventParentNode):
  • svg/SVGElement.h:
Location:
trunk
Files:
4 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r70984 r70985  
     12010-10-30  Dimitri Glazkov  <dglazkov@chromium.org>
     2
     3        Unreviewed, rolling out r70984.
     4        http://trac.webkit.org/changeset/70984
     5        https://bugs.webkit.org/show_bug.cgi?id=46015
     6
     7        Made media/audio-delete-while-slider-thumb-clicked.html crash.
     8
     9        * fast/events/shadow-boundary-crossing.html:
     10
    1112010-10-30  Dimitri Glazkov  <dglazkov@chromium.org>
    212
  • trunk/LayoutTests/fast/events/shadow-boundary-crossing.html

    r70984 r70985  
    33    <title></title>
    44    <script type="text/javascript">
    5         var success;
    6         var target;
     5        var fired = false;
    76
    87        function selectStart(event)
    98        {
    10             success = event.target == target;
     9            fired = true;
    1110        }
    1211
     
    1716            layoutTestController.dumpAsText();
    1817
    19             target = document.getElementById("target");
     18            var target = document.getElementById("target");
    2019            var x = target.offsetLeft + target.offsetWidth / 2;
    2120            var y = target.offsetTop + target.offsetHeight / 2;
     
    2524            eventSender.mouseUp();
    2625
    27             document.getElementById("result").innerText = !success ? "FAIL" : "PASS";
     26            document.getElementById("result").innerText = fired ? "FAIL" : "PASS";
    2827        }
    2928
  • trunk/WebCore/Android.mk

    r70984 r70985  
    133133        dom/ErrorEvent.cpp \
    134134        dom/Event.cpp \
    135         dom/EventContext.cpp \
    136135        dom/EventNames.cpp \
    137136        dom/EventTarget.cpp \
     
    194193        dom/WebKitTransitionEvent.cpp \
    195194        dom/WheelEvent.cpp \
    196         dom/WindowEventContext.cpp \
    197195        dom/XMLDocumentParser.cpp \
    198196        dom/XMLDocumentParserLibxml2.cpp \
  • trunk/WebCore/CMakeLists.txt

    r70984 r70985  
    825825    dom/ErrorEvent.cpp
    826826    dom/Event.cpp
    827     dom/EventContext.cpp
    828827    dom/EventNames.cpp
    829828    dom/EventTarget.cpp
     
    883882    dom/WebKitTransitionEvent.cpp
    884883    dom/WheelEvent.cpp
    885     dom/WindowEventContext.cpp
    886884    dom/XMLDocumentParser.cpp
    887885    dom/XMLDocumentParserLibxml2.cpp
  • trunk/WebCore/ChangeLog

    r70984 r70985  
     12010-10-30  Dimitri Glazkov  <dglazkov@chromium.org>
     2
     3        Unreviewed, rolling out r70984.
     4        http://trac.webkit.org/changeset/70984
     5        https://bugs.webkit.org/show_bug.cgi?id=46015
     6
     7        Made media/audio-delete-while-slider-thumb-clicked.html crash.
     8
     9        * Android.mk:
     10        * CMakeLists.txt:
     11        * GNUmakefile.am:
     12        * WebCore.gypi:
     13        * WebCore.pro:
     14        * WebCore.xcodeproj/project.pbxproj:
     15        * dom/ContainerNode.cpp:
     16        (WebCore::notifyChildInserted):
     17        * dom/EventContext.cpp: Removed.
     18        * dom/EventContext.h: Removed.
     19        * dom/Node.cpp:
     20        (WebCore::Node::markAncestorsWithChildNeedsStyleRecalc):
     21        (WebCore::Node::createRendererIfNeeded):
     22        (WebCore::Node::eventParentNode):
     23        (WebCore::Node::enclosingLinkEventParentOrSelf):
     24        (WebCore::eventTargetAsSVGElementInstance):
     25        (WebCore::eventTargetRespectingSVGTargetRules):
     26        (WebCore::Node::eventAncestors):
     27        (WebCore::Node::dispatchGenericEvent):
     28        * dom/Node.h:
     29        * dom/Text.cpp:
     30        (WebCore::Text::createRenderer):
     31        * dom/WindowEventContext.cpp: Removed.
     32        * dom/WindowEventContext.h: Removed.
     33        * inspector/InspectorDOMAgent.cpp:
     34        (WebCore::InspectorDOMAgent::getEventListenersForNode):
     35        * inspector/InspectorInstrumentation.cpp:
     36        (WebCore::eventHasListeners):
     37        (WebCore::InspectorInstrumentation::willDispatchEventImpl):
     38        * inspector/InspectorInstrumentation.h:
     39        (WebCore::InspectorInstrumentation::willDispatchEvent):
     40        * page/EventHandler.cpp:
     41        (WebCore::EventHandler::updateMouseEventTargetNode):
     42        * svg/SVGElement.cpp:
     43        (WebCore::SVGElement::eventParentNode):
     44        * svg/SVGElement.h:
     45
    1462010-10-30  Dimitri Glazkov  <dglazkov@chromium.org>
    247
  • trunk/WebCore/GNUmakefile.am

    r70984 r70985  
    11331133        WebCore/dom/ErrorEvent.h \
    11341134        WebCore/dom/Event.cpp \
     1135        WebCore/dom/EventException.h \
    11351136        WebCore/dom/Event.h \
    1136         WebCore/dom/EventContext.cpp \
    1137         WebCore/dom/EventContext.h \
    1138         WebCore/dom/EventException.h \
    11391137        WebCore/dom/EventListener.h \
    11401138        WebCore/dom/EventNames.cpp \
     
    12641262        WebCore/dom/WheelEvent.cpp \
    12651263        WebCore/dom/WheelEvent.h \
    1266         WebCore/dom/WindowEventContext.cpp \
    1267         WebCore/dom/WindowEventContext.h \
    12681264        WebCore/dom/XMLDocumentParser.cpp \
    12691265        WebCore/dom/XMLDocumentParser.h \
  • trunk/WebCore/WebCore.gypi

    r70984 r70985  
    12051205            'dom/Event.cpp',
    12061206            'dom/Event.h',
    1207             'dom/EventContext.cpp',
    1208             'dom/EventContext.h',
    12091207            'dom/EventException.h',
    12101208            'dom/EventListener.h',
     
    13421340            'dom/WheelEvent.cpp',
    13431341            'dom/WheelEvent.h',
    1344             'dom/WindowEventContext.cpp',
    1345             'dom/WindowEventContext.h',
    13461342            'dom/XMLDocumentParser.cpp',
    13471343            'dom/XMLDocumentParser.h',
  • trunk/WebCore/WebCore.pro

    r70984 r70985  
    714714    dom/ErrorEvent.cpp \
    715715    dom/Event.cpp \
    716     dom/EventContext.cpp \
    717716    dom/EventNames.cpp \
    718717    dom/EventTarget.cpp \
     
    775774    dom/WebKitTransitionEvent.cpp \
    776775    dom/WheelEvent.cpp \
    777     dom/WindowEventContext.cpp \
    778776    dom/XMLDocumentParser.cpp \
    779777    dom/XMLDocumentParserQt.cpp \
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r70984 r70985  
    892892                411046410FA222A600BA436A /* ScriptEventListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 4110463F0FA222A600BA436A /* ScriptEventListener.h */; };
    893893                411046420FA222A600BA436A /* ScriptEventListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 411046400FA222A600BA436A /* ScriptEventListener.cpp */; };
    894                 4123E569127B3041000FEEA7 /* WindowEventContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 4123E567127B3041000FEEA7 /* WindowEventContext.h */; };
    895                 4123E56A127B3041000FEEA7 /* WindowEventContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4123E568127B3041000FEEA7 /* WindowEventContext.cpp */; };
    896894                4127D5370F8AAB1D00E424F5 /* ScriptState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4127D5360F8AAB1D00E424F5 /* ScriptState.cpp */; };
    897                 4138D3351244054800323D33 /* EventContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 4138D3331244054800323D33 /* EventContext.h */; };
    898                 4138D3361244054800323D33 /* EventContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4138D3341244054800323D33 /* EventContext.cpp */; };
    899895                4162A450101145AE00DFF3ED /* DedicatedWorkerContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4162A44D101145AE00DFF3ED /* DedicatedWorkerContext.cpp */; };
    900896                4162A451101145AE00DFF3ED /* DedicatedWorkerContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 4162A44E101145AE00DFF3ED /* DedicatedWorkerContext.h */; };
     
    69606956                4110463F0FA222A600BA436A /* ScriptEventListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptEventListener.h; sourceTree = "<group>"; };
    69616957                411046400FA222A600BA436A /* ScriptEventListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptEventListener.cpp; sourceTree = "<group>"; };
    6962                 4123E567127B3041000FEEA7 /* WindowEventContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowEventContext.h; sourceTree = "<group>"; };
    6963                 4123E568127B3041000FEEA7 /* WindowEventContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowEventContext.cpp; sourceTree = "<group>"; };
    69646958                4127D5360F8AAB1D00E424F5 /* ScriptState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptState.cpp; sourceTree = "<group>"; };
    6965                 4138D3331244054800323D33 /* EventContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventContext.h; sourceTree = "<group>"; };
    6966                 4138D3341244054800323D33 /* EventContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventContext.cpp; sourceTree = "<group>"; };
    69676959                4162A44D101145AE00DFF3ED /* DedicatedWorkerContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DedicatedWorkerContext.cpp; path = workers/DedicatedWorkerContext.cpp; sourceTree = "<group>"; };
    69686960                4162A44E101145AE00DFF3ED /* DedicatedWorkerContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DedicatedWorkerContext.h; path = workers/DedicatedWorkerContext.h; sourceTree = "<group>"; };
     
    1817218164                                85031B2C0A44EFC700F992E0 /* Event.h */,
    1817318165                                14E836D209F8512000B85AE4 /* Event.idl */,
    18174                                 4138D3341244054800323D33 /* EventContext.cpp */,
    18175                                 4138D3331244054800323D33 /* EventContext.h */,
    1817618166                                BC60D9090D2A17CE00B9918F /* EventException.h */,
    1817718167                                BC60D90A0D2A17CE00B9918F /* EventException.idl */,
     
    1833418324                                85031B3B0A44EFC700F992E0 /* WheelEvent.h */,
    1833518325                                93EEC1F709C2877700C515D1 /* WheelEvent.idl */,
    18336                                 4123E568127B3041000FEEA7 /* WindowEventContext.cpp */,
    18337                                 4123E567127B3041000FEEA7 /* WindowEventContext.h */,
    1833818326                                F523D30902DE4476018635CA /* XMLDocumentParser.cpp */,
    1833918327                                F523D30A02DE4476018635CA /* XMLDocumentParser.h */,
     
    1949919487                                2ECF7AE210162B5800427DE7 /* ErrorEvent.h in Headers */,
    1950019488                                85031B420A44EFC700F992E0 /* Event.h in Headers */,
    19501                                 4138D3351244054800323D33 /* EventContext.h in Headers */,
    1950219489                                BC60D90C0D2A17CE00B9918F /* EventException.h in Headers */,
    1950319490                                93C09A530B064DB3005ABD4D /* EventHandler.h in Headers */,
     
    2115521142                                9380F47409A11AB4001FDB34 /* Widget.h in Headers */,
    2115621143                                939B02EF0EA2DBC400C54570 /* WidthIterator.h in Headers */,
    21157                                 4123E569127B3041000FEEA7 /* WindowEventContext.h in Headers */,
    2115821144                                BC8243E90D0CFD7500460C8F /* WindowFeatures.h in Headers */,
    2115921145                                E1E1BF00115FF6FB006F52CA /* WindowsKeyboardCodes.h in Headers */,
     
    2213122117                                2ECF7AE110162B5800427DE7 /* ErrorEvent.cpp in Sources */,
    2213222118                                85031B410A44EFC700F992E0 /* Event.cpp in Sources */,
    22133                                 4138D3361244054800323D33 /* EventContext.cpp in Sources */,
    2213422119                                93C09A810B064F00005ABD4D /* EventHandler.cpp in Sources */,
    2213522120                                93C09A7F0B064EEF005ABD4D /* EventHandlerMac.mm in Sources */,
     
    2373123716                                9380F47809A11ACC001FDB34 /* WidgetMac.mm in Sources */,
    2373223717                                939B02EE0EA2DBC400C54570 /* WidthIterator.cpp in Sources */,
    23733                                 4123E56A127B3041000FEEA7 /* WindowEventContext.cpp in Sources */,
    2373423718                                BC8243E80D0CFD7500460C8F /* WindowFeatures.cpp in Sources */,
    2373523719                                08203A9F0ED8C35300B8B61A /* WMLAccessElement.cpp in Sources */,
  • trunk/WebCore/dom/ContainerNode.cpp

    r70984 r70985  
    10061006    RefPtr<Document> document = child->document();
    10071007
    1008     Node* parentOrHostNode = c->parentOrHostNode();
    1009     if (parentOrHostNode && parentOrHostNode->inDocument())
     1008    if (c->parentNode() && c->parentNode()->inDocument())
    10101009        c->insertedIntoDocument();
    10111010    else
  • trunk/WebCore/dom/Node.cpp

    r70984 r70985  
    4646#include "Element.h"
    4747#include "Event.h"
    48 #include "EventContext.h"
    4948#include "EventException.h"
    5049#include "EventHandler.h"
     
    8281#include "WebKitTransitionEvent.h"
    8382#include "WheelEvent.h"
    84 #include "WindowEventContext.h"
    8583#include "XMLNames.h"
    8684#include "htmlediting.h"
     
    737735inline void Node::markAncestorsWithChildNeedsStyleRecalc()
    738736{
    739     for (ContainerNode* p = parentOrHostNode(); p && !p->childNeedsStyleRecalc(); p = p->parentOrHostNode())
     737    for (ContainerNode* p = parentNode(); p && !p->childNeedsStyleRecalc(); p = p->parentNode())
    740738        p->setChildNeedsStyleRecalc();
    741 
     739   
    742740    if (document()->childNeedsStyleRecalc())
    743741        document()->scheduleStyleRecalc();
     
    13241322    ASSERT(!renderer());
    13251323   
    1326     ContainerNode* parent = parentOrHostNode();
     1324    ContainerNode* parent = parentNode();   
    13271325    ASSERT(parent);
    13281326   
     
    22422240}
    22432241
     2242ContainerNode* Node::eventParentNode()
     2243{
     2244    return parentNode();
     2245}
     2246
    22442247Node* Node::enclosingLinkEventParentOrSelf()
    22452248{
    2246     for (Node* node = this; node; node = node->parentOrHostNode()) {
     2249    for (Node* node = this; node; node = node->eventParentNode()) {
    22472250        // For imagemaps, the enclosing link node is the associated area element not the image itself.
    22482251        // So we don't let images be the enclosingLinkNode, even though isLink sometimes returns true
     
    24822485}
    24832486
    2484 static inline EventTarget* eventTargetRespectingSVGTargetRules(Node* referenceNode)
     2487#if ENABLE(SVG)
     2488static inline SVGElementInstance* eventTargetAsSVGElementInstance(Node* referenceNode)
    24852489{
    24862490    ASSERT(referenceNode);
    2487 
    2488 #if ENABLE(SVG)
    24892491    if (!referenceNode->isSVGElement())
    2490         return referenceNode;
     2492        return 0;
    24912493
    24922494    // Spec: The event handling for the non-exposed tree works as if the referenced element had been textually included
     
    25022504            return instance;
    25032505    }
     2506
     2507    return 0;
     2508}
    25042509#endif
    25052510
     2511static inline EventTarget* eventTargetRespectingSVGTargetRules(Node* referenceNode)
     2512{
     2513    ASSERT(referenceNode);
     2514
     2515#if ENABLE(SVG)
     2516    if (SVGElementInstance* instance = eventTargetAsSVGElementInstance(referenceNode)) {
     2517        ASSERT(instance->shadowTreeElement() == referenceNode);
     2518        return instance;
     2519    }
     2520#endif
     2521
    25062522    return referenceNode;
    25072523}
    25082524
    2509 void Node::getEventAncestors(Vector<EventContext>& ancestors, EventTarget* originalTarget)
    2510 {
    2511     if (!inDocument())
    2512         return;
    2513 
    2514     EventTarget* target = originalTarget;
    2515     Node* ancestor = this;
    2516     bool shouldSkipNextAncestor = false;
    2517     while (true) {
    2518         if (ancestor->isShadowNode()) {
    2519             ancestor = ancestor->shadowParentNode();
    2520             if (!shouldSkipNextAncestor)
    2521                 target = ancestor;
    2522         } else
    2523             ancestor = ancestor->parentNode();
    2524 
    2525         if (!ancestor)
    2526             return;
    2527 
     2525void Node::eventAncestors(Vector<RefPtr<ContainerNode> > &ancestors)
     2526{
     2527    if (inDocument()) {
     2528        for (ContainerNode* ancestor = eventParentNode(); ancestor; ancestor = ancestor->eventParentNode()) {
    25282529#if ENABLE(SVG)
    2529         // Skip SVGShadowTreeRootElement.
    2530         shouldSkipNextAncestor = ancestor->isSVGElement() && ancestor->isShadowNode();
    2531         if (shouldSkipNextAncestor)
    2532             continue;
     2530            // Skip <use> shadow tree elements.
     2531            if (ancestor->isSVGElement() && ancestor->isShadowNode())
     2532                continue;
    25332533#endif
    2534         // FIXME: Unroll the extra loop inside eventTargetRespectingSVGTargetRules into this loop.
    2535         ancestors.append(EventContext(ancestor, eventTargetRespectingSVGTargetRules(ancestor), target));
    2536 
     2534            ancestors.append(ancestor);
     2535        }
    25372536    }
    25382537}
     
    25472546    RefPtr<FrameView> view = document()->view();
    25482547    return dispatchGenericEvent(event.release());
    2549 }
    2550 
    2551 static const EventContext* topEventContext(const Vector<EventContext>& ancestors)
    2552 {
    2553     return ancestors.isEmpty() ? 0 : &(ancestors.last());
    25542548}
    25552549
     
    25662560    // Be sure to ref all of nodes since event handlers could result in the last reference going away.
    25672561    RefPtr<Node> thisNode(this);
    2568     RefPtr<EventTarget> originalTarget = event->target();
    2569     Vector<EventContext> ancestors;
    2570     getEventAncestors(ancestors, originalTarget.get());
    2571 
    2572     WindowEventContext windowContext(event.get(), this, topEventContext(ancestors));
    2573 
    2574     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispatchEvent(document(), *event, windowContext.window(), this, ancestors);
     2562    Vector<RefPtr<ContainerNode> > ancestors;
     2563    eventAncestors(ancestors);
     2564
     2565    // Set up a pointer to indicate whether / where to dispatch window events.
     2566    // We don't dispatch load events to the window. That quirk was originally
     2567    // added because Mozilla doesn't propagate load events to the window object.
     2568    DOMWindow* targetForWindowEvents = 0;
     2569    if (event->type() != eventNames().loadEvent) {
     2570        Node* topLevelContainer = ancestors.isEmpty() ? this : ancestors.last().get();
     2571        if (topLevelContainer->isDocumentNode())
     2572            targetForWindowEvents = static_cast<Document*>(topLevelContainer)->domWindow();
     2573    }
     2574
     2575    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispatchEvent(document(), *event, targetForWindowEvents, this, ancestors);
    25752576
    25762577    // Give the target node a chance to do some work before DOM event handlers get a crack.
     
    25822583    event->setEventPhase(Event::CAPTURING_PHASE);
    25832584
    2584     if (windowContext.handleLocalEvents(event.get()) && event->propagationStopped())
    2585         goto doneDispatching;
    2586 
    2587     for (size_t i = ancestors.size(); i; --i) {
    2588         ancestors[i - 1].handleLocalEvents(event.get());
     2585    if (targetForWindowEvents) {
     2586        event->setCurrentTarget(targetForWindowEvents);
     2587        targetForWindowEvents->fireEventListeners(event.get());
    25892588        if (event->propagationStopped())
    25902589            goto doneDispatching;
    25912590    }
     2591    for (size_t i = ancestors.size(); i; --i) {
     2592        ContainerNode* ancestor = ancestors[i - 1].get();
     2593        event->setCurrentTarget(eventTargetRespectingSVGTargetRules(ancestor));
     2594        ancestor->handleLocalEvents(event.get());
     2595        if (event->propagationStopped())
     2596            goto doneDispatching;
     2597    }
    25922598
    25932599    event->setEventPhase(Event::AT_TARGET);
    2594     event->setTarget(originalTarget.get());
     2600
    25952601    event->setCurrentTarget(eventTargetRespectingSVGTargetRules(this));
    25962602    handleLocalEvents(event.get());
     
    26042610        size_t size = ancestors.size();
    26052611        for (size_t i = 0; i < size; ++i) {
    2606             ancestors[i].handleLocalEvents(event.get());
     2612            ContainerNode* ancestor = ancestors[i].get();
     2613            event->setCurrentTarget(eventTargetRespectingSVGTargetRules(ancestor));
     2614            ancestor->handleLocalEvents(event.get());
    26072615            if (event->propagationStopped() || event->cancelBubble())
    26082616                goto doneDispatching;
    26092617        }
    2610         windowContext.handleLocalEvents(event.get());
     2618        if (targetForWindowEvents) {
     2619            event->setCurrentTarget(targetForWindowEvents);
     2620            targetForWindowEvents->fireEventListeners(event.get());
     2621            if (event->propagationStopped() || event->cancelBubble())
     2622                goto doneDispatching;
     2623        }
    26112624    }
    26122625
    26132626doneDispatching:
    2614     event->setTarget(originalTarget.get());
    26152627    event->setCurrentTarget(0);
    26162628    event->setEventPhase(0);
     
    26332645            size_t size = ancestors.size();
    26342646            for (size_t i = 0; i < size; ++i) {
    2635                 ancestors[i].node()->defaultEventHandler(event.get());
     2647                ContainerNode* ancestor = ancestors[i].get();
     2648                ancestor->defaultEventHandler(event.get());
    26362649                ASSERT(!event->defaultPrevented());
    26372650                if (event->defaultHandled())
  • trunk/WebCore/dom/Node.h

    r70984 r70985  
    5050class Element;
    5151class Event;
    52 class EventContext;
    5352class EventListener;
    5453class FloatPoint;
     
    206205    Node* shadowTreeRootNode();
    207206    bool isInShadowTree();
    208     // Node's parent or shadow tree host.
    209     ContainerNode* parentOrHostNode();
     207
     208    // The node's parent for the purpose of event capture and bubbling.
     209    virtual ContainerNode* eventParentNode();
    210210
    211211    // Returns the enclosing event parent node (or self) that, when clicked, would trigger a navigation.
     
    213213
    214214    // Node ancestors when concerned about event flow.
    215     void getEventAncestors(Vector<EventContext>& ancestors, EventTarget*);
     215    // FIXME: Should be named getEventAncestors.
     216    void eventAncestors(Vector<RefPtr<ContainerNode> > &ancestors);
    216217
    217218    bool isBlockFlow() const;
     
    693694}
    694695
    695 inline ContainerNode* Node::parentOrHostNode()
    696 {
    697     if (ContainerNode* parent = parentNode())
    698         return parent;
    699     return shadowParentNode();
    700 }
    701 
    702696} //namespace
    703697
  • trunk/WebCore/dom/Text.cpp

    r70984 r70985  
    240240RenderObject* Text::createRenderer(RenderArena* arena, RenderStyle*)
    241241{
    242     Node* parentOrHost = parentOrHostNode();
    243242#if ENABLE(SVG)
    244     if (parentOrHost->isSVGElement()
     243    if (parentNode()->isSVGElement()
    245244#if ENABLE(SVG_FOREIGN_OBJECT)
    246         && !parentOrHost->hasTagName(SVGNames::foreignObjectTag)
     245        && !parentNode()->hasTagName(SVGNames::foreignObjectTag)
    247246#endif
    248247    )
  • trunk/WebCore/inspector/InspectorDOMAgent.cpp

    r70984 r70985  
    5252#include "DocumentType.h"
    5353#include "Event.h"
    54 #include "EventContext.h"
    5554#include "EventListener.h"
    5655#include "EventNames.h"
     
    609608
    610609    // The Node's Event Ancestors (not including self)
    611     Vector<EventContext> ancestors;
    612     node->getEventAncestors(ancestors, node);
     610    Vector<RefPtr<ContainerNode> > ancestors;
     611    node->eventAncestors(ancestors);
    613612
    614613    // Nodes and their Listeners for the concerned event types (order is top to bottom)
    615614    Vector<EventListenerInfo> eventInformation;
    616615    for (size_t i = ancestors.size(); i; --i) {
    617         Node* ancestor = ancestors[i - 1].node();
     616        ContainerNode* ancestor = ancestors[i - 1].get();
    618617        for (size_t j = 0; j < eventTypesLength; ++j) {
    619618            AtomicString& type = eventTypes[j];
  • trunk/WebCore/inspector/InspectorInstrumentation.cpp

    r70984 r70985  
    3636#include "DOMWindow.h"
    3737#include "Event.h"
    38 #include "EventContext.h"
    3938#include "InspectorController.h"
    4039#include "InspectorDOMAgent.h"
     
    5554int InspectorInstrumentation::s_frontendCounter = 0;
    5655
    57 static bool eventHasListeners(const AtomicString& eventType, DOMWindow* window, Node* node, const Vector<EventContext>& ancestors)
     56static bool eventHasListeners(const AtomicString& eventType, DOMWindow* window, Node* node, const Vector<RefPtr<ContainerNode> >& ancestors)
    5857{
    5958    if (window && window->hasEventListeners(eventType))
     
    6463
    6564    for (size_t i = 0; i < ancestors.size(); i++) {
    66         Node* ancestor = ancestors[i].node();
     65        ContainerNode* ancestor = ancestors[i].get();
    6766        if (ancestor->hasEventListeners(eventType))
    6867            return true;
     
    140139        domAgent->characterDataModified(characterData);
    141140}
     141
    142142
    143143void InspectorInstrumentation::willSendXMLHttpRequestImpl(InspectorController* inspectorController, const String& url)
     
    214214}
    215215
    216 InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEventImpl(InspectorController* inspectorController, const Event& event, DOMWindow* window, Node* node, const Vector<EventContext>& ancestors)
     216InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEventImpl(InspectorController* inspectorController, const Event& event, DOMWindow* window, Node* node, const Vector<RefPtr<ContainerNode> >& ancestors)
    217217{
    218218    pauseOnNativeEventIfNeeded(inspectorController, listenerEventCategoryType, event.type(), false);
  • trunk/WebCore/inspector/InspectorInstrumentation.h

    r70984 r70985  
    4141class CharacterData;
    4242class Element;
    43 class EventContext;
    4443class InspectorController;
    4544class InspectorTimelineAgent;
     
    7574    static InspectorInstrumentationCookie willChangeXHRReadyState(ScriptExecutionContext*, XMLHttpRequest* request);
    7675    static void didChangeXHRReadyState(const InspectorInstrumentationCookie&);
    77     static InspectorInstrumentationCookie willDispatchEvent(Document*, const Event& event, DOMWindow* window, Node* node, const Vector<EventContext>& ancestors);
     76    static InspectorInstrumentationCookie willDispatchEvent(Document*, const Event& event, DOMWindow* window, Node* node, const Vector<RefPtr<ContainerNode> >& ancestors);
    7877    static void didDispatchEvent(const InspectorInstrumentationCookie&);
    7978    static InspectorInstrumentationCookie willDispatchEventOnWindow(Frame*, const Event& event, DOMWindow* window);
     
    132131    static InspectorInstrumentationCookie willChangeXHRReadyStateImpl(InspectorController*, XMLHttpRequest* request);
    133132    static void didChangeXHRReadyStateImpl(const InspectorInstrumentationCookie&);
    134     static InspectorInstrumentationCookie willDispatchEventImpl(InspectorController*, const Event& event, DOMWindow* window, Node* node, const Vector<EventContext>& ancestors);
     133    static InspectorInstrumentationCookie willDispatchEventImpl(InspectorController*, const Event& event, DOMWindow* window, Node* node, const Vector<RefPtr<ContainerNode> >& ancestors);
    135134    static void didDispatchEventImpl(const InspectorInstrumentationCookie&);
    136135    static InspectorInstrumentationCookie willDispatchEventOnWindowImpl(InspectorController*, const Event& event, DOMWindow* window);
     
    227226}
    228227
     228
    229229inline void InspectorInstrumentation::willSendXMLHttpRequest(ScriptExecutionContext* context, const String& url)
    230230{
     
    294294}
    295295
    296 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEvent(Document* document, const Event& event, DOMWindow* window, Node* node, const Vector<EventContext>& ancestors)
     296inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEvent(Document* document, const Event& event, DOMWindow* window, Node* node, const Vector<RefPtr<ContainerNode> >& ancestors)
    297297{
    298298#if ENABLE(INSPECTOR)
  • trunk/WebCore/page/EventHandler.cpp

    r70984 r70985  
    17671767        if (result && result->isTextNode())
    17681768            result = result->parentNode();
     1769        if (result)
     1770            result = result->shadowAncestorNode();
    17691771    }
    17701772    m_nodeUnderMouse = result;
  • trunk/WebCore/svg/SVGElement.cpp

    r70984 r70985  
    348348}
    349349
     350ContainerNode* SVGElement::eventParentNode()
     351{
     352    if (ContainerNode* shadowParent = shadowParentNode())
     353        return shadowParent;
     354    return StyledElement::eventParentNode();
     355}
     356
    350357}
    351358
  • trunk/WebCore/svg/SVGElement.h

    r70984 r70985  
    100100        virtual bool isSupported(StringImpl* feature, StringImpl* version) const;
    101101
     102        virtual ContainerNode* eventParentNode();
     103
    102104        virtual bool needsPendingResourceHandling() const { return true; }
    103105        virtual void buildPendingResource() { }
Note: See TracChangeset for help on using the changeset viewer.