Changeset 68923 in webkit
- Timestamp:
- Oct 1, 2010 1:50:41 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r68921 r68923 1 2010-10-01 Enrica Casucci <enrica@apple.com> 2 3 Reviewed by Darin Adler. 4 5 DOMFocusIn/DOMFocusOut return focusin/focusout Event.type 6 https://bugs.webkit.org/show_bug.cgi?id=42580 7 <rdar://problem/8107311> 8 9 * fast/events/focusinout.html: Modified to check the event type. 10 1 11 2010-10-01 Adam Roben <aroben@apple.com> 2 12 -
trunk/LayoutTests/fast/events/focusinout.html
r56402 r68923 10 10 } 11 11 12 function writeFailed(id, reason) 13 { 14 document.getElementById(id).innerHTML = "FAIL: " + reason; 15 } 16 12 17 function focusHandler(event) 13 18 { 14 writePass('result1'); 19 if (event.type == "focusin") 20 writePass('result1'); 21 else 22 writeFailed('result1', "Wrong event type"); 15 23 } 16 24 17 25 function blurHandler(event) 18 26 { 19 writePass('result2'); 27 if (event.type == "focusout") 28 writePass('result2'); 29 else 30 writeFailed('result2', "Wrong event type"); 20 31 } 21 32 22 33 function focusHandlerTwo(event) 23 34 { 24 writePass('result3'); 35 if (event.type == "DOMFocusIn") 36 writePass('result3'); 37 else 38 writeFailed('result3', "Wrong event type"); 25 39 } 26 40 27 41 function blurHandlerTwo(event) 28 42 { 29 writePass('result4'); 43 if (event.type == "DOMFocusOut") 44 writePass('result4'); 45 else 46 writeFailed('result4', "Wrong event type"); 30 47 } 31 48 </script> -
trunk/WebCore/ChangeLog
r68917 r68923 1 2010-10-01 Enrica Casucci <enrica@apple.com> 2 3 Reviewed by Darin Adler. 4 5 DOMFocusIn/DOMFocusOut return focusin/focusout Event.type 6 https://bugs.webkit.org/show_bug.cgi?id=42580 7 <rdar://problem/8107311> 8 9 This change removes the aliased type machinery from the Event class. 10 We now fire the event with the new name and the oldname. 11 12 Tests: Modified fast/events/focusinout.html to check the event 13 type. 14 15 * dom/Document.cpp: 16 (WebCore::Document::setFocusedNode): 17 * dom/Event.cpp: Removed aliasedType and hasAliasedType. 18 * dom/Event.h: Removed aliasedType and hasAliasedType. 19 * dom/EventTarget.cpp: 20 (WebCore::EventTarget::fireEventListeners): Removed aliasedType related code. 21 1 22 2010-10-01 David Hyatt <hyatt@apple.com> 2 23 -
trunk/WebCore/dom/Document.cpp
r68854 r68923 3106 3106 3107 3107 oldFocusedNode->dispatchUIEvent(eventNames().focusoutEvent, 0, 0); // DOM level 3 name for the bubbling blur event. 3108 // FIXME: We should remove firing DOMFocusOutEvent event when we are sure no content depends 3109 // on it, probably when <rdar://problem/8503958> is resolved. 3110 oldFocusedNode->dispatchUIEvent(eventNames().DOMFocusOutEvent, 0, 0); // DOM level 2 name for compatibility. 3108 3111 3109 3112 if (m_focusedNode) { … … 3146 3149 3147 3150 m_focusedNode->dispatchUIEvent(eventNames().focusinEvent, 0, 0); // DOM level 3 bubbling focus event. 3151 // FIXME: We should remove firing DOMFocusInEvent event when we are sure no content depends 3152 // on it, probably when <rdar://problem/8503958> is resolved. 3153 m_focusedNode->dispatchUIEvent(eventNames().DOMFocusInEvent, 0, 0); // DOM level 2 for compatibility. 3148 3154 3149 3155 if (m_focusedNode != newFocusedNode) { -
trunk/WebCore/dom/Event.cpp
r67898 r68923 283 283 } 284 284 285 const AtomicString& Event::aliasedType() const286 {287 if (type() == eventNames().focusinEvent)288 return eventNames().DOMFocusInEvent;289 if (type() == eventNames().focusoutEvent)290 return eventNames().DOMFocusOutEvent;291 if (type() == eventNames().DOMFocusInEvent)292 return eventNames().focusinEvent;293 if (type() == eventNames().DOMFocusOutEvent)294 return eventNames().focusoutEvent;295 296 ASSERT_NOT_REACHED();297 return type();298 }299 300 bool Event::hasAliasedType() const301 {302 return type() == eventNames().focusinEvent || type() == eventNames().focusoutEvent ||303 type() == eventNames().DOMFocusInEvent || type() == eventNames().DOMFocusOutEvent;304 }305 306 285 } // namespace WebCore -
trunk/WebCore/dom/Event.h
r67898 r68923 77 77 const AtomicString& type() const { return m_type; } 78 78 79 const AtomicString& aliasedType() const;80 bool hasAliasedType() const;81 82 79 EventTarget* target() const { return m_target.get(); } 83 80 void setTarget(PassRefPtr<EventTarget>); -
trunk/WebCore/dom/EventTarget.cpp
r67614 r68923 300 300 fireEventListeners(event, d, *result->second); 301 301 302 // Alias DOMFocusIn/DOMFocusOut to focusin/focusout (and vice versa). Just consider them to be the303 // same event (triggering one another's handlers). This mechanism allows us to deprecate or change event304 // names in the future and still make them be interoperable.305 if (event->hasAliasedType() && !event->immediatePropagationStopped()) {306 EventListenerMap::iterator result = d->eventListenerMap.find(event->aliasedType());307 if (result != d->eventListenerMap.end())308 fireEventListeners(event, d, *result->second);309 }310 302 return !event->defaultPrevented(); 311 303 }
Note: See TracChangeset
for help on using the changeset viewer.