From 19f4be38d2e4e29626c4cc3b3066fa61986ac2b5 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 5 May 2020 15:04:18 -0400 Subject: [PATCH] dom: Implement stub queryCommandSupported. --- components/script/dom/document.rs | 5 +++++ components/script/dom/webidls/Document.webidl | 2 +- .../html/dom/idlharness.https.html.ini | 21 ------------------- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 86c5b1caaa11..4577835d24e9 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -3669,6 +3669,11 @@ impl ProfilerMetadataFactory for Document { } impl DocumentMethods for Document { + // https://w3c.github.io/editing/ActiveDocuments/execCommand.html#querycommandsupported() + fn QueryCommandSupported(&self, _command: DOMString) -> bool { + false + } + // https://drafts.csswg.org/cssom/#dom-document-stylesheets fn StyleSheets(&self) -> DomRoot { self.stylesheet_list.or_init(|| { diff --git a/components/script/dom/webidls/Document.webidl b/components/script/dom/webidls/Document.webidl index 8ca4bbe50a13..d2429e514891 100644 --- a/components/script/dom/webidls/Document.webidl +++ b/components/script/dom/webidls/Document.webidl @@ -142,7 +142,7 @@ partial /*sealed*/ interface Document { // boolean queryCommandEnabled(DOMString commandId); // boolean queryCommandIndeterm(DOMString commandId); // boolean queryCommandState(DOMString commandId); - // boolean queryCommandSupported(DOMString commandId); + boolean queryCommandSupported(DOMString commandId); // DOMString queryCommandValue(DOMString commandId); // special event handler IDL attributes that only apply to Document objects diff --git a/tests/wpt/metadata/html/dom/idlharness.https.html.ini b/tests/wpt/metadata/html/dom/idlharness.https.html.ini index 3fa4a76ee55b..ead25462f306 100644 --- a/tests/wpt/metadata/html/dom/idlharness.https.html.ini +++ b/tests/wpt/metadata/html/dom/idlharness.https.html.ini @@ -1417,9 +1417,6 @@ [Document interface: iframe.contentDocument must inherit property "dir" with the proper type] expected: FAIL - [Document interface: new Document() must inherit property "queryCommandSupported(DOMString)" with the proper type] - expected: FAIL - [Window interface: attribute onsecuritypolicyviolation] expected: FAIL @@ -1441,9 +1438,6 @@ [Window interface: attribute menubar] expected: FAIL - [Document interface: calling queryCommandSupported(DOMString) on documentWithHandlers with too few arguments must throw TypeError] - expected: FAIL - [Document interface: attribute designMode] expected: FAIL @@ -1480,15 +1474,9 @@ [Document interface: calling execCommand(DOMString, boolean, DOMString) on new Document() with too few arguments must throw TypeError] expected: FAIL - [Document interface: calling queryCommandSupported(DOMString) on new Document() with too few arguments must throw TypeError] - expected: FAIL - [Window interface: operation focus()] expected: FAIL - [Document interface: documentWithHandlers must inherit property "queryCommandSupported(DOMString)" with the proper type] - expected: FAIL - [Window interface: attribute scrollbars] expected: FAIL @@ -1516,9 +1504,6 @@ [Document interface: iframe.contentDocument must inherit property "queryCommandValue(DOMString)" with the proper type] expected: FAIL - [Document interface: operation queryCommandSupported(DOMString)] - expected: FAIL - [Document interface: iframe.contentDocument must inherit property "all" with the proper type] expected: FAIL @@ -1588,9 +1573,6 @@ [Window interface: window must inherit property "blur()" with the proper type] expected: FAIL - [Document interface: iframe.contentDocument must inherit property "queryCommandSupported(DOMString)" with the proper type] - expected: FAIL - [Document interface: calling execCommand(DOMString, boolean, DOMString) on iframe.contentDocument with too few arguments must throw TypeError] expected: FAIL @@ -1621,9 +1603,6 @@ [Document interface: iframe.contentDocument must inherit property "queryCommandEnabled(DOMString)" with the proper type] expected: FAIL - [Document interface: calling queryCommandSupported(DOMString) on iframe.contentDocument with too few arguments must throw TypeError] - expected: FAIL - [Window interface: operation blur()] expected: FAIL