Changeset 105123 in webkit
- Timestamp:
- Jan 16, 2012 7:56:16 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r105120 r105123 1 2012-01-16 Hayato Ito <hayato@chromium.org> 2 3 Implement multiple AT_TARGET event dispatching in regard to shadow tree. 4 https://bugs.webkit.org/show_bug.cgi?id=76217 5 6 Reviewed by Dimitri Glazkov. 7 8 The original motivation is to fix the regression: Event.eventPhase is not set to 2 9 (at target) when handling dblclick event in <input> element. 10 Since the issue is not specific to <input> element, but general one, this patch fixes 11 the regression by adapting a living draft spec of shadow DOM. 12 This won't break a compatibility if there is no shadow boundaries in event dispatching. 13 See the following shadow dom spec how multiple AT_TARGET events work. 14 http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#event-dispatch 15 16 * fast/dom/shadow/shadow-boundary-events-expected.txt: 17 * fast/dom/shadow/shadow-boundary-events.html: 18 1 19 2012-01-16 Robert Hogan <robert@webkit.org> 2 20 -
trunk/LayoutTests/fast/dom/shadow/shadow-boundary-events-expected.txt
r93276 r105123 77 77 Old focused node and new focused node exist in separated subtrees, crossing shadow boundaries. Making sure that an event is not dispatched beyond the lowest common boundary. 78 78 Moving focus from shadowD/shadowF/shadowG/divH to shadowD/shadowK/divL 79 PASS dispatchedEvent("focus") is ["shadowK(@divJ)(capturing phase)", "shadowK(@shadowK) (capturing phase)", "divL(@divL)"]80 PASS dispatchedEvent("blur") is ["shadowF(@divE)(capturing phase)", "shadowF(@shadowF) (capturing phase)", "shadowG(@shadowG)(capturing phase)", "divH(@divH)"]79 PASS dispatchedEvent("focus") is ["shadowK(@divJ)(capturing phase)", "shadowK(@shadowK)", "divL(@divL)"] 80 PASS dispatchedEvent("blur") is ["shadowF(@divE)(capturing phase)", "shadowF(@shadowF)", "shadowG(@shadowG)", "divH(@divH)"] 81 81 PASS successfullyParsed is true 82 82 -
trunk/LayoutTests/fast/dom/shadow/shadow-boundary-events.html
r98407 r105123 60 60 if (event.eventPhase == 1) 61 61 eventString += '(capturing phase)'; 62 if (event.target && event.currentTarget && event.target.id == event.currentTarget.id) 63 shouldBe("event.eventPhase", "2", true); 62 64 eventRecords[eventType].push(eventString); 63 65 } … … 205 207 moveFocus('shadowD/shadowF/shadowG/divH', 'shadowD/shadowK/divL', 206 208 'Old focused node and new focused node exist in separated subtrees, crossing shadow boundaries. Making sure that an event is not dispatched beyond the lowest common boundary.'); 207 shouldBe('dispatchedEvent("focus")', '["shadowK(@divJ)(capturing phase)", "shadowK(@shadowK) (capturing phase)", "divL(@divL)"]');208 shouldBe('dispatchedEvent("blur")', '["shadowF(@divE)(capturing phase)", "shadowF(@shadowF) (capturing phase)", "shadowG(@shadowG)(capturing phase)", "divH(@divH)"]');209 shouldBe('dispatchedEvent("focus")', '["shadowK(@divJ)(capturing phase)", "shadowK(@shadowK)", "divL(@divL)"]'); 210 shouldBe('dispatchedEvent("blur")', '["shadowF(@divE)(capturing phase)", "shadowF(@shadowF)", "shadowG(@shadowG)", "divH(@divH)"]'); 209 211 } 210 212 -
trunk/Source/WebCore/ChangeLog
r105121 r105123 1 2012-01-16 Hayato Ito <hayato@chromium.org> 2 3 Implement multiple AT_TARGET event dispatching in regard to shadow tree. 4 https://bugs.webkit.org/show_bug.cgi?id=76217 5 6 Reviewed by Dimitri Glazkov. 7 8 The original motivation is to fix the regression: Event.eventPhase is not set to 2 9 (at target) when handling dblclick event in <input> element. 10 Since the issue is not specific to <input> element, but general one, this patch fixes 11 the regression by adapting a living draft spec of shadow DOM. 12 This won't break a compatibility if there is no shadow boundaries in event dispatching. 13 See the following shadow dom spec how multiple AT_TARGET events work. 14 http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#event-dispatch 15 16 * dom/EventContext.cpp: 17 (WebCore::EventContext::handleLocalEvents): 18 1 19 2012-01-16 Jason Liu <jason.liu@torchmobile.com.cn> 2 20 -
trunk/Source/WebCore/dom/EventContext.cpp
r95901 r105123 44 44 void EventContext::handleLocalEvents(Event* event) const 45 45 { 46 unsigned short eventPhase = event->eventPhase(); 47 if (m_target.get() == m_currentTarget.get()) { 48 if (eventPhase == Event::CAPTURING_PHASE && event->bubbles()) 49 return; 50 event->setEventPhase(Event::AT_TARGET); 51 } 46 52 event->setTarget(m_target.get()); 47 53 event->setCurrentTarget(m_currentTarget.get()); 48 54 m_node->handleLocalEvents(event); 55 event->setEventPhase(eventPhase); 49 56 } 50 57
Note: See TracChangeset
for help on using the changeset viewer.