Ensure PointerEvent is not visible when disabled
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2018 17:35:39 +0000 (17:35 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2018 17:35:39 +0000 (17:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189889
<rdar://problem/44708253>

Reviewed by Eric Carlson.

Source/WebCore:

Test: pointerevents/disabled.html

* bindings/js/WebCoreBuiltinNames.h: Now that it is enabled at runtime, it needs
a built-in name.
* dom/PointerEvent.idl: Add EnabledAtRuntime.

LayoutTests:

A test that explicitly disables PointerEvents and checks
that the interface is not visible.

* pointerevents/disabled-expected.html: Added.
* pointerevents/disabled.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236410 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/pointerevents/disabled-expected.html [new file with mode: 0644]
LayoutTests/pointerevents/disabled.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/WebCoreBuiltinNames.h
Source/WebCore/dom/PointerEvent.idl

index cdb533d..769ea2a 100644 (file)
@@ -1,3 +1,17 @@
+2018-09-22  Dean Jackson  <dino@apple.com>
+
+        Ensure PointerEvent is not visible when disabled
+        https://bugs.webkit.org/show_bug.cgi?id=189889
+        <rdar://problem/44708253>
+
+        Reviewed by Eric Carlson.
+
+        A test that explicitly disables PointerEvents and checks
+        that the interface is not visible.
+
+        * pointerevents/disabled-expected.html: Added.
+        * pointerevents/disabled.html: Added.
+
 2018-09-24  Truitt Savell  <tsavell@apple.com>
 
         [ iOS ] Layout Tests in media/media-fragments/ are flaky - Remved Debug only as tests are flakey on Release. 
diff --git a/LayoutTests/pointerevents/disabled-expected.html b/LayoutTests/pointerevents/disabled-expected.html
new file mode 100644 (file)
index 0000000..b7eb659
--- /dev/null
@@ -0,0 +1,3 @@
+<!DOCTYPE html>
+<p>The PointerEvent interface shouldn't be visible when the feature is disabled.</p>
+<p>window.PointerEvent == <span>undefined</span></p>
diff --git a/LayoutTests/pointerevents/disabled.html b/LayoutTests/pointerevents/disabled.html
new file mode 100644 (file)
index 0000000..ed8ea81
--- /dev/null
@@ -0,0 +1,9 @@
+<!DOCTYPE html><!-- webkit-test-runner [ experimental:PointerEventsEnabled=false ] -->
+<p>The PointerEvent interface shouldn't be visible when the feature is disabled.</p>
+<p>window.PointerEvent == <span></span></p>
+<script>
+window.addEventListener("load", () => {
+    const output = document.querySelector("span");
+    output.textContent = `${window.PointerEvent}`;
+}, false);
+</script>
index 5f9df48..c12ec74 100644 (file)
@@ -1,3 +1,17 @@
+2018-09-22  Dean Jackson  <dino@apple.com>
+
+        Ensure PointerEvent is not visible when disabled
+        https://bugs.webkit.org/show_bug.cgi?id=189889
+        <rdar://problem/44708253>
+
+        Reviewed by Eric Carlson.
+
+        Test: pointerevents/disabled.html
+
+        * bindings/js/WebCoreBuiltinNames.h: Now that it is enabled at runtime, it needs
+        a built-in name.
+        * dom/PointerEvent.idl: Add EnabledAtRuntime.
+
 2018-09-24  Alicia Boya GarcĂ­a  <aboya@igalia.com>
 
         [MSE][GStreamer] Pull demuxed samples in batches
index 484e6ba..a035b33 100644 (file)
@@ -120,6 +120,7 @@ namespace WebCore {
     macro(PerformanceObserverEntryList) \
     macro(PerformanceResourceTiming) \
     macro(PerformanceServerTiming) \
+    macro(PointerEvent) \
     macro(PublicKeyCredential) \
     macro(RTCDTMFSender) \
     macro(RTCDTMFToneChangeEvent) \
index 16ff64c..f9837f5 100644 (file)
@@ -36,9 +36,11 @@ dictionary PointerEventInit : MouseEventInit {
     boolean isPrimary = false;
 };
 
-[Constructor(DOMString type, optional PointerEventInit eventInitDict),
- Exposed=Window]
-interface PointerEvent : MouseEvent {
+[
+    EnabledAtRuntime=PointerEvents,
+    Constructor(DOMString type, optional PointerEventInit eventInitDict),
+    Exposed=Window
+] interface PointerEvent : MouseEvent {
     readonly attribute long pointerId;
     readonly attribute double width;
     readonly attribute double height;