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 |