Index: Source/core/html/HTMLFormControlElement.cpp |
diff --git a/Source/core/html/HTMLFormControlElement.cpp b/Source/core/html/HTMLFormControlElement.cpp |
index a4e37a36cc362f9912230017706c1f74ee3793f4..dfa01d1eb7d5f48cade31141ed54633ebfb856d3 100644 |
--- a/Source/core/html/HTMLFormControlElement.cpp |
+++ b/Source/core/html/HTMLFormControlElement.cpp |
@@ -37,6 +37,7 @@ |
#include "core/page/ValidationMessageClient.h" |
#include "core/rendering/RenderBox.h" |
#include "core/rendering/RenderTheme.h" |
+#include "platform/text/BidiTextRun.h" |
#include "wtf/Vector.h" |
namespace blink { |
@@ -405,6 +406,15 @@ void HTMLFormControlElement::setNeedsWillValidateCheck() |
hideVisibleValidationMessage(); |
} |
+void HTMLFormControlElement::findCustomValidationMessageTextDirection(const String& message, TextDirection &messageDir, String& subMessage, TextDirection &subMessageDir) |
+{ |
+ bool hasStrongDirection; |
+ subMessage = fastGetAttribute(titleAttr); |
+ messageDir = determineDirectionality(message, hasStrongDirection); |
+ if (!subMessage.isEmpty()) |
+ subMessageDir = renderer()->style()->direction(); |
+} |
+ |
void HTMLFormControlElement::updateVisibleValidationMessage() |
{ |
Page* page = document().page(); |
@@ -416,10 +426,14 @@ void HTMLFormControlElement::updateVisibleValidationMessage() |
m_hasValidationMessage = true; |
ValidationMessageClient* client = &page->validationMessageClient(); |
+ TextDirection messageDir = LTR; |
+ TextDirection subMessageDir = LTR; |
+ String subMessage = String(); |
if (message.isEmpty()) |
client->hideValidationMessage(*this); |
else |
- client->showValidationMessage(*this, message); |
+ findCustomValidationMessageTextDirection(message, messageDir, subMessage, subMessageDir); |
+ client->showValidationMessage(*this, message, messageDir, subMessage, subMessageDir); |
} |
void HTMLFormControlElement::hideVisibleValidationMessage() |