- Revision
- 210045
- Author
- [email protected]
- Date
- 2016-12-20 15:53:48 -0800 (Tue, 20 Dec 2016)
Log Message
Remove initEvent quirk
https://bugs.webkit.org/show_bug.cgi?id=166284
Reviewed by Dan Bernstein.
LayoutTests/imported/w3c:
* web-platform-tests/dom/interfaces-expected.txt:
We regress conformance, but a change has been proposed to the spec. Hopefully this will be a temporary regression.
Source/WebCore:
We added this quirk in r207908 and expanded it in r209946 and r210034.
Many web compatibility issues have been found, which leads us to believe that many more exist.
This reverts the behavior to match how it was before r203848.
This change was proposed to the spec in https://github.com/whatwg/dom/issues/387
* dom/Event.cpp:
(WebCore::Event::initEventForBindings): Deleted.
* dom/Event.h:
* dom/Event.idl:
* platform/RuntimeApplicationChecks.h:
* platform/RuntimeApplicationChecks.mm:
(WebCore::IOSApplication::isBaiduNuomi): Deleted.
(WebCore::IOSApplication::isAutoNaviAMap): Deleted.
(WebCore::IOSApplication::isFlipboard): Deleted.
Modified Paths
Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (210044 => 210045)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2016-12-20 23:42:25 UTC (rev 210044)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2016-12-20 23:53:48 UTC (rev 210045)
@@ -1,3 +1,13 @@
+2016-12-20 Alex Christensen <[email protected]>
+
+ Remove initEvent quirk
+ https://bugs.webkit.org/show_bug.cgi?id=166284
+
+ Reviewed by Dan Bernstein.
+
+ * web-platform-tests/dom/interfaces-expected.txt:
+ We regress conformance, but a change has been proposed to the spec. Hopefully this will be a temporary regression.
+
2016-12-20 Nael Ouedraogo <[email protected]>
WebRTC: RTCPeerConnection constructor argument should be optional
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt (210044 => 210045)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt 2016-12-20 23:42:25 UTC (rev 210044)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt 2016-12-20 23:53:48 UTC (rev 210045)
@@ -46,7 +46,9 @@
PASS Event interface: document.createEvent("Event") must have own property "isTrusted"
PASS Event interface: document.createEvent("Event") must inherit property "timeStamp" with the proper type (15)
PASS Event interface: document.createEvent("Event") must inherit property "initEvent" with the proper type (16)
-PASS Event interface: calling initEvent(DOMString,boolean,boolean) on document.createEvent("Event") with too few arguments must throw TypeError
+FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on document.createEvent("Event") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
+ fn.apply(obj, args);
+ }" did not throw
PASS Event must be primary interface of new Event("foo")
PASS Stringification of new Event("foo")
PASS Event interface: new Event("foo") must inherit property "type" with the proper type (0)
@@ -66,7 +68,9 @@
PASS Event interface: new Event("foo") must have own property "isTrusted"
PASS Event interface: new Event("foo") must inherit property "timeStamp" with the proper type (15)
PASS Event interface: new Event("foo") must inherit property "initEvent" with the proper type (16)
-PASS Event interface: calling initEvent(DOMString,boolean,boolean) on new Event("foo") with too few arguments must throw TypeError
+FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on new Event("foo") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
+ fn.apply(obj, args);
+ }" did not throw
PASS CustomEvent interface: existence and properties of interface object
PASS CustomEvent interface object length
PASS CustomEvent interface object name
@@ -96,7 +100,9 @@
PASS Event interface: new CustomEvent("foo") must have own property "isTrusted"
PASS Event interface: new CustomEvent("foo") must inherit property "timeStamp" with the proper type (15)
PASS Event interface: new CustomEvent("foo") must inherit property "initEvent" with the proper type (16)
-PASS Event interface: calling initEvent(DOMString,boolean,boolean) on new CustomEvent("foo") with too few arguments must throw TypeError
+FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on new CustomEvent("foo") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
+ fn.apply(obj, args);
+ }" did not throw
PASS EventTarget interface: existence and properties of interface object
PASS EventTarget interface object length
PASS EventTarget interface object name
Modified: trunk/Source/WebCore/ChangeLog (210044 => 210045)
--- trunk/Source/WebCore/ChangeLog 2016-12-20 23:42:25 UTC (rev 210044)
+++ trunk/Source/WebCore/ChangeLog 2016-12-20 23:53:48 UTC (rev 210045)
@@ -1,3 +1,25 @@
+2016-12-20 Alex Christensen <[email protected]>
+
+ Remove initEvent quirk
+ https://bugs.webkit.org/show_bug.cgi?id=166284
+
+ Reviewed by Dan Bernstein.
+
+ We added this quirk in r207908 and expanded it in r209946 and r210034.
+ Many web compatibility issues have been found, which leads us to believe that many more exist.
+ This reverts the behavior to match how it was before r203848.
+ This change was proposed to the spec in https://github.com/whatwg/dom/issues/387
+
+ * dom/Event.cpp:
+ (WebCore::Event::initEventForBindings): Deleted.
+ * dom/Event.h:
+ * dom/Event.idl:
+ * platform/RuntimeApplicationChecks.h:
+ * platform/RuntimeApplicationChecks.mm:
+ (WebCore::IOSApplication::isBaiduNuomi): Deleted.
+ (WebCore::IOSApplication::isAutoNaviAMap): Deleted.
+ (WebCore::IOSApplication::isFlipboard): Deleted.
+
2016-12-20 JF Bastien <[email protected]>
INDIE_UI: fix cmake build
Modified: trunk/Source/WebCore/dom/Event.cpp (210044 => 210045)
--- trunk/Source/WebCore/dom/Event.cpp 2016-12-20 23:42:25 UTC (rev 210044)
+++ trunk/Source/WebCore/dom/Event.cpp 2016-12-20 23:53:48 UTC (rev 210045)
@@ -26,7 +26,6 @@
#include "EventNames.h"
#include "EventPath.h"
#include "EventTarget.h"
-#include "RuntimeApplicationChecks.h"
#include "UserGestureIndicator.h"
#include <wtf/CurrentTime.h>
@@ -90,25 +89,6 @@
m_cancelable = cancelableArg;
}
-ExceptionOr<void> Event::initEventForBindings(ScriptExecutionContext& scriptExecutionContext, const AtomicString& type, bool bubbles)
-{
-#if PLATFORM(IOS)
- // FIXME: Temporary quirk for Baidu Nuomi App which calls initEvent() with too few parameters (rdar://problem/28707838).
- // FIXME: Quirk also needed for Flipboard for same reason (rdar://problem/28264190).
- // FIXME: We really ought to consider if this is web compatible. AutoNavi also uses initEvent with one parameter. rdar://problem/29420268
- if (IOSApplication::isBaiduNuomi() || IOSApplication::isFlipboard() || IOSApplication::isAutoNaviAMap()) {
- scriptExecutionContext.addConsoleMessage(MessageSource::JS, MessageLevel::Warning, ASCIILiteral("Calling Event.prototype.initEvent() with less than 3 parameters is deprecated."));
- initEvent(type, bubbles, false);
- return { };
- }
-#else
- UNUSED_PARAM(scriptExecutionContext);
- UNUSED_PARAM(type);
- UNUSED_PARAM(bubbles);
-#endif
- return Exception { TypeError, ASCIILiteral("Not enough arguments") };
-}
-
bool Event::composed() const
{
if (m_composed)
Modified: trunk/Source/WebCore/dom/Event.h (210044 => 210045)
--- trunk/Source/WebCore/dom/Event.h 2016-12-20 23:42:25 UTC (rev 210044)
+++ trunk/Source/WebCore/dom/Event.h 2016-12-20 23:53:48 UTC (rev 210045)
@@ -96,7 +96,6 @@
virtual ~Event();
WEBCORE_EXPORT void initEvent(const AtomicString& type, bool canBubble, bool cancelable);
- ExceptionOr<void> initEventForBindings(ScriptExecutionContext&, const AtomicString& type, bool bubbles); // Quirk.
bool isInitialized() const { return m_isInitialized; }
Modified: trunk/Source/WebCore/dom/Event.idl (210044 => 210045)
--- trunk/Source/WebCore/dom/Event.idl 2016-12-20 23:42:25 UTC (rev 210044)
+++ trunk/Source/WebCore/dom/Event.idl 2016-12-20 23:53:48 UTC (rev 210045)
@@ -66,8 +66,7 @@
void stopPropagation();
void preventDefault();
- void initEvent(DOMString type, boolean bubbles, boolean cancelable); // Standard.
- [MayThrowException, ImplementedAs=initEventForBindings, CallWith=ScriptExecutionContext] void initEvent(DOMString type, optional boolean bubbles = false); // Quirk.
+ void initEvent(optional DOMString type = "undefined", optional boolean bubbles = false, optional boolean cancelable = false);
readonly attribute boolean defaultPrevented;
void stopImmediatePropagation();
Modified: trunk/Source/WebCore/platform/RuntimeApplicationChecks.h (210044 => 210045)
--- trunk/Source/WebCore/platform/RuntimeApplicationChecks.h 2016-12-20 23:42:25 UTC (rev 210044)
+++ trunk/Source/WebCore/platform/RuntimeApplicationChecks.h 2016-12-20 23:53:48 UTC (rev 210045)
@@ -76,9 +76,6 @@
WEBCORE_EXPORT bool isWebProcess();
bool isIBooks();
WEBCORE_EXPORT bool isTheSecretSocietyHiddenMystery();
-bool isBaiduNuomi();
-bool isFlipboard();
-bool isAutoNaviAMap();
} // IOSApplication
Modified: trunk/Source/WebCore/platform/RuntimeApplicationChecks.mm (210044 => 210045)
--- trunk/Source/WebCore/platform/RuntimeApplicationChecks.mm 2016-12-20 23:42:25 UTC (rev 210044)
+++ trunk/Source/WebCore/platform/RuntimeApplicationChecks.mm 2016-12-20 23:53:48 UTC (rev 210045)
@@ -253,24 +253,6 @@
return isTheSecretSocietyHiddenMystery;
}
-bool IOSApplication::isBaiduNuomi()
-{
- static bool isBaiduNuomi = applicationBundleIsEqualTo("com.renren-inc.nuomi");
- return isBaiduNuomi;
-}
-
-bool IOSApplication::isAutoNaviAMap()
-{
- static bool isBaiduNuomi = applicationBundleIsEqualTo("com.autonavi.amap");
- return isBaiduNuomi;
-}
-
-bool IOSApplication::isFlipboard()
-{
- static bool isFlipboard = applicationBundleIsEqualTo("com.flipboard.flipboard-ipad");
- return isFlipboard;
-}
-
#endif
} // namespace WebCore