Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1318)

Unified Diff: third_party/WebKit/Source/core/css/CSSSelector.cpp

Issue 2778983006: Make /deep/ as no-op and remove ::shadow in dynamic profile (Closed)
Patch Set: rebased Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/CSSSelector.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSSelector.cpp b/third_party/WebKit/Source/core/css/CSSSelector.cpp
index 08775fd5dd5ee38179f64a4efd412d3848b712d2..9d6fd162cf74363d5de7bced5a4821e39793a73a 100644
--- a/third_party/WebKit/Source/core/css/CSSSelector.cpp
+++ b/third_party/WebKit/Source/core/css/CSSSelector.cpp
@@ -31,6 +31,7 @@
#include "core/HTMLNames.h"
#include "core/css/CSSMarkup.h"
#include "core/css/CSSSelectorList.h"
+#include "core/css/parser/CSSParserContext.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/wtf/Assertions.h"
#include "platform/wtf/HashMap.h"
@@ -489,6 +490,7 @@ PseudoId CSSSelector::ParsePseudoId(const String& name) {
}
void CSSSelector::UpdatePseudoType(const AtomicString& value,
+ const CSSParserContext& context,
bool has_arguments) {
DCHECK(match_ == kPseudoClass || match_ == kPseudoElement ||
match_ == kPagePseudoClass);
@@ -521,11 +523,14 @@ void CSSSelector::UpdatePseudoType(const AtomicString& value,
case kPseudoWebKitCustomElement:
case kPseudoBlinkInternalElement:
case kPseudoContent:
- case kPseudoShadow:
case kPseudoSlotted:
if (match_ != kPseudoElement)
pseudo_type_ = kPseudoUnknown;
break;
+ case kPseudoShadow:
+ if (match_ != kPseudoElement || context.IsDynamicProfile())
+ pseudo_type_ = kPseudoUnknown;
+ break;
case kPseudoFirstPage:
case kPseudoLeftPage:
case kPseudoRightPage:
@@ -769,6 +774,7 @@ String CSSSelector::SelectorText(const String& right_side) const {
case kChild:
return tag_history->SelectorText(" > " + str.ToString() + right_side);
case kShadowDeep:
+ case kShadowDeepAsDescendant:
return tag_history->SelectorText(" /deep/ " + str.ToString() +
right_side);
case kShadowPiercingDescendant:
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSSelector.h ('k') | third_party/WebKit/Source/core/css/SelectorChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698