Commit f52dff0d authored by Mason Freed's avatar Mason Freed Committed by Commit Bot

Disable Shadow DOM v0 and Custom Elements v0

```yaml
IN CASE OF PROBLEMS: If this CL causes your site/app to break, you are
using deprecated features that have now been removed. Please see [2] to
enroll in the Deprecation Extension program to give yourself more time.
```

With this CL, two of the three Web Components v0 APIs are disabled by
default. The third, HTML Imports, will be disabled (soon) by a separate CL.

These features were deprecated in August, 2018, in [1]. The original
removal timeline called for a deadline of M73. Due to high use counters
for the features, this deadline was extended to M80, which is now here.
For those sites that need additional time, there is a "deprecation
extension" (sometimes called a "reverse origin trial") that can be used
to extend this removal for specific sites through M87. For more
information on that, see [2]. For overall context on this removal,
including motivation and ways to test/upgrade, see [3].

With this CL, these features will still be enabled for testing across
all test suites. Once this CL has had a chance to land and stabilize,
subsequent CLs will disable the features for all tests by default, and
enable a virtual test suite to continue testing specific code with WCv0
features enabled, to ensure the features continue to function through
the end of the deprecation extension period.

[1] https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/h-JwMiPUnuU/sl79aLoLBQAJ
[2] https://developers.chrome.com/origintrials/#/view_trial/2431943798780067841
[3] https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade

Bug: 911943
Change-Id: I939e1ead03a3196e63f0f9c192f916c87ab16562
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850795Reviewed-by: default avatarCaleb Rouleau <crouleau@chromium.org>
Reviewed-by: default avatarDarin Fisher <darin@chromium.org>
Commit-Queue: Mason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708031}
parent f7afddcd
...@@ -70,7 +70,8 @@ void HTMLLinkElement::ParseAttribute( ...@@ -70,7 +70,8 @@ void HTMLLinkElement::ParseAttribute(
const AtomicString& value = params.new_value; const AtomicString& value = params.new_value;
if (name == kRelAttr) { if (name == kRelAttr) {
rel_attribute_ = LinkRelAttribute(value); rel_attribute_ = LinkRelAttribute(value);
if (rel_attribute_.IsImport()) { if (rel_attribute_.IsImport() &&
RuntimeEnabledFeatures::HTMLImportsEnabledByRuntimeFlag()) {
Deprecation::CountDeprecation(&GetDocument(), WebFeature::kHTMLImports); Deprecation::CountDeprecation(&GetDocument(), WebFeature::kHTMLImports);
} }
rel_list_->DidUpdateAttributeValue(params.old_value, value); rel_list_->DidUpdateAttributeValue(params.old_value, value);
......
...@@ -502,12 +502,12 @@ ...@@ -502,12 +502,12 @@
name: "CustomElementDefaultStyle", name: "CustomElementDefaultStyle",
status: "experimental", status: "experimental",
}, },
// Introduced this flag as stable so web developers can test their sites // TODO(937746): Web Components v0 is disabled by default, and will be
// without native Custom Elements v0 support. // removed after M87.
{ {
name: "CustomElementsV0", name: "CustomElementsV0",
origin_trial_feature_name: "WebComponentsV0", origin_trial_feature_name: "WebComponentsV0",
status: "stable", status: "test",
}, },
{ {
name: "CustomStatePseudoClass", name: "CustomStatePseudoClass",
...@@ -763,7 +763,8 @@ ...@@ -763,7 +763,8 @@
origin_trial_feature_name: "HrefTranslate", origin_trial_feature_name: "HrefTranslate",
status: "experimental", status: "experimental",
}, },
// https://crbug.com/766694 for testing disabling the feature. // TODO(911943): HTML Imports is temporarily being left enabled after
// the planned removal milestone of M80.
{ {
name: "HTMLImports", name: "HTMLImports",
origin_trial_feature_name: "WebComponentsV0", origin_trial_feature_name: "WebComponentsV0",
...@@ -773,10 +774,11 @@ ...@@ -773,10 +774,11 @@
{ {
name: "HTMLImportsOnlyChrome", name: "HTMLImportsOnlyChrome",
}, },
// https://crbug.com/523952 for testing disabling the feature. // TODO(937746): Web Components v0 is disabled by default, and will be
// removed after M87.
{ {
name: "HTMLImportsStyleApplication", name: "HTMLImportsStyleApplication",
status: "stable", status: "test",
}, },
{ {
name: "IDBObserver", name: "IDBObserver",
...@@ -1499,12 +1501,12 @@ ...@@ -1499,12 +1501,12 @@
name: "SetRootScroller", name: "SetRootScroller",
status: "experimental", status: "experimental",
}, },
// Introduced this flag as stable so web developers can test their sites // TODO(937746): Web Components v0 is disabled by default, and will be
// without native Shadow DOM v0 support // removed after M87.
{ {
name: "ShadowDOMV0", name: "ShadowDOMV0",
origin_trial_feature_name: "WebComponentsV0", origin_trial_feature_name: "WebComponentsV0",
status: "stable", status: "test",
}, },
{ {
name: "ShadowPiercingDescendantCombinator", name: "ShadowPiercingDescendantCombinator",
......
This is a testharness.js-based test.
FAIL Comfirm HTMLImportsOnReverseOriginTrials counter assert_true: expected true got false
Harness: the test ran to completion.
Tests basic web-exposure of Custom Elements
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Document.prototype.hasOwnProperty("registerElement")
false
typeof Document.prototype.registerElement
undefined
document.createElement("x-a") instanceof HTMLUnknownElement
false
document.querySelector(":unresolved")
FAIL document.querySelector(":unresolved") threw exception SyntaxError: Failed to execute 'querySelector' on 'Document': ':unresolved' is not a valid selector.
undefined
span.getAttribute("is")
PASS window.customElements.define("a-a", A, {extends: "b"}) did not throw exception.
PASS successfullyParsed is true
TEST COMPLETE
...@@ -55,7 +55,6 @@ namespace http://www.w3.org/1999/xhtml ...@@ -55,7 +55,6 @@ namespace http://www.w3.org/1999/xhtml
property computedStyleMap property computedStyleMap
property contains property contains
property contentEditable property contentEditable
property createShadowRoot
property dataset property dataset
property dir property dir
property dispatchEvent property dispatchEvent
...@@ -72,7 +71,6 @@ namespace http://www.w3.org/1999/xhtml ...@@ -72,7 +71,6 @@ namespace http://www.w3.org/1999/xhtml
property getAttributeNodeNS property getAttributeNodeNS
property getBoundingClientRect property getBoundingClientRect
property getClientRects property getClientRects
property getDestinationInsertionPoints
property getElementsByClassName property getElementsByClassName
property getElementsByTagName property getElementsByTagName
property getElementsByTagNameNS property getElementsByTagNameNS
...@@ -1167,7 +1165,6 @@ namespace http://www.w3.org/2000/svg ...@@ -1167,7 +1165,6 @@ namespace http://www.w3.org/2000/svg
property compareDocumentPosition property compareDocumentPosition
property computedStyleMap property computedStyleMap
property contains property contains
property createShadowRoot
property dataset property dataset
property dispatchEvent property dispatchEvent
property elementTiming property elementTiming
...@@ -1181,7 +1178,6 @@ namespace http://www.w3.org/2000/svg ...@@ -1181,7 +1178,6 @@ namespace http://www.w3.org/2000/svg
property getAttributeNodeNS property getAttributeNodeNS
property getBoundingClientRect property getBoundingClientRect
property getClientRects property getClientRects
property getDestinationInsertionPoints
property getElementsByClassName property getElementsByClassName
property getElementsByTagName property getElementsByTagName
property getElementsByTagNameNS property getElementsByTagNameNS
......
...@@ -1447,7 +1447,6 @@ interface Document : Node ...@@ -1447,7 +1447,6 @@ interface Document : Node
method queryCommandValue method queryCommandValue
method querySelector method querySelector
method querySelectorAll method querySelectorAll
method registerElement
method releaseEvents method releaseEvents
method webkitCancelFullScreen method webkitCancelFullScreen
method webkitExitFullscreen method webkitExitFullscreen
...@@ -1656,7 +1655,6 @@ interface Element : Node ...@@ -1656,7 +1655,6 @@ interface Element : Node
method closest method closest
method computedStyleMap method computedStyleMap
method constructor method constructor
method createShadowRoot
method getAttribute method getAttribute
method getAttributeNS method getAttributeNS
method getAttributeNames method getAttributeNames
...@@ -1664,7 +1662,6 @@ interface Element : Node ...@@ -1664,7 +1662,6 @@ interface Element : Node
method getAttributeNodeNS method getAttributeNodeNS
method getBoundingClientRect method getBoundingClientRect
method getClientRects method getClientRects
method getDestinationInsertionPoints
method getElementsByClassName method getElementsByClassName
method getElementsByTagName method getElementsByTagName
method getElementsByTagNameNS method getElementsByTagNameNS
...@@ -6872,7 +6869,6 @@ interface Text : CharacterData ...@@ -6872,7 +6869,6 @@ interface Text : CharacterData
getter assignedSlot getter assignedSlot
getter wholeText getter wholeText
method constructor method constructor
method getDestinationInsertionPoints
method splitText method splitText
interface TextDecoder interface TextDecoder
attribute @@toStringTag attribute @@toStringTag
......
...@@ -27,9 +27,6 @@ ...@@ -27,9 +27,6 @@
"mac": "system_health_desktop_040.wprgo", "mac": "system_health_desktop_040.wprgo",
"win": "system_health_desktop_047.wprgo" "win": "system_health_desktop_047.wprgo"
}, },
"browse:media:youtube:2018": {
"DEFAULT": "system_health_desktop_6b6bdda708.wprgo"
},
"browse:media:youtubetv:2019": { "browse:media:youtubetv:2019": {
"DEFAULT": "system_health_desktop_e53598d1f4.wprgo" "DEFAULT": "system_health_desktop_e53598d1f4.wprgo"
}, },
...@@ -375,4 +372,4 @@ ...@@ -375,4 +372,4 @@
}, },
"description": "Describes the Web Page Replay archives for a story set. Don't edit by hand! Use record_wpr for updating.", "description": "Describes the Web Page Replay archives for a story set. Don't edit by hand! Use record_wpr for updating.",
"platform_specific": true "platform_specific": true
} }
\ No newline at end of file
...@@ -257,7 +257,7 @@ class RedditMobileStory2019(_ArticleBrowsingStory): ...@@ -257,7 +257,7 @@ class RedditMobileStory2019(_ArticleBrowsingStory):
for i in xrange(self.ITEMS_TO_VISIT + 1): for i in xrange(self.ITEMS_TO_VISIT + 1):
# Skip the ad disguised as an article. # Skip the ad disguised as an article.
if i == 1: if i == 1:
continue continue
self._NavigateToItem(action_runner, i) self._NavigateToItem(action_runner, i)
self._ReadNextArticle(action_runner) self._ReadNextArticle(action_runner)
self._NavigateBack(action_runner) self._NavigateBack(action_runner)
...@@ -604,23 +604,6 @@ class YouTubeMobileStory(_MediaBrowsingStory): ...@@ -604,23 +604,6 @@ class YouTubeMobileStory(_MediaBrowsingStory):
story_tags.HEALTH_CHECK, story_tags.YEAR_2016] story_tags.HEALTH_CHECK, story_tags.YEAR_2016]
class YouTubeDesktopStory2018(_MediaBrowsingStory):
"""Load a typical YouTube video then navigate to a next few videos. Stop and
watch each video for a few seconds.
"""
NAME = 'browse:media:youtube:2018'
URL = 'https://www.youtube.com/watch?v=QGfhS1hfTWw&autoplay=0'
ITEM_SELECTOR = 'ytd-compact-video-renderer.ytd-watch-next-secondary-results-renderer a'
SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
IS_SINGLE_PAGE_APP = True
# A longer view time allows videos to load and play.
ITEM_VIEW_TIME_IN_SECONDS = 5
ITEMS_TO_VISIT = 8
ITEM_SELECTOR_INDEX = 3
PLATFORM_SPECIFIC = True
TAGS = [story_tags.JAVASCRIPT_HEAVY, story_tags.YEAR_2018]
class YouTubeTVDesktopStory2019(_MediaBrowsingStory): class YouTubeTVDesktopStory2019(_MediaBrowsingStory):
"""Load a typical YouTube TV video then navigate to a next few videos. Stop """Load a typical YouTube TV video then navigate to a next few videos. Stop
and watch each video for a few seconds. and watch each video for a few seconds.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment