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

Unified Diff: components/autofill/content/renderer/form_autofill_util.cc

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: components/autofill/content/renderer/form_autofill_util.cc
diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc
index 69e24c1cfdbfe7e0f77c2cfba02e4b72e43ee3f3..27bfcd83aeff29cff301de71f49b0481b8eba79e 100644
--- a/components/autofill/content/renderer/form_autofill_util.cc
+++ b/components/autofill/content/renderer/form_autofill_util.cc
@@ -1399,8 +1399,15 @@ void WebFormControlElementToFormField(const WebFormControlElement& element,
if (!g_prevent_layout)
field->is_focusable = element.isFocusable();
field->should_autocomplete = element.autoComplete();
+
+ // Use 'text-align: left|right' if set or 'direction' otherwise.
+ // See crbug.com/482339
field->text_direction = element.directionForFormData() ==
"rtl" ? base::i18n::RIGHT_TO_LEFT : base::i18n::LEFT_TO_RIGHT;
+ if (element.alignmentForFormData() == "left")
+ field->text_direction = base::i18n::LEFT_TO_RIGHT;
esprehn 2016/07/21 22:05:19 This makes text-align always win over direction. I
+ else if (element.alignmentForFormData() == "right")
+ field->text_direction = base::i18n::RIGHT_TO_LEFT;
}
if (IsAutofillableInputElement(input_element)) {
« no previous file with comments | « chrome/renderer/autofill/form_autofill_browsertest.cc ('k') | third_party/WebKit/Source/web/WebFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698