summaryrefslogtreecommitdiffstats
path: root/WebCore/dom/KeyboardEvent.cpp
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:05:15 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:05:15 -0800
commit1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 (patch)
tree4457a7306ea5acb43fe05bfe0973b1f7faf97ba2 /WebCore/dom/KeyboardEvent.cpp
parent9364f22aed35e1a1e9d07c121510f80be3ab0502 (diff)
downloadexternal_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.zip
external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.gz
external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.bz2
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'WebCore/dom/KeyboardEvent.cpp')
-rw-r--r--WebCore/dom/KeyboardEvent.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/WebCore/dom/KeyboardEvent.cpp b/WebCore/dom/KeyboardEvent.cpp
index 0ee8cb5..6bc825f 100644
--- a/WebCore/dom/KeyboardEvent.cpp
+++ b/WebCore/dom/KeyboardEvent.cpp
@@ -33,23 +33,21 @@
namespace WebCore {
-using namespace EventNames;
-
static inline const AtomicString& eventTypeForKeyboardEventType(PlatformKeyboardEvent::Type type)
{
switch (type) {
case PlatformKeyboardEvent::KeyUp:
- return keyupEvent;
+ return eventNames().keyupEvent;
case PlatformKeyboardEvent::RawKeyDown:
- return keydownEvent;
+ return eventNames().keydownEvent;
case PlatformKeyboardEvent::Char:
- return keypressEvent;
+ return eventNames().keypressEvent;
case PlatformKeyboardEvent::KeyDown:
// The caller should disambiguate the combined event into RawKeyDown or Char events.
break;
}
ASSERT_NOT_REACHED();
- return keydownEvent;
+ return eventNames().keydownEvent;
}
KeyboardEvent::KeyboardEvent()
@@ -123,7 +121,7 @@ int KeyboardEvent::keyCode() const
// We match IE.
if (!m_keyEvent)
return 0;
- if (type() == keydownEvent || type() == keyupEvent)
+ if (type() == eventNames().keydownEvent || type() == eventNames().keyupEvent)
return m_keyEvent->windowsVirtualKeyCode();
return charCode();
}
@@ -137,7 +135,7 @@ int KeyboardEvent::charCode() const
if (view())
backwardCompatibilityMode = view()->frame()->eventHandler()->needsKeyboardEventDisambiguationQuirks();
- if (!m_keyEvent || (type() != keypressEvent && !backwardCompatibilityMode))
+ if (!m_keyEvent || (type() != eventNames().keypressEvent && !backwardCompatibilityMode))
return 0;
String text = m_keyEvent->text();
return static_cast<int>(text.characterStartingAt(0));