Skip to content

Commit

Permalink
Deprecate :unresolved pseudo selector.
Browse files Browse the repository at this point in the history
:unresolved selector is a part of Custom Elements V0, and should be
removed with document.registerElement().

This is a leftover of http://crrev.com/587495.
Intent to Deprecate and Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/h-JwMiPUnuU/sl79aLoLBQAJ

This CL also fixes an issue of CSSSelectorParser::
RecordUsageAndDeprecations(). It didn't show a deprecation message if
the function was called with style_sheet_==nullptr, then was called with
a valid style_sheet_.

Change-Id: I5b1b16c722da7bc85fe24a63432e0805fbbed087
Bug: 660759, 889336
Reviewed-on: https://chromium-review.googlesource.com/1250345
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595012}
  • Loading branch information
tkent-google authored and Commit Bot committed Sep 28, 2018
1 parent 9fa583e commit e57a8b1
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CONSOLE WARNING: :unresolved pseudo selector is deprecated and will be removed in M73, around March 2019. Please use :not(:defined) instead. See https://www.chromestatus.com/features/4642138092470272 for more details.
CONSOLE WARNING: line 31: document.registerElement is deprecated and will be removed in M73, around March 2019. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 for more details.
Use invalidation sets for :unresolved pseudo class.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CONSOLE WARNING: line 17: document.registerElement is deprecated and will be removed in M73, around March 2019. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 for more details.
CONSOLE WARNING: line 1: :unresolved pseudo selector is deprecated and will be removed in M73, around March 2019. Please use :not(:defined) instead. See https://www.chromestatus.com/features/4642138092470272 for more details.
Tests the element upgrade algorithm.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CONSOLE WARNING: :unresolved pseudo selector is deprecated and will be removed in M73, around March 2019. Please use :not(:defined) instead. See https://www.chromestatus.com/features/4642138092470272 for more details.
CONSOLE WARNING: line 34: document.registerElement is deprecated and will be removed in M73, around March 2019. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 for more details.
Tests the :unresolved pseudoclass.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CONSOLE WARNING: line 1: :unresolved pseudo selector is deprecated and will be removed in M73, around March 2019. Please use :not(:defined) instead. See https://www.chromestatus.com/features/4642138092470272 for more details.
Tests basic web-exposure of Custom Elements

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1160,10 +1160,8 @@ void CSSSelectorParser::RecordUsageAndDeprecations(
break;
}
if (feature != WebFeature::kNumberOfFeatures) {
if (!Deprecation::DeprecationMessage(feature).IsEmpty() &&
style_sheet_ && style_sheet_->AnyOwnerDocument()) {
Deprecation::CountDeprecation(*style_sheet_->AnyOwnerDocument(),
feature);
if (!Deprecation::DeprecationMessage(feature).IsEmpty()) {
context_->CountDeprecation(feature);
} else {
context_->Count(feature);
}
Expand Down
5 changes: 5 additions & 0 deletions third_party/blink/renderer/core/frame/deprecation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,11 @@ DeprecationInfo GetDeprecationInfo(WebFeature feature) {
ReplacedWillBeRemoved("document.registerElement",
"window.customElements.define", kM73,
"4642138092470272")};
case WebFeature::kCSSSelectorPseudoUnresolved:
return {
"CSSSelectorPseudoUnresolved", kM73,
ReplacedWillBeRemoved(":unresolved pseudo selector", ":not(:defined)",
kM73, "4642138092470272")};

case WebFeature::
kEncryptedMediaDisallowedByFeaturePolicyInCrossOriginIframe:
Expand Down

0 comments on commit e57a8b1

Please sign in to comment.