Browse Source

LibWeb: Make window.clientInformation [Replaceable] per spec IDL

Andreas Kling 6 months ago
parent
commit
8d8aa964da

+ 1 - 1
Libraries/LibWeb/HTML/Window.idl

@@ -50,7 +50,7 @@ interface Window : EventTarget {
 
 
     // the user agent
     // the user agent
     readonly attribute Navigator navigator;
     readonly attribute Navigator navigator;
-    [ImplementedAs=navigator] readonly attribute Navigator clientInformation; // legacy alias of .navigator
+    [Replaceable, ImplementedAs=navigator] readonly attribute Navigator clientInformation; // legacy alias of .navigator
 
 
     // user prompts
     // user prompts
     undefined alert();
     undefined alert();

+ 7 - 0
Tests/LibWeb/Text/expected/wpt-import/html/webappapis/system-state-and-capabilities/the-navigator-object/clientinformation.window.txt

@@ -0,0 +1,7 @@
+Harness status: OK
+
+Found 2 tests
+
+2 Pass
+Pass	window.clientInformation exists and equals window.navigator
+Pass	window.clientInformation is Replaceable

+ 8 - 0
Tests/LibWeb/Text/input/wpt-import/html/webappapis/system-state-and-capabilities/the-navigator-object/clientinformation.window.html

@@ -0,0 +1,8 @@
+<!doctype html>
+<meta charset=utf-8>
+
+<script src="../../../../resources/testharness.js"></script>
+<script src="../../../../resources/testharnessreport.js"></script>
+
+<div id=log></div>
+<script src="../../../../html/webappapis/system-state-and-capabilities/the-navigator-object/clientinformation.window.js"></script>

+ 8 - 0
Tests/LibWeb/Text/input/wpt-import/html/webappapis/system-state-and-capabilities/the-navigator-object/clientinformation.window.js

@@ -0,0 +1,8 @@
+test(() => {
+  assert_equals(window.clientInformation, window.navigator);
+}, "window.clientInformation exists and equals window.navigator");
+
+test(() => {
+  window.clientInformation = 1;
+  assert_equals(window.clientInformation, 1);
+}, "window.clientInformation is Replaceable");