[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

enrica at apple.com enrica at apple.com
Wed Dec 22 14:02:51 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit bd9026c623f2a38084f79b5bf3bbd48903c14a36
Author: enrica at apple.com <enrica at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 1 20:50:41 2010 +0000

    DOMFocusIn/DOMFocusOut return focusin/focusout Event.type
    https://bugs.webkit.org/show_bug.cgi?id=42580
    <rdar://problem/8107311>
    
    Reviewed by Darin Adler.
    
    WebCore:
    
    This change removes the aliased type machinery from the Event class.
    We now fire the event with the new name and the oldname.
    
    Tests: Modified fast/events/focusinout.html to check the event
    type.
    
    * dom/Document.cpp:
    (WebCore::Document::setFocusedNode):
    * dom/Event.cpp: Removed aliasedType and hasAliasedType.
    * dom/Event.h: Removed aliasedType and hasAliasedType.
    * dom/EventTarget.cpp:
    (WebCore::EventTarget::fireEventListeners): Removed aliasedType related code.
    
    LayoutTests:
    
    * fast/events/focusinout.html: Modified to check the event type.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68923 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 7d893ab..46e14eb 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-10-01  Enrica Casucci  <enrica at apple.com>
+
+        Reviewed by Darin Adler.
+
+        DOMFocusIn/DOMFocusOut return focusin/focusout Event.type
+        https://bugs.webkit.org/show_bug.cgi?id=42580
+        <rdar://problem/8107311>
+        
+        * fast/events/focusinout.html: Modified to check the event type.
+
 2010-10-01  Adam Roben  <aroben at apple.com>
 
         Land new Windows results for
diff --git a/LayoutTests/fast/events/focusinout.html b/LayoutTests/fast/events/focusinout.html
index 3c53330..971d2db 100644
--- a/LayoutTests/fast/events/focusinout.html
+++ b/LayoutTests/fast/events/focusinout.html
@@ -9,24 +9,41 @@ function writePass(id)
     document.getElementById(id).innerHTML = "PASS";
 }
 
+function writeFailed(id, reason)
+{
+    document.getElementById(id).innerHTML = "FAIL: " + reason;
+}
+
 function focusHandler(event)
 {
-    writePass('result1');
+    if (event.type == "focusin")
+        writePass('result1');
+    else
+        writeFailed('result1', "Wrong event type");
 }
 
 function blurHandler(event)
 {
-    writePass('result2');
+    if (event.type == "focusout")
+        writePass('result2');
+    else
+        writeFailed('result2', "Wrong event type");
 }
 
 function focusHandlerTwo(event)
 {
-    writePass('result3');
+    if (event.type == "DOMFocusIn")
+        writePass('result3');
+    else
+        writeFailed('result3', "Wrong event type");
 }
 
 function blurHandlerTwo(event)
 {
-    writePass('result4');
+    if (event.type == "DOMFocusOut")
+        writePass('result4');
+    else
+        writeFailed('result4', "Wrong event type");
 }
 </script>
 </head>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 190f971..97487ee 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2010-10-01  Enrica Casucci  <enrica at apple.com>
+
+        Reviewed by Darin Adler.
+
+        DOMFocusIn/DOMFocusOut return focusin/focusout Event.type
+        https://bugs.webkit.org/show_bug.cgi?id=42580
+        <rdar://problem/8107311>
+        
+        This change removes the aliased type machinery from the Event class.
+        We now fire the event with the new name and the oldname.
+        
+        Tests: Modified fast/events/focusinout.html to check the event
+        type.
+
+        * dom/Document.cpp:
+        (WebCore::Document::setFocusedNode):
+        * dom/Event.cpp: Removed aliasedType and hasAliasedType.
+        * dom/Event.h: Removed aliasedType and hasAliasedType.
+        * dom/EventTarget.cpp:
+        (WebCore::EventTarget::fireEventListeners): Removed aliasedType related code.
+
 2010-10-01  David Hyatt  <hyatt at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index a113d88..d578ad9 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -3105,6 +3105,9 @@ bool Document::setFocusedNode(PassRefPtr<Node> newFocusedNode)
         }
         
         oldFocusedNode->dispatchUIEvent(eventNames().focusoutEvent, 0, 0); // DOM level 3 name for the bubbling blur event.
+        // FIXME: We should remove firing DOMFocusOutEvent event when we are sure no content depends
+        // on it, probably when <rdar://problem/8503958> is resolved.
+        oldFocusedNode->dispatchUIEvent(eventNames().DOMFocusOutEvent, 0, 0); // DOM level 2 name for compatibility.
 
         if (m_focusedNode) {
             // handler shifted focus
@@ -3145,6 +3148,9 @@ bool Document::setFocusedNode(PassRefPtr<Node> newFocusedNode)
         }
 
         m_focusedNode->dispatchUIEvent(eventNames().focusinEvent, 0, 0); // DOM level 3 bubbling focus event.
+        // FIXME: We should remove firing DOMFocusInEvent event when we are sure no content depends
+        // on it, probably when <rdar://problem/8503958> is resolved.
+        m_focusedNode->dispatchUIEvent(eventNames().DOMFocusInEvent, 0, 0); // DOM level 2 for compatibility.
 
         if (m_focusedNode != newFocusedNode) { 
             // handler shifted focus
diff --git a/WebCore/dom/Event.cpp b/WebCore/dom/Event.cpp
index bb404fa..9293a9a 100644
--- a/WebCore/dom/Event.cpp
+++ b/WebCore/dom/Event.cpp
@@ -282,25 +282,4 @@ void Event::setUnderlyingEvent(PassRefPtr<Event> ue)
     m_underlyingEvent = ue;
 }
 
-const AtomicString& Event::aliasedType() const
-{
-    if (type() == eventNames().focusinEvent)
-        return eventNames().DOMFocusInEvent;
-    if (type() == eventNames().focusoutEvent)
-        return eventNames().DOMFocusOutEvent;
-    if (type() == eventNames().DOMFocusInEvent)
-        return eventNames().focusinEvent;
-    if (type() == eventNames().DOMFocusOutEvent)
-        return eventNames().focusoutEvent;
-    
-    ASSERT_NOT_REACHED();
-    return type();
-}
-
-bool Event::hasAliasedType() const
-{
-    return type() == eventNames().focusinEvent || type() == eventNames().focusoutEvent ||
-           type() == eventNames().DOMFocusInEvent || type() == eventNames().DOMFocusOutEvent;
-}
-
 } // namespace WebCore
diff --git a/WebCore/dom/Event.h b/WebCore/dom/Event.h
index 2a00eee..82ac8ec 100644
--- a/WebCore/dom/Event.h
+++ b/WebCore/dom/Event.h
@@ -76,9 +76,6 @@ namespace WebCore {
 
         const AtomicString& type() const { return m_type; }
         
-        const AtomicString& aliasedType() const;
-        bool hasAliasedType() const;
-
         EventTarget* target() const { return m_target.get(); }
         void setTarget(PassRefPtr<EventTarget>);
 
diff --git a/WebCore/dom/EventTarget.cpp b/WebCore/dom/EventTarget.cpp
index d2b6f49..9db4174 100644
--- a/WebCore/dom/EventTarget.cpp
+++ b/WebCore/dom/EventTarget.cpp
@@ -299,14 +299,6 @@ bool EventTarget::fireEventListeners(Event* event)
     if (result != d->eventListenerMap.end())
         fireEventListeners(event, d, *result->second);
     
-    // Alias DOMFocusIn/DOMFocusOut to focusin/focusout (and vice versa). Just consider them to be the
-    // same event (triggering one another's handlers).  This mechanism allows us to deprecate or change event
-    // names in the future and still make them be interoperable.
-    if (event->hasAliasedType() && !event->immediatePropagationStopped()) {
-        EventListenerMap::iterator result = d->eventListenerMap.find(event->aliasedType());
-        if (result != d->eventListenerMap.end())
-            fireEventListeners(event, d, *result->second);
-    }
     return !event->defaultPrevented();
 }
         

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list