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

Unified Diff: Source/core/html/forms/SearchInputType.cpp

Issue 27323002: make input type="search" RTL direction aware (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed the Test Created 7 years, 2 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: Source/core/html/forms/SearchInputType.cpp
diff --git a/Source/core/html/forms/SearchInputType.cpp b/Source/core/html/forms/SearchInputType.cpp
index a2bd867997807a442074f7b3701fc2f2207a3ca5..b8b56c40d28e3e2ea452e747d72432641aa2c5ca 100644
--- a/Source/core/html/forms/SearchInputType.cpp
+++ b/Source/core/html/forms/SearchInputType.cpp
@@ -95,8 +95,14 @@ void SearchInputType::createShadowSubtree()
ASSERT(container);
ASSERT(viewPort);
- container->insertBefore(SearchFieldDecorationElement::create(element()->document()), viewPort);
- container->insertBefore(SearchFieldCancelButtonElement::create(element()->document()), viewPort->nextSibling());
+ AtomicString dirAttributeValue = element()->fastGetAttribute(dirAttr);
+ if (dirAttributeValue.isEmpty() || equalIgnoringCase(dirAttributeValue, "ltr")) {
+ container->insertBefore(SearchFieldDecorationElement::create(element()->document()), viewPort);
+ container->insertBefore(SearchFieldCancelButtonElement::create(element()->document()), viewPort->nextSibling());
+ } else {
+ container->insertBefore(SearchFieldCancelButtonElement::create(element()->document()), viewPort);
+ container->insertBefore(SearchFieldDecorationElement::create(element()->document()), viewPort->nextSibling());
+ }
}
void SearchInputType::handleKeydownEvent(KeyboardEvent* event)

Powered by Google App Engine
This is Rietveld 408576698