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

Unified Diff: Source/WebCore/html/shadow/DateTimeFieldElement.cpp

Issue 11548051: Merge 137275 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 years 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: Source/WebCore/html/shadow/DateTimeFieldElement.cpp
===================================================================
--- Source/WebCore/html/shadow/DateTimeFieldElement.cpp (revision 137545)
+++ Source/WebCore/html/shadow/DateTimeFieldElement.cpp (working copy)
@@ -31,6 +31,7 @@
#include "HTMLNames.h"
#include "KeyboardEvent.h"
#include "LocalizedStrings.h"
+#include "PlatformLocale.h"
#include "RenderObject.h"
#include "Text.h"
#include <wtf/text/WTFString.h>
@@ -90,7 +91,9 @@
if (keyIdentifier == "Left") {
if (!m_fieldOwner)
return;
- if (isRTL() ? m_fieldOwner->focusOnNextField(*this) : m_fieldOwner->focusOnPreviousField(*this))
+ // FIXME: We'd like to use FocusController::advanceFocus(FocusDirectionLeft, ...)
+ // but it doesn't work for shadow nodes. webkit.org/b/104650
+ if (!localeForOwner().isRTL() && m_fieldOwner->focusOnPreviousField(*this))
keyboardEvent->setDefaultHandled();
return;
}
@@ -98,7 +101,9 @@
if (keyIdentifier == "Right") {
if (!m_fieldOwner)
return;
- if (isRTL() ? m_fieldOwner->focusOnPreviousField(*this) : m_fieldOwner->focusOnNextField(*this))
+ // FIXME: We'd like to use FocusController::advanceFocus(FocusDirectionRight, ...)
+ // but it doesn't work for shadow nodes. webkit.org/b/104650
+ if (!localeForOwner().isRTL() && m_fieldOwner->focusOnNextField(*this))
keyboardEvent->setDefaultHandled();
return;
}
@@ -163,9 +168,9 @@
return fastHasAttribute(readonlyAttr);
}
-bool DateTimeFieldElement::isRTL() const
+Locale& DateTimeFieldElement::localeForOwner() const
{
- return renderer() && renderer()->style()->direction() == RTL;
+ return document()->getCachedLocale(localeIdentifier());
}
AtomicString DateTimeFieldElement::localeIdentifier() const
« no previous file with comments | « Source/WebCore/html/shadow/DateTimeFieldElement.h ('k') | Source/WebCore/html/shadow/DateTimeNumericFieldElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698