Title: [97380] trunk
Revision
97380
Author
[email protected]
Date
2011-10-13 12:07:00 -0700 (Thu, 13 Oct 2011)

Log Message

Deprecate event.layerX and event.layerY in WebKit
https://bugs.webkit.org/show_bug.cgi?id=69951

Reviewed by Darin Adler.

Source/WebCore:

layerX and layerY were concepts of the old Netscape code that stayed
in WebKit for a long time without changes. Now the code is completely
wrong and Mozilla has expressed some interest in removing it from their
API too.

This is a first step in the removal as layerX and layerY are exposed
in some APIs. Chromium and Win are fine with removing the property
directly, but ObjC needs to deprecate them first.

* bindings/objc/PublicDOMInterfaces.h: Mark the API as deprecated.

* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::layerX):
(WebCore::MouseRelatedEvent::layerY):
* dom/UIEvent.cpp:
(WebCore::UIEvent::layerX):
(WebCore::UIEvent::layerY):
Added a call to warnDeprecatedLayerXYUsage in the previous functions.

(WebCore::UIEvent::warnDeprecatedLayerXYUsage): Print a warning in the
console about the removal of event.layerX and event.layerY in the near future.

* dom/UIEvent.h: Added warnDeprecatedLayerXYUsage.

LayoutTests:

* fast/dom/Window/window-xy-properties-expected.txt:
* fast/events/init-events-expected.txt:
* fast/events/mouse-relative-position-expected.txt:
* fast/events/mouseclick-target-and-positioning-expected.txt:
* fast/events/simulated-click-coords-expected.txt:
* jquery/events-expected.txt:
Updated those tests with the console messages to keep our existing
coverage until we remove the 2 properties.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (97379 => 97380)


--- trunk/LayoutTests/ChangeLog	2011-10-13 19:06:43 UTC (rev 97379)
+++ trunk/LayoutTests/ChangeLog	2011-10-13 19:07:00 UTC (rev 97380)
@@ -1,3 +1,19 @@
+2011-10-13  Julien Chaffraix  <[email protected]>
+
+        Deprecate event.layerX and event.layerY in WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=69951
+
+        Reviewed by Darin Adler.
+
+        * fast/dom/Window/window-xy-properties-expected.txt:
+        * fast/events/init-events-expected.txt:
+        * fast/events/mouse-relative-position-expected.txt:
+        * fast/events/mouseclick-target-and-positioning-expected.txt:
+        * fast/events/simulated-click-coords-expected.txt:
+        * jquery/events-expected.txt:
+        Updated those tests with the console messages to keep our existing
+        coverage until we remove the 2 properties.
+
 2011-10-03  Robert Hogan  <[email protected]>
 
         CSS 2.1 failure: inline-replaced-height-008.htm

Modified: trunk/LayoutTests/fast/dom/Window/window-xy-properties-expected.txt (97379 => 97380)


--- trunk/LayoutTests/fast/dom/Window/window-xy-properties-expected.txt	2011-10-13 19:06:43 UTC (rev 97379)
+++ trunk/LayoutTests/fast/dom/Window/window-xy-properties-expected.txt	2011-10-13 19:07:00 UTC (rev 97380)
@@ -1,3 +1,11 @@
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
 PASS event.clientX is 50
 PASS event.clientY is 50
 PASS event.pageX is 50

Modified: trunk/LayoutTests/fast/events/init-events-expected.txt (97379 => 97380)


--- trunk/LayoutTests/fast/events/init-events-expected.txt	2011-10-13 19:06:43 UTC (rev 97379)
+++ trunk/LayoutTests/fast/events/init-events-expected.txt	2011-10-13 19:07:00 UTC (rev 97380)
@@ -1,3 +1,11 @@
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
 This tests the init functions for all the event DOM classes that have them.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

Modified: trunk/LayoutTests/fast/events/mouse-relative-position-expected.txt (97379 => 97380)


--- trunk/LayoutTests/fast/events/mouse-relative-position-expected.txt	2011-10-13 19:06:43 UTC (rev 97379)
+++ trunk/LayoutTests/fast/events/mouse-relative-position-expected.txt	2011-10-13 19:07:00 UTC (rev 97380)
@@ -1,3 +1,9 @@
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
 span
 
 PASS simulateElementClick(testElement, [100, 100, 200, 200]); is '100, 100, 200, 200'

Modified: trunk/LayoutTests/fast/events/mouseclick-target-and-positioning-expected.txt (97379 => 97380)


--- trunk/LayoutTests/fast/events/mouseclick-target-and-positioning-expected.txt	2011-10-13 19:06:43 UTC (rev 97379)
+++ trunk/LayoutTests/fast/events/mouseclick-target-and-positioning-expected.txt	2011-10-13 19:07:00 UTC (rev 97380)
@@ -1,3 +1,5 @@
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
 This page tests whether a click event propogates with the correct target and positioning. See rdar://problem/4477126.
 
 click inside the red box:[]

Modified: trunk/LayoutTests/fast/events/simulated-click-coords-expected.txt (97379 => 97380)


--- trunk/LayoutTests/fast/events/simulated-click-coords-expected.txt	2011-10-13 19:06:43 UTC (rev 97379)
+++ trunk/LayoutTests/fast/events/simulated-click-coords-expected.txt	2011-10-13 19:07:00 UTC (rev 97380)
@@ -1,3 +1,11 @@
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
 Ensure that simulated click on label elements uses the original mouse coordinates.
 
  Click Me

Modified: trunk/LayoutTests/jquery/event-expected.txt (97379 => 97380)


--- trunk/LayoutTests/jquery/event-expected.txt	2011-10-13 19:06:43 UTC (rev 97379)
+++ trunk/LayoutTests/jquery/event-expected.txt	2011-10-13 19:07:00 UTC (rev 97380)
@@ -1,2 +1,4 @@
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
+CONSOLE MESSAGE: line 1: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
 ALERT: 376 tests of 376 passed, 0 failed.
 

Modified: trunk/Source/WebCore/ChangeLog (97379 => 97380)


--- trunk/Source/WebCore/ChangeLog	2011-10-13 19:06:43 UTC (rev 97379)
+++ trunk/Source/WebCore/ChangeLog	2011-10-13 19:07:00 UTC (rev 97380)
@@ -1,3 +1,34 @@
+2011-10-13  Julien Chaffraix  <[email protected]>
+
+        Deprecate event.layerX and event.layerY in WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=69951
+
+        Reviewed by Darin Adler.
+
+        layerX and layerY were concepts of the old Netscape code that stayed
+        in WebKit for a long time without changes. Now the code is completely
+        wrong and Mozilla has expressed some interest in removing it from their
+        API too.
+
+        This is a first step in the removal as layerX and layerY are exposed
+        in some APIs. Chromium and Win are fine with removing the property
+        directly, but ObjC needs to deprecate them first.
+
+        * bindings/objc/PublicDOMInterfaces.h: Mark the API as deprecated.
+
+        * dom/MouseRelatedEvent.cpp:
+        (WebCore::MouseRelatedEvent::layerX):
+        (WebCore::MouseRelatedEvent::layerY):
+        * dom/UIEvent.cpp:
+        (WebCore::UIEvent::layerX):
+        (WebCore::UIEvent::layerY):
+        Added a call to warnDeprecatedLayerXYUsage in the previous functions.
+
+        (WebCore::UIEvent::warnDeprecatedLayerXYUsage): Print a warning in the
+        console about the removal of event.layerX and event.layerY in the near future.
+
+        * dom/UIEvent.h: Added warnDeprecatedLayerXYUsage.
+
 2011-10-03  Robert Hogan  <[email protected]>
 
         CSS 2.1 failure: inline-replaced-height-008.htm

Modified: trunk/Source/WebCore/bindings/objc/PublicDOMInterfaces.h (97379 => 97380)


--- trunk/Source/WebCore/bindings/objc/PublicDOMInterfaces.h	2011-10-13 19:06:43 UTC (rev 97379)
+++ trunk/Source/WebCore/bindings/objc/PublicDOMInterfaces.h	2011-10-13 19:07:00 UTC (rev 97380)
@@ -1065,8 +1065,8 @@
 @property(readonly) int detail;
 @property(readonly) int keyCode AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
 @property(readonly) int charCode AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
-@property(readonly) int layerX AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
-@property(readonly) int layerY AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+@property(readonly) int layerX AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED;
+@property(readonly) int layerY AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED;
 @property(readonly) int pageX AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
 @property(readonly) int pageY AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
 @property(readonly) int which AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;

Modified: trunk/Source/WebCore/dom/MouseRelatedEvent.cpp (97379 => 97380)


--- trunk/Source/WebCore/dom/MouseRelatedEvent.cpp	2011-10-13 19:06:43 UTC (rev 97379)
+++ trunk/Source/WebCore/dom/MouseRelatedEvent.cpp	2011-10-13 19:07:00 UTC (rev 97380)
@@ -190,6 +190,7 @@
 
 int MouseRelatedEvent::layerX()
 {
+    warnDeprecatedLayerXYUsage();
     if (!m_hasCachedRelativePosition)
         computeRelativePosition();
     return m_layerLocation.x();
@@ -197,6 +198,7 @@
 
 int MouseRelatedEvent::layerY()
 {
+    warnDeprecatedLayerXYUsage();
     if (!m_hasCachedRelativePosition)
         computeRelativePosition();
     return m_layerLocation.y();

Modified: trunk/Source/WebCore/dom/UIEvent.cpp (97379 => 97380)


--- trunk/Source/WebCore/dom/UIEvent.cpp	2011-10-13 19:06:43 UTC (rev 97379)
+++ trunk/Source/WebCore/dom/UIEvent.cpp	2011-10-13 19:07:00 UTC (rev 97380)
@@ -23,6 +23,7 @@
 #include "config.h"
 #include "UIEvent.h"
 
+#include "Console.h"
 #include "DOMWindow.h"
 #include "EventDispatcher.h"
 
@@ -72,11 +73,13 @@
 
 int UIEvent::layerX()
 {
+    warnDeprecatedLayerXYUsage();
     return 0;
 }
 
 int UIEvent::layerY()
 {
+    warnDeprecatedLayerXYUsage();
     return 0;
 }
 
@@ -95,6 +98,13 @@
     return 0;
 }
 
+void UIEvent::warnDeprecatedLayerXYUsage()
+{
+    DEFINE_STATIC_LOCAL(String, consoleMessage , ("event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future."));
+    if (m_view)
+        m_view->console()->addMessage(JSMessageSource, LogMessageType, WarningMessageLevel, consoleMessage, 1, String());
+}
+
 PassRefPtr<FocusInEventDispatchMediator> FocusInEventDispatchMediator::create(PassRefPtr<Event> event, PassRefPtr<Node> oldFocusedNode)
 {
     return adoptRef(new FocusInEventDispatchMediator(event, oldFocusedNode));

Modified: trunk/Source/WebCore/dom/UIEvent.h (97379 => 97380)


--- trunk/Source/WebCore/dom/UIEvent.h	2011-10-13 19:06:43 UTC (rev 97379)
+++ trunk/Source/WebCore/dom/UIEvent.h	2011-10-13 19:07:00 UTC (rev 97380)
@@ -66,6 +66,9 @@
         UIEvent();
         UIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView>, int detail);
 
+        // layerX and layerY are deprecated. This reports a message to the console until we remove them.
+        void warnDeprecatedLayerXYUsage();
+
     private:
         RefPtr<AbstractView> m_view;
         int m_detail;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to