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

Unified Diff: sky/engine/core/page/EventHandler.cpp

Issue 855803002: Remove attrs sky doesn't support. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months 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
« no previous file with comments | « sky/engine/core/page/EventHandler.h ('k') | sky/engine/core/rendering/HitTestResult.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/page/EventHandler.cpp
diff --git a/sky/engine/core/page/EventHandler.cpp b/sky/engine/core/page/EventHandler.cpp
index fb41cc372ed81ae47890a4ef70df5f8c20a4321c..751b15cb006b747df6f860611907892f86f1a3a2 100644
--- a/sky/engine/core/page/EventHandler.cpp
+++ b/sky/engine/core/page/EventHandler.cpp
@@ -2064,25 +2064,6 @@ void EventHandler::notifyElementActivated()
m_lastDeferredTapElement = nullptr;
}
-bool EventHandler::handleAccessKey(const PlatformKeyboardEvent& evt)
-{
- // FIXME: Ignoring the state of Shift key is what neither IE nor Firefox do.
- // IE matches lower and upper case access keys regardless of Shift key state - but if both upper and
- // lower case variants are present in a document, the correct element is matched based on Shift key state.
- // Firefox only matches an access key if Shift is not pressed, and does that case-insensitively.
- ASSERT(!(accessKeyModifiers() & PlatformEvent::ShiftKey));
- if ((evt.modifiers() & ~PlatformEvent::ShiftKey) != accessKeyModifiers())
- return false;
- String key = evt.unmodifiedText();
- Element* elem = m_frame->document()->getElementByAccessKey(key.lower());
- if (!elem)
- return false;
- // FIXME(sky): We should probably pass SendMouseUpDownEvents here, not
- // firing mouseup and mousedown is IE legacy.
- elem->dispatchSimulatedClick(0, SendNoEvents);
- return true;
-}
-
bool EventHandler::keyEvent(const PlatformKeyboardEvent& initialKeyEvent)
{
RefPtr<FrameView> protector(m_frame->view());
@@ -2098,15 +2079,6 @@ bool EventHandler::keyEvent(const PlatformKeyboardEvent& initialKeyEvent)
UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
- // In IE, access keys are special, they are handled after default keydown processing, but cannot be canceled - this is hard to match.
- // On Mac OS X, we process them before dispatching keydown, as the default keydown handler implements Emacs key bindings, which may conflict
- // with access keys. Then we dispatch keydown, but suppress its default handling.
- // On Windows, WebKit explicitly calls handleAccessKey() instead of dispatching a keypress event for WM_SYSCHAR messages.
- // Other platforms currently match either Mac or Windows behavior, depending on whether they send combined KeyDown events.
- bool matchedAnAccessKey = false;
- if (initialKeyEvent.type() == PlatformEvent::KeyDown)
- matchedAnAccessKey = handleAccessKey(initialKeyEvent);
-
// FIXME: it would be fair to let an input method handle KeyUp events before DOM dispatch.
if (initialKeyEvent.type() == PlatformEvent::KeyUp || initialKeyEvent.type() == PlatformEvent::Char)
return !node->dispatchKeyEvent(initialKeyEvent);
@@ -2115,8 +2087,7 @@ bool EventHandler::keyEvent(const PlatformKeyboardEvent& initialKeyEvent)
if (keyDownEvent.type() != PlatformEvent::RawKeyDown)
keyDownEvent.disambiguateKeyDownEvent(PlatformEvent::RawKeyDown);
RefPtr<KeyboardEvent> keydown = KeyboardEvent::create(keyDownEvent, m_frame->document()->domWindow());
- if (matchedAnAccessKey)
- keydown->setDefaultPrevented(true);
+
keydown->setTarget(node);
if (initialKeyEvent.type() == PlatformEvent::RawKeyDown) {
@@ -2608,13 +2579,4 @@ void EventHandler::focusDocumentView()
page->focusController().focusDocumentView(m_frame);
}
-unsigned EventHandler::accessKeyModifiers()
-{
-#if OS(MACOSX)
- return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
-#else
- return PlatformEvent::AltKey;
-#endif
-}
-
} // namespace blink
« no previous file with comments | « sky/engine/core/page/EventHandler.h ('k') | sky/engine/core/rendering/HitTestResult.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698