Chromium Code Reviews| 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)) { |