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

Unified Diff: third_party/WebKit/Source/web/WebFormControlElement.cpp

Issue 2161963003: Make autofill dropdown to obey text-align: left|right CSS property. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 4 years, 5 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/web/WebFormControlElement.cpp
diff --git a/third_party/WebKit/Source/web/WebFormControlElement.cpp b/third_party/WebKit/Source/web/WebFormControlElement.cpp
index df17acd758c7e2cae301cef19c892d1018d4d250..a7182861ae309314bb6847fec7066e0cd51a6276 100644
--- a/third_party/WebKit/Source/web/WebFormControlElement.cpp
+++ b/third_party/WebKit/Source/web/WebFormControlElement.cpp
@@ -185,10 +185,22 @@ int WebFormControlElement::selectionEnd() const
return 0;
}
+WebString WebFormControlElement::alignmentForFormData() const
+{
+ if (const ComputedStyle* style = constUnwrap<HTMLFormControlElement>()->computedStyle()) {
+ if (style->textAlign() == RIGHT)
+ return WebString::fromUTF8("right");
+ if (style->textAlign() == LEFT)
+ return WebString::fromUTF8("left");
+ }
+ return WebString();
+}
+
WebString WebFormControlElement::directionForFormData() const
{
- if (const ComputedStyle* style = constUnwrap<HTMLFormControlElement>()->computedStyle())
+ if (const ComputedStyle* style = constUnwrap<HTMLFormControlElement>()->computedStyle()) {
return style->isLeftToRightDirection() ? WebString::fromUTF8("ltr") : WebString::fromUTF8("rtl");
+ }
return WebString::fromUTF8("ltr");
}

Powered by Google App Engine
This is Rietveld 408576698