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

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

Issue 1614343002: Implement CSS4 pseudo-class :dir() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated layout tests Created 4 years, 11 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/SelectorChecker.cpp
diff --git a/third_party/WebKit/Source/core/css/SelectorChecker.cpp b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
index 497e1722f3105f2352964ee1340c0149557e1bb2..f82eb6ce5792caf511e1b6360acf4b795687a839 100644
--- a/third_party/WebKit/Source/core/css/SelectorChecker.cpp
+++ b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
@@ -949,6 +949,30 @@ bool SelectorChecker::checkPseudoClass(const SelectorCheckingContext& context, M
break;
return true;
}
+ case CSSSelector::PseudoDir:
+ {
+ // TODO(ramya.v): Need to check the exact direction element is rendered.
+ AtomicString value;
+ TextDirection dir = LTR;
+ if (m_mode == ResolvingStyle)
+ dir = context.elementStyle->direction();
esprehn 2016/02/12 05:13:41 how does this work? The elementStyle is the one be
+ else if (element.ensureComputedStyle())
+ dir = element.ensureComputedStyle()->direction();
esprehn 2016/02/12 05:13:41 ensureComputedStyle() is non-trivial, always do
+ switch (dir) {
+ case LTR:
+ value = "ltr";
esprehn 2016/02/12 05:13:41 we should just atomize these with a DEFINE_STATIC_
+ break;
+ case RTL:
+ value = "rtl";
+ break;
+ default:
+ break;
+ }
+ const AtomicString& argument = selector.argument();
+ if (value.isEmpty() || !equalIgnoringCase(value, argument))
esprehn 2016/02/12 05:13:41 should this use ascii case? this file is inconsist
+ break;
+ return true;
+ }
case CSSSelector::PseudoFullScreen:
// While a Document is in the fullscreen state, and the document's current fullscreen
// element is an element in the document, the 'full-screen' pseudoclass applies to

Powered by Google App Engine
This is Rietveld 408576698