diff options
Diffstat (limited to 'WebCore/dom/KeyboardEvent.cpp')
-rw-r--r-- | WebCore/dom/KeyboardEvent.cpp | 14 |
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)); |