Title: [231849] trunk
Revision
231849
Author
commit-qu...@webkit.org
Date
2018-05-16 09:20:26 -0700 (Wed, 16 May 2018)

Log Message

Remove Document#selectedStylesheetSet/preferredStylesheetSet
https://bugs.webkit.org/show_bug.cgi?id=185381

Patch by Chris Nardi <cna...@chromium.org> on 2018-05-16
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Refresh historical CSSOM test from upstream to test this change.

* web-platform-tests/cssom/historical-expected.txt:
* web-platform-tests/cssom/historical.html:

Source/WebCore:

Document#selectedStylesheetSet/preferredStylesheetSet are non-standard methods that
are only implemented WebKit. Blink removed these methods in https://crbug.com/690609.
The standard versions of these methods are are no longer in the spec. Remove them
entirely from our implementation.

Updated existing tests and imported/w3c/web-platform-tests/cssom/historical.html.

* dom/Document.cpp:
(WebCore::Document::processHttpEquiv):
* dom/Document.h:
* dom/Document.idl:
* style/StyleScope.cpp:
(WebCore::Style::Scope::collectActiveStyleSheets):
* style/StyleScope.h:
(WebCore::Style::Scope::preferredStylesheetSetName const):

Source/WebKit:

Make API methods for Document#selectedStylesheetSet/preferredStylesheetSet do nothing.

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
(webkit_dom_document_set_property):
(webkit_dom_document_get_property):
(webkit_dom_document_get_preferred_stylesheet_set):
(webkit_dom_document_get_selected_stylesheet_set):
(webkit_dom_document_set_selected_stylesheet_set):

Source/WebKitLegacy/mac:

Mark API methods for Document#selectedStylesheetSet/preferredStylesheetSet as deprecated
and make them do nothing.

* DOM/DOMDocument.h:
* DOM/DOMDocument.mm:
(-[DOMDocument preferredStylesheetSet]):
(-[DOMDocument selectedStylesheetSet]):
(-[DOMDocument setSelectedStylesheetSet:]):

LayoutTests:

Update tests to remove selectedStylesheetSet/preferredStylesheetSet.

* fast/css/link-disabled-attr-expected.txt:
* fast/css/link-disabled-attr.html:
* fast/dom/assign-to-prototype-accessor-on-prototype-should-throw-expected.txt:
* fast/dom/assign-to-prototype-accessor-on-prototype-should-throw.html:
* fast/dom/document-attribute-js-null-expected.txt:
* fast/dom/document-attribute-js-null.html:
* fast/shadow-dom/link-element-in-shadow-tree-expected.txt:
* fast/shadow-dom/link-element-in-shadow-tree.html:
* fast/shadow-dom/selected-stylesheet-in-shadow-tree-expected.txt: Removed.
* fast/shadow-dom/selected-stylesheet-in-shadow-tree.html: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (231848 => 231849)


--- trunk/LayoutTests/ChangeLog	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/LayoutTests/ChangeLog	2018-05-16 16:20:26 UTC (rev 231849)
@@ -1,3 +1,23 @@
+2018-05-16  Chris Nardi  <cna...@chromium.org>
+
+        Remove Document#selectedStylesheetSet/preferredStylesheetSet
+        https://bugs.webkit.org/show_bug.cgi?id=185381
+
+        Reviewed by Darin Adler.
+
+        Update tests to remove selectedStylesheetSet/preferredStylesheetSet.
+
+        * fast/css/link-disabled-attr-expected.txt:
+        * fast/css/link-disabled-attr.html:
+        * fast/dom/assign-to-prototype-accessor-on-prototype-should-throw-expected.txt:
+        * fast/dom/assign-to-prototype-accessor-on-prototype-should-throw.html:
+        * fast/dom/document-attribute-js-null-expected.txt:
+        * fast/dom/document-attribute-js-null.html:
+        * fast/shadow-dom/link-element-in-shadow-tree-expected.txt:
+        * fast/shadow-dom/link-element-in-shadow-tree.html:
+        * fast/shadow-dom/selected-stylesheet-in-shadow-tree-expected.txt: Removed.
+        * fast/shadow-dom/selected-stylesheet-in-shadow-tree.html: Removed.
+
 2018-05-16  Per Arne Vollan  <pvol...@apple.com>
 
         Mark animations/keyframes-dynamic.html and related tests as failing on Windows.

Modified: trunk/LayoutTests/fast/css/link-disabled-attr-expected.txt (231848 => 231849)


--- trunk/LayoutTests/fast/css/link-disabled-attr-expected.txt	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/LayoutTests/fast/css/link-disabled-attr-expected.txt	2018-05-16 16:20:26 UTC (rev 231849)
@@ -19,11 +19,7 @@
 FAIL link.disabled should be true. Was false.
 PASS link.sheet is non-null.
 FAIL getComputedStyle(testElement).backgroundColor should be rgb(0, 128, 0). Was rgba(0, 0, 0, 0).
-FAIL link.disabled should be true. Was false.
 PASS getComputedStyle(testElement).backgroundColor is originalBG
-PASS link.disabled is false
-FAIL getComputedStyle(testElement).backgroundColor should be rgb(0, 128, 0). Was rgba(0, 0, 0, 0).
-PASS getComputedStyle(testElement).backgroundColor is originalBG
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/css/link-disabled-attr.html (231848 => 231849)


--- trunk/LayoutTests/fast/css/link-disabled-attr.html	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/LayoutTests/fast/css/link-disabled-attr.html	2018-05-16 16:20:26 UTC (rev 231849)
@@ -75,19 +75,6 @@
     shouldBeNonNull("link.sheet");
     shouldBe("getComputedStyle(testElement).backgroundColor", "'rgb(0, 128, 0)'");
 
-    // Enabling a stylsheet set modifies disabled status of style sheets.
-
-    document.selectedStyleSheetSet = "nosuchset";
-    shouldBeTrue("link.disabled");
-    shouldBe("getComputedStyle(testElement).backgroundColor", "originalBG");
-
-    document.selectedStyleSheetSet = "altset";
-    shouldBeFalse("link.disabled");
-    shouldBe("getComputedStyle(testElement).backgroundColor", "'rgb(0, 128, 0)'");
-
-    // Disabling a stylesheet *after* its stylesheet set has been selected
-    // de-activates it.
-
     link.disabled = true;
     shouldBe("getComputedStyle(testElement).backgroundColor", "originalBG");
 

Modified: trunk/LayoutTests/fast/dom/assign-to-prototype-accessor-on-prototype-should-throw-expected.txt (231848 => 231849)


--- trunk/LayoutTests/fast/dom/assign-to-prototype-accessor-on-prototype-should-throw-expected.txt	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/LayoutTests/fast/dom/assign-to-prototype-accessor-on-prototype-should-throw-expected.txt	2018-05-16 16:20:26 UTC (rev 231849)
@@ -4,7 +4,6 @@
 
 
 PASS document.prototype._oncopy_ = "fail" threw exception TypeError: undefined is not an object (evaluating 'document.prototype._oncopy_ = "fail"').
-PASS Document.prototype.selectedStylesheetSet = "fail" threw exception TypeError: The Document.selectedStylesheetSet setter can only be used on instances of Document.
 PASS HTMLElement.prototype.innerText = "fail" threw exception TypeError: The HTMLElement.innerText setter can only be used on instances of HTMLElement.
 PASS successfullyParsed is true
 

Modified: trunk/LayoutTests/fast/dom/assign-to-prototype-accessor-on-prototype-should-throw.html (231848 => 231849)


--- trunk/LayoutTests/fast/dom/assign-to-prototype-accessor-on-prototype-should-throw.html	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/LayoutTests/fast/dom/assign-to-prototype-accessor-on-prototype-should-throw.html	2018-05-16 16:20:26 UTC (rev 231849)
@@ -6,7 +6,6 @@
 description("Makes sure that assigning to a DOM property directly on the prototype throws a TypeError.");
 
 shouldThrow('document.prototype._oncopy_ = "fail"');
-shouldThrow('Document.prototype.selectedStylesheetSet = "fail"');
 shouldThrow('HTMLElement.prototype.innerText = "fail"');
 
 </script>

Modified: trunk/LayoutTests/fast/dom/document-attribute-js-null-expected.txt (231848 => 231849)


--- trunk/LayoutTests/fast/dom/document-attribute-js-null-expected.txt	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/LayoutTests/fast/dom/document-attribute-js-null-expected.txt	2018-05-16 16:20:26 UTC (rev 231849)
@@ -1,7 +1,6 @@
 This test setting various attributes of documents to _javascript_ null.
 
 TEST SUCCEEDED: Got the expected exception (9). [tested Document.xmlVersion]
-TEST SUCCEEDED: The value was null. [tested Document.selectedStylesheetSet]
 
 TEST SUCCEEDED: The value was the string 'null'. [tested HTMLDocument.title]
 TEST SUCCEEDED: The value was the empty string. [tested HTMLDocument.cookie]

Modified: trunk/LayoutTests/fast/dom/document-attribute-js-null.html (231848 => 231849)


--- trunk/LayoutTests/fast/dom/document-attribute-js-null.html	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/LayoutTests/fast/dom/document-attribute-js-null.html	2018-05-16 16:20:26 UTC (rev 231849)
@@ -64,8 +64,7 @@
                     typeName: 'Document',
                     docToUse: xmlDoc,
                     attributes: [
-                        {name: 'xmlVersion', expectedExceptionCode: 9},
-                        {name: 'selectedStylesheetSet', expectedNull: null}
+                        {name: 'xmlVersion', expectedExceptionCode: 9}
                     ]
                 },
                 {

Modified: trunk/LayoutTests/fast/shadow-dom/link-element-in-shadow-tree-expected.txt (231848 => 231849)


--- trunk/LayoutTests/fast/shadow-dom/link-element-in-shadow-tree-expected.txt	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/LayoutTests/fast/shadow-dom/link-element-in-shadow-tree-expected.txt	2018-05-16 16:20:26 UTC (rev 231849)
@@ -7,6 +7,4 @@
 PASS Style rules loaded inside a shadow tree with open mode must apply to a div in the shadow tree 
 PASS :host style rules loaded inside a shadow tree with closed mode must apply to the host element 
 PASS :host style rules loaded inside a shadow tree with open mode must apply to the host element 
-PASS Link elements should load stylesheets inside a connected shadow tree with closed mode 
-PASS Link elements should load stylesheets inside a connected shadow tree with open mode 
 

Modified: trunk/LayoutTests/fast/shadow-dom/link-element-in-shadow-tree.html (231848 => 231849)


--- trunk/LayoutTests/fast/shadow-dom/link-element-in-shadow-tree.html	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/LayoutTests/fast/shadow-dom/link-element-in-shadow-tree.html	2018-05-16 16:20:26 UTC (rev 231849)
@@ -119,25 +119,6 @@
 
 test_loaded_stylesheet_rule_in_shadow_tree_applies_to_host('closed');
 test_loaded_stylesheet_rule_in_shadow_tree_applies_to_host('open');
-
-function test_title_is_ignored_in_shadow_tree(mode) {
-    promise_test(() => {
-        let doc;
-        return create_iframe().then((contentWindow) => {
-            doc = contentWindow.document;
-            const host = doc.createElement('div');
-            const shadowRoot = host.attachShadow({mode: mode});
-            shadowRoot.innerHTML = `<style title="foo"></style>`;
-            doc.body.appendChild(host);
-        }).then(() => {
-            assert_equals(doc.selectedStylesheetSet, null);
-        });
-    }, `Link elements should load stylesheets inside a connected shadow tree with ${mode} mode`);
-}
-
-test_title_is_ignored_in_shadow_tree('closed');
-test_title_is_ignored_in_shadow_tree('open');
-
 </script>
 </html>
 </body>

Deleted: trunk/LayoutTests/fast/shadow-dom/selected-stylesheet-in-shadow-tree-expected.txt (231848 => 231849)


--- trunk/LayoutTests/fast/shadow-dom/selected-stylesheet-in-shadow-tree-expected.txt	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/LayoutTests/fast/shadow-dom/selected-stylesheet-in-shadow-tree-expected.txt	2018-05-16 16:20:26 UTC (rev 231849)
@@ -1,8 +0,0 @@
-
-PASS The title attribute on the style element in a document must set the preferred stylesheet. 
-PASS The title attribute on the style element inside a closed shadow tree must not set the preferred stylesheet. 
-PASS The title attribute on the style element inside an open shadow tree must not set the preferred stylesheet. 
-PASS The title attribute on the link element in a document must set the preferred stylesheet. 
-PASS The title attribute on the link element inside a closed shadow tree must not set the preferred stylesheet. 
-PASS The title attribute on the link element inside an open shadow tree must not set the preferred stylesheet. 
-

Deleted: trunk/LayoutTests/fast/shadow-dom/selected-stylesheet-in-shadow-tree.html (231848 => 231849)


--- trunk/LayoutTests/fast/shadow-dom/selected-stylesheet-in-shadow-tree.html	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/LayoutTests/fast/shadow-dom/selected-stylesheet-in-shadow-tree.html	2018-05-16 16:20:26 UTC (rev 231849)
@@ -1,99 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>Shadow DOM: Link and style elements inside a shadow tree should not affect the preferred stylesheet</title>
-<meta name="author" title="Ryosuke Niwa" href=""
-<meta name="assert" content="Link and style elements inside a shadow tree should not affect the preferred stylesheet">
-<script src=''></script>
-<script src=''></script>
-</head>
-<body>
-<script>
-
-function make_iframe(markup, testFunction) {
-    return () => {
-        const iframe = document.createElement('iframe');
-        return new Promise(function (resolve) {
-            iframe._onload_ = () => { resolve(iframe.contentDocument); };
-            document.body.appendChild(iframe);
-        }).then(function (doc) {
-            doc.open();
-            doc.write(markup);
-            doc.close();
-            return testFunction(doc, doc.querySelector('div'));
-        }).then(() => iframe.remove(), error => {
-            iframe.remove();
-            return Promise.reject(error);
-        });
-    };
-}
-
-// Some browsers don't synchronously update the selected stylesheet. 
-function wait_for_stylesheet_to_be_selected() {
-    return new Promise(function (resolve) {
-        setTimeout(resolve, 0);
-    });
-}
-
-promise_test(make_iframe(`<!DOCTYPE html><body>`, (doc) => {
-    doc.body.innerHTML = `<style title="foo">div { color: red; }</style>`;
-    return wait_for_stylesheet_to_be_selected().then(() => {
-        assert_equals(doc.preferredStylesheetSet, 'foo');
-        assert_equals(doc.selectedStylesheetSet, 'foo');
-    });
-}), 'The title attribute on the style element in a document must set the preferred stylesheet.');
-
-promise_test(make_iframe(`<!DOCTYPE html><body><div>`, (doc) => {
-    doc.querySelector('div').attachShadow({mode: 'closed'}).innerHTML = `<style title="foo"></style>`;
-    return wait_for_stylesheet_to_be_selected().then(() => {
-        assert_equals(doc.preferredStylesheetSet, null);
-        assert_equals(doc.selectedStylesheetSet, null);
-    });
-}), 'The title attribute on the style element inside a closed shadow tree must not set the preferred stylesheet.');
-
-promise_test(make_iframe(`<!DOCTYPE html><body><div>`, (doc) => {
-    doc.querySelector('div').attachShadow({mode: 'open'}).innerHTML = `<style title="foo"></style>`;
-    return wait_for_stylesheet_to_be_selected().then(() => {
-        assert_equals(doc.preferredStylesheetSet, null);
-        assert_equals(doc.selectedStylesheetSet, null);
-    });
-}), 'The title attribute on the style element inside an open shadow tree must not set the preferred stylesheet.');
-
-function insert_link_and_wait(parent, title) {
-    return new Promise((resolve, reject) => {
-        const link = parent.ownerDocument.createElement('link');
-        link.rel = 'stylesheet';
-        link.title = title;
-        link.href = '';
-        link._onload_ = resolve;
-        parent.appendChild(link);
-        setTimeout(() => reject('Failed to load the stylesheet'), 1000);
-    }).then(() => wait_for_stylesheet_to_be_selected());
-}
-
-promise_test(make_iframe(`<!DOCTYPE html><body>`, (doc) => {
-    return insert_link_and_wait(doc.body, 'foo').then(() => {
-        assert_equals(doc.preferredStylesheetSet, 'foo');
-        assert_equals(doc.selectedStylesheetSet, 'foo');
-    });
-}), 'The title attribute on the link element in a document must set the preferred stylesheet.');
-
-promise_test(make_iframe(`<!DOCTYPE html><body><div>`, (doc) => {
-    const root = doc.querySelector('div').attachShadow({mode: 'closed'});
-    return insert_link_and_wait(root, 'foo').then(() => {
-        assert_equals(doc.preferredStylesheetSet, null);
-        assert_equals(doc.selectedStylesheetSet, null);
-    });
-}), 'The title attribute on the link element inside a closed shadow tree must not set the preferred stylesheet.');
-
-promise_test(make_iframe(`<!DOCTYPE html><body><div>`, (doc) => {
-    const root = doc.querySelector('div').attachShadow({mode: 'open'});
-    return insert_link_and_wait(root, 'foo').then(() => {
-        assert_equals(doc.preferredStylesheetSet, null);
-        assert_equals(doc.selectedStylesheetSet, null);
-    });
-}), 'The title attribute on the link element inside an open shadow tree must not set the preferred stylesheet.');
-
-</script>
-</html>
-</body>

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (231848 => 231849)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2018-05-16 16:20:26 UTC (rev 231849)
@@ -1,3 +1,15 @@
+2018-05-16  Chris Nardi  <cna...@chromium.org>
+
+        Remove Document#selectedStylesheetSet/preferredStylesheetSet
+        https://bugs.webkit.org/show_bug.cgi?id=185381
+
+        Reviewed by Darin Adler.
+
+        Refresh historical CSSOM test from upstream to test this change.
+
+        * web-platform-tests/cssom/historical-expected.txt:
+        * web-platform-tests/cssom/historical.html:
+
 2018-05-15  Charles Vazac  <cva...@gmail.com>
 
         Add the PerformanceServerTiming Interface which makes Server-Timing header timing values available to _javascript_ running in the browser.

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/historical-expected.txt (231848 => 231849)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/historical-expected.txt	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/historical-expected.txt	2018-05-16 16:20:26 UTC (rev 231849)
@@ -4,6 +4,8 @@
 PASS Historical Document member: preferredStyleSheetSet 
 PASS Historical Document member: styleSheetSets 
 PASS Historical Document member: enableStyleSheetsForSet 
+PASS Historical Document member: selectedStylesheetSet 
+PASS Historical Document member: preferredStylesheetSet 
 PASS Historical Element member: cascadedStyle 
 PASS Historical Element member: defaultStyle 
 PASS Historical Element member: rawComputedStyle 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/historical.html (231848 => 231849)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/historical.html	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/historical.html	2018-05-16 16:20:26 UTC (rev 231849)
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Historical features</title>
+<link rel="help" href=""
 <script src=""
 <script src=""
 <div id=log></div>
@@ -10,6 +11,8 @@
   "preferredStyleSheetSet",
   "styleSheetSets",
   "enableStyleSheetsForSet",
+  "selectedStylesheetSet",
+  "preferredStylesheetSet",
 ].forEach(function(name) {
   test(function() {
     assert_false(name in document);

Modified: trunk/Source/WebCore/ChangeLog (231848 => 231849)


--- trunk/Source/WebCore/ChangeLog	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/Source/WebCore/ChangeLog	2018-05-16 16:20:26 UTC (rev 231849)
@@ -1,3 +1,26 @@
+2018-05-16  Chris Nardi  <cna...@chromium.org>
+
+        Remove Document#selectedStylesheetSet/preferredStylesheetSet
+        https://bugs.webkit.org/show_bug.cgi?id=185381
+
+        Reviewed by Darin Adler.
+
+        Document#selectedStylesheetSet/preferredStylesheetSet are non-standard methods that
+        are only implemented WebKit. Blink removed these methods in https://crbug.com/690609.
+        The standard versions of these methods are are no longer in the spec. Remove them
+        entirely from our implementation.
+
+        Updated existing tests and imported/w3c/web-platform-tests/cssom/historical.html.
+
+        * dom/Document.cpp:
+        (WebCore::Document::processHttpEquiv):
+        * dom/Document.h:
+        * dom/Document.idl:
+        * style/StyleScope.cpp:
+        (WebCore::Style::Scope::collectActiveStyleSheets):
+        * style/StyleScope.h:
+        (WebCore::Style::Scope::preferredStylesheetSetName const):
+
 2018-05-16  Zalan Bujtas  <za...@apple.com>
 
         [LFC] Implement width computation for replaced inflow elements.

Modified: trunk/Source/WebCore/dom/Document.cpp (231848 => 231849)


--- trunk/Source/WebCore/dom/Document.cpp	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/Source/WebCore/dom/Document.cpp	2018-05-16 16:20:26 UTC (rev 231849)
@@ -3332,7 +3332,6 @@
         // For more info, see the test at:
         // http://www.hixie.ch/tests/evil/css/import/main/preferred.html
         // -dwh
-        styleScope().setSelectedStylesheetSetName(content);
         styleScope().setPreferredStylesheetSetName(content);
         break;
 
@@ -3637,21 +3636,6 @@
     return *m_styleSheetList;
 }
 
-String Document::preferredStylesheetSet() const
-{
-    return styleScope().preferredStylesheetSetName();
-}
-
-String Document::selectedStylesheetSet() const
-{
-    return styleScope().selectedStylesheetSetName();
-}
-
-void Document::setSelectedStylesheetSet(const String& aString)
-{
-    styleScope().setSelectedStylesheetSetName(aString);
-}
-
 void Document::evaluateMediaQueryList()
 {
     if (m_mediaQueryMatcher)

Modified: trunk/Source/WebCore/dom/Document.h (231848 => 231849)


--- trunk/Source/WebCore/dom/Document.h	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/Source/WebCore/dom/Document.h	2018-05-16 16:20:26 UTC (rev 231849)
@@ -727,10 +727,6 @@
 
     MouseEventWithHitTestResults prepareMouseEvent(const HitTestRequest&, const LayoutPoint&, const PlatformMouseEvent&);
 
-    WEBCORE_EXPORT String preferredStylesheetSet() const;
-    WEBCORE_EXPORT String selectedStylesheetSet() const;
-    WEBCORE_EXPORT void setSelectedStylesheetSet(const String&);
-
     enum class FocusRemovalEventsMode { Dispatch, DoNotDispatch };
     WEBCORE_EXPORT bool setFocusedElement(Element*, FocusDirection = FocusDirectionNone,
         FocusRemovalEventsMode = FocusRemovalEventsMode::Dispatch);

Modified: trunk/Source/WebCore/dom/Document.idl (231848 => 231849)


--- trunk/Source/WebCore/dom/Document.idl	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/Source/WebCore/dom/Document.idl	2018-05-16 16:20:26 UTC (rev 231849)
@@ -168,10 +168,6 @@
     readonly attribute VisibilityState visibilityState;
     attribute EventHandler onvisibilitychange;
 
-    // FIXME: Those were dropped from the CSSOM specification.
-    readonly attribute DOMString? preferredStylesheetSet;
-    attribute DOMString? selectedStylesheetSet;
-
     // FIXME: Those have been dropped from the DOM specification.
     readonly attribute DOMString? xmlEncoding;
     attribute DOMString? xmlVersion;

Modified: trunk/Source/WebCore/style/StyleScope.cpp (231848 => 231849)


--- trunk/Source/WebCore/style/StyleScope.cpp	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/Source/WebCore/style/StyleScope.cpp	2018-05-16 16:20:26 UTC (rev 231849)
@@ -199,15 +199,6 @@
     didChangeActiveStyleSheetCandidates();
 }
 
-void Scope::setSelectedStylesheetSetName(const String& name)
-{
-    if (m_selectedStylesheetSetName == name)
-        return;
-    m_selectedStylesheetSetName = name;
-    didChangeActiveStyleSheetCandidates();
-}
-
-
 void Scope::addPendingSheet(const Element& element)
 {
     ASSERT(!hasPendingSheet(element));
@@ -349,10 +340,8 @@
                 if (linkElement.styleSheetIsLoading()) {
                     // it is loading but we should still decide which style sheet set to use
                     if (!enabledViaScript && !title.isEmpty() && m_preferredStylesheetSetName.isEmpty()) {
-                        if (!linkElement.attributeWithoutSynchronization(relAttr).contains("alternate")) {
+                        if (!linkElement.attributeWithoutSynchronization(relAttr).contains("alternate"))
                             m_preferredStylesheetSetName = title;
-                            m_selectedStylesheetSetName = title;
-                        }
                     }
                     continue;
                 }
@@ -379,7 +368,7 @@
                     // us as the preferred set. Otherwise, just ignore
                     // this sheet.
                     if (is<HTMLStyleElement>(element) || !rel.contains("alternate"))
-                        m_preferredStylesheetSetName = m_selectedStylesheetSetName = title;
+                        m_preferredStylesheetSetName = title;
                 }
                 if (title != m_preferredStylesheetSetName)
                     sheet = nullptr;

Modified: trunk/Source/WebCore/style/StyleScope.h (231848 => 231849)


--- trunk/Source/WebCore/style/StyleScope.h	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/Source/WebCore/style/StyleScope.h	2018-05-16 16:20:26 UTC (rev 231849)
@@ -78,9 +78,7 @@
     void removeStyleSheetCandidateNode(Node&);
 
     String preferredStylesheetSetName() const { return m_preferredStylesheetSetName; }
-    String selectedStylesheetSetName() const { return m_selectedStylesheetSetName; }
     void setPreferredStylesheetSetName(const String&);
-    void setSelectedStylesheetSetName(const String&);
 
     void addPendingSheet(const Element&);
     void removePendingSheet(const Element&);
@@ -178,7 +176,6 @@
     ListHashSet<Node*> m_styleSheetCandidateNodes;
 
     String m_preferredStylesheetSetName;
-    String m_selectedStylesheetSetName;
 
     bool m_usesStyleBasedEditability { false };
     bool m_isUpdatingStyleResolver { false };

Modified: trunk/Source/WebKit/ChangeLog (231848 => 231849)


--- trunk/Source/WebKit/ChangeLog	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/Source/WebKit/ChangeLog	2018-05-16 16:20:26 UTC (rev 231849)
@@ -1,3 +1,20 @@
+2018-05-16  Chris Nardi  <cna...@chromium.org>
+
+        Remove Document#selectedStylesheetSet/preferredStylesheetSet
+        https://bugs.webkit.org/show_bug.cgi?id=185381
+
+        Reviewed by Darin Adler.
+
+        Make API methods for Document#selectedStylesheetSet/preferredStylesheetSet do nothing.
+
+        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
+        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
+        (webkit_dom_document_set_property):
+        (webkit_dom_document_get_property):
+        (webkit_dom_document_get_preferred_stylesheet_set):
+        (webkit_dom_document_get_selected_stylesheet_set):
+        (webkit_dom_document_set_selected_stylesheet_set):
+
 2018-05-16  Alberto Garcia  <be...@igalia.com>
 
         [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h (231848 => 231849)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h	2018-05-16 16:20:26 UTC (rev 231849)
@@ -941,6 +941,8 @@
  * webkit_dom_document_get_preferred_stylesheet_set:
  * @self: A #WebKitDOMDocument
  *
+ * This function has been removed and does nothing.
+ *
  * Returns: A #gchar
  *
  * Deprecated: 2.22: Use _javascript_Core API instead
@@ -952,6 +954,8 @@
  * webkit_dom_document_get_selected_stylesheet_set:
  * @self: A #WebKitDOMDocument
  *
+ * This function has been removed and does nothing.
+ *
  * Returns: A #gchar
  *
  * Deprecated: 2.22: Use _javascript_Core API instead
@@ -964,6 +968,7 @@
  * @self: A #WebKitDOMDocument
  * @value: A #gchar
  *
+ * This function has been removed and does nothing.
  *
  * Deprecated: 2.22: Use _javascript_Core API instead
 **/

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp (231848 => 231849)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp	2018-05-16 16:20:26 UTC (rev 231849)
@@ -181,7 +181,7 @@
         webkit_dom_document_set_charset(self, g_value_get_string(value));
         break;
     case DOM_DOCUMENT_PROP_SELECTED_STYLESHEET_SET:
-        webkit_dom_document_set_selected_stylesheet_set(self, g_value_get_string(value));
+        g_warning("%s: The selected-stylesheet-set property has been removed and no longer works.", __func__);
         break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec);
@@ -291,10 +291,10 @@
         g_value_take_string(value, webkit_dom_document_get_character_set(self));
         break;
     case DOM_DOCUMENT_PROP_PREFERRED_STYLESHEET_SET:
-        g_value_take_string(value, webkit_dom_document_get_preferred_stylesheet_set(self));
+        g_warning("%s: The preferred-stylesheet-set property has been removed and no longer works.", __func__);
         break;
     case DOM_DOCUMENT_PROP_SELECTED_STYLESHEET_SET:
-        g_value_take_string(value, webkit_dom_document_get_selected_stylesheet_set(self));
+        g_warning("%s: The selected-stylesheet-set property has been removed and no longer works.", __func__);
         break;
     case DOM_DOCUMENT_PROP_ACTIVE_ELEMENT:
         g_value_set_object(value, webkit_dom_document_get_active_element(self));
@@ -1787,30 +1787,19 @@
 
 gchar* webkit_dom_document_get_preferred_stylesheet_set(WebKitDOMDocument* self)
 {
-    WebCore::JSMainThreadNullState state;
-    g_return_val_if_fail(WEBKIT_DOM_IS_DOCUMENT(self), 0);
-    WebCore::Document* item = WebKit::core(self);
-    gchar* result = convertToUTF8String(item->preferredStylesheetSet());
-    return result;
+    g_warning("%s: this function has been removed and does nothing", __func__);
+    return nullptr;
 }
 
 gchar* webkit_dom_document_get_selected_stylesheet_set(WebKitDOMDocument* self)
 {
-    WebCore::JSMainThreadNullState state;
-    g_return_val_if_fail(WEBKIT_DOM_IS_DOCUMENT(self), 0);
-    WebCore::Document* item = WebKit::core(self);
-    gchar* result = convertToUTF8String(item->selectedStylesheetSet());
-    return result;
+    g_warning("%s: this function has been removed and does nothing", __func__);
+    return nullptr;
 }
 
 void webkit_dom_document_set_selected_stylesheet_set(WebKitDOMDocument* self, const gchar* value)
 {
-    WebCore::JSMainThreadNullState state;
-    g_return_if_fail(WEBKIT_DOM_IS_DOCUMENT(self));
-    g_return_if_fail(value);
-    WebCore::Document* item = WebKit::core(self);
-    WTF::String convertedValue = WTF::String::fromUTF8(value);
-    item->setSelectedStylesheetSet(convertedValue);
+    g_warning("%s: this function has been removed and does nothing", __func__);
 }
 
 WebKitDOMElement* webkit_dom_document_get_active_element(WebKitDOMDocument* self)

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (231848 => 231849)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2018-05-16 16:20:26 UTC (rev 231849)
@@ -1,3 +1,19 @@
+2018-05-16  Chris Nardi  <cna...@chromium.org>
+
+        Remove Document#selectedStylesheetSet/preferredStylesheetSet
+        https://bugs.webkit.org/show_bug.cgi?id=185381
+
+        Reviewed by Darin Adler.
+
+        Mark API methods for Document#selectedStylesheetSet/preferredStylesheetSet as deprecated
+        and make them do nothing.
+
+        * DOM/DOMDocument.h:
+        * DOM/DOMDocument.mm:
+        (-[DOMDocument preferredStylesheetSet]):
+        (-[DOMDocument selectedStylesheetSet]):
+        (-[DOMDocument setSelectedStylesheetSet:]):
+
 2018-05-15  Antoine Quint  <grao...@apple.com>
 
         [Web Animations] Expose Web Animations CSS integration as an experimental feature

Modified: trunk/Source/WebKitLegacy/mac/DOM/DOMDocument.h (231848 => 231849)


--- trunk/Source/WebKitLegacy/mac/DOM/DOMDocument.h	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/Source/WebKitLegacy/mac/DOM/DOMDocument.h	2018-05-16 16:20:26 UTC (rev 231849)
@@ -81,8 +81,8 @@
 @property (readonly, copy) NSString *defaultCharset WEBKIT_AVAILABLE_MAC(10_5);
 @property (readonly, copy) NSString *readyState WEBKIT_AVAILABLE_MAC(10_5);
 @property (readonly, copy) NSString *characterSet WEBKIT_AVAILABLE_MAC(10_5);
-@property (readonly, copy) NSString *preferredStylesheetSet WEBKIT_AVAILABLE_MAC(10_5);
-@property (copy) NSString *selectedStylesheetSet WEBKIT_AVAILABLE_MAC(10_5);
+@property (readonly, copy) NSString *preferredStylesheetSet WEBKIT_DEPRECATED_MAC(10_5, 10_14);
+@property (copy) NSString *selectedStylesheetSet WEBKIT_DEPRECATED_MAC(10_5, 10_14);
 @property (readonly, strong) DOMElement *activeElement WEBKIT_AVAILABLE_MAC(10_6);
 
 - (DOMElement *)createElement:(NSString *)tagName;

Modified: trunk/Source/WebKitLegacy/mac/DOM/DOMDocument.mm (231848 => 231849)


--- trunk/Source/WebKitLegacy/mac/DOM/DOMDocument.mm	2018-05-16 16:11:09 UTC (rev 231848)
+++ trunk/Source/WebKitLegacy/mac/DOM/DOMDocument.mm	2018-05-16 16:20:26 UTC (rev 231849)
@@ -326,20 +326,16 @@
 
 - (NSString *)preferredStylesheetSet
 {
-    WebCore::JSMainThreadNullState state;
-    return IMPL->preferredStylesheetSet();
+    return nil;
 }
 
 - (NSString *)selectedStylesheetSet
 {
-    WebCore::JSMainThreadNullState state;
-    return IMPL->selectedStylesheetSet();
+    return nil;
 }
 
 - (void)setSelectedStylesheetSet:(NSString *)newSelectedStylesheetSet
 {
-    WebCore::JSMainThreadNullState state;
-    IMPL->setSelectedStylesheetSet(newSelectedStylesheetSet);
 }
 
 - (DOMElement *)activeElement
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to