Index: Source/web/ValidationMessageClientImpl.cpp |
diff --git a/Source/web/ValidationMessageClientImpl.cpp b/Source/web/ValidationMessageClientImpl.cpp |
index 54b7bda41d4839454acc377d4744d96858d83dc5..8b354c722dd7a87a64c1f17c769164a1c43f8112 100644 |
--- a/Source/web/ValidationMessageClientImpl.cpp |
+++ b/Source/web/ValidationMessageClientImpl.cpp |
@@ -64,7 +64,7 @@ FrameView* ValidationMessageClientImpl::currentView() |
return m_currentAnchor->document().view(); |
} |
-void ValidationMessageClientImpl::showValidationMessage(const Element& anchor, const String& message) |
+void ValidationMessageClientImpl::showValidationMessage(const Element& anchor, const String& message, TextDirection messageDir, const String& subMessage, TextDirection subMessageDir) |
{ |
if (message.isEmpty()) { |
hideValidationMessage(anchor); |
@@ -79,15 +79,16 @@ void ValidationMessageClientImpl::showValidationMessage(const Element& anchor, c |
m_lastAnchorRectInScreen = currentView()->hostWindow()->rootViewToScreen(anchorInRootView); |
m_lastPageScaleFactor = m_webView.pageScaleFactor(); |
m_message = message; |
- |
- WebTextDirection dir = m_currentAnchor->renderer()->style()->direction() == RTL ? WebTextDirectionRightToLeft : WebTextDirectionLeftToRight; |
- AtomicString title = m_currentAnchor->fastGetAttribute(HTMLNames::titleAttr); |
- m_webView.client()->showValidationMessage(anchorInRootView, m_message, title, dir); |
- |
const double minimumSecondToShowValidationMessage = 5.0; |
const double secondPerCharacter = 0.05; |
const double statusCheckInterval = 0.1; |
- m_finishTime = monotonicallyIncreasingTime() + std::max(minimumSecondToShowValidationMessage, (message.length() + title.length()) * secondPerCharacter); |
+ |
+ unsigned length = message.length() + (!subMessage.isNull() ? subMessage.length() : 0); |
tkent
2014/07/22 01:29:56
Checking isNull is unnecessary. subMessage.length
Habib Virji
2014/07/22 16:10:00
Done.
|
+ m_webView.client()->showValidationMessage(anchorInRootView, m_message, messageDir == LTR ? WebTextDirectionLeftToRight: WebTextDirectionRightToLeft, |
+ subMessage, subMessageDir == LTR ? WebTextDirectionLeftToRight: WebTextDirectionRightToLeft); |
+ m_webView.client()->showValidationMessage(anchorInRootView, m_message, subMessage, messageDir == LTR ? WebTextDirectionLeftToRight: WebTextDirectionRightToLeft); |
+ |
+ m_finishTime = monotonicallyIncreasingTime() + std::max(minimumSecondToShowValidationMessage, length * secondPerCharacter); |
// FIXME: We should invoke checkAnchorStatus actively when layout, scroll, |
// or page scale change happen. |
m_timer.startRepeating(statusCheckInterval, FROM_HERE); |