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

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: Rebased 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
« no previous file with comments | « LayoutTests/platform/win/fast/forms/search-rtl-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/forms/SearchInputType.cpp
diff --git a/Source/core/html/forms/SearchInputType.cpp b/Source/core/html/forms/SearchInputType.cpp
index 7bd41263b88cdd09654541190ed69b0238de3428..415513eb56c6f8d6ad59cd05695a4990c2ea0de5 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);
tkent 2013/10/28 10:17:09 This works only for <input type=search dir=rtl>, a
+ 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)
« no previous file with comments | « LayoutTests/platform/win/fast/forms/search-rtl-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698