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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2009283002: Fix touch accessibility events in WebViews and iframes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add cross-site iframe test too Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 2138 matching lines...) Expand 10 before | Expand all | Expand 10 after
2149 if (overlay->handleInputEvent(inputEvent)) 2149 if (overlay->handleInputEvent(inputEvent))
2150 return WebInputEventResult::HandledSuppressed; 2150 return WebInputEventResult::HandledSuppressed;
2151 } 2151 }
2152 2152
2153 if (inputEvent.modifiers & WebInputEvent::IsTouchAccessibility 2153 if (inputEvent.modifiers & WebInputEvent::IsTouchAccessibility
2154 && WebInputEvent::isMouseEventType(inputEvent.type)) { 2154 && WebInputEvent::isMouseEventType(inputEvent.type)) {
2155 PlatformMouseEventBuilder pme(mainFrameImpl()->frameView(), static_cast< const WebMouseEvent&>(inputEvent)); 2155 PlatformMouseEventBuilder pme(mainFrameImpl()->frameView(), static_cast< const WebMouseEvent&>(inputEvent));
2156 2156
2157 // Find the right target frame. See issue 1186900. 2157 // Find the right target frame. See issue 1186900.
2158 HitTestResult result = hitTestResultForRootFramePos(pme.position()); 2158 HitTestResult result = hitTestResultForRootFramePos(pme.position());
2159 Frame* targetFrame; 2159 if (result.innerNodeFrame()) {
dcheng 2016/05/25 17:44:38 I like this because it looks simpler, but I don't
dmazzoni 2016/05/25 17:53:51 I don't think result.innerNodeOrImageMapImage()->d
dcheng 2016/05/25 18:03:00 Hmm. It looks like the original code is from the i
pdr. 2016/05/26 21:32:48 This change seems reasonable to me. LGTM
2160 if (result.innerNodeOrImageMapImage()) 2160 Document* document = result.innerNodeFrame()->document();
2161 targetFrame = result.innerNodeOrImageMapImage()->document().frame();
2162 else
2163 targetFrame = m_page->focusController().focusedOrMainFrame();
2164
2165 if (targetFrame->isLocalFrame()) {
2166 LocalFrame* targetLocalFrame = toLocalFrame(targetFrame);
2167 Document* document = targetLocalFrame->document();
2168 if (document) { 2161 if (document) {
2169 AXObjectCache* cache = document->existingAXObjectCache(); 2162 AXObjectCache* cache = document->existingAXObjectCache();
2170 if (cache) 2163 if (cache)
2171 cache->onTouchAccessibilityHover(pme.position()); 2164 cache->onTouchAccessibilityHover(result.roundedPointInInnerN odeFrame());
2172 } 2165 }
2173 } 2166 }
2174 } 2167 }
2175 2168
2176 // Report the event to be NOT processed by WebKit, so that the browser can h andle it appropriately. 2169 // Report the event to be NOT processed by WebKit, so that the browser can h andle it appropriately.
2177 if (m_ignoreInputEvents) 2170 if (m_ignoreInputEvents)
2178 return WebInputEventResult::NotHandled; 2171 return WebInputEventResult::NotHandled;
2179 2172
2180 TemporaryChange<const WebInputEvent*> currentEventChange(m_currentInputEvent , &inputEvent); 2173 TemporaryChange<const WebInputEvent*> currentEventChange(m_currentInputEvent , &inputEvent);
2181 UIEventWithKeyState::clearNewTabModifierSetFromIsolatedWorld(); 2174 UIEventWithKeyState::clearNewTabModifierSetFromIsolatedWorld();
(...skipping 2342 matching lines...) Expand 10 before | Expand all | Expand 10 after
4524 { 4517 {
4525 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than 4518 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than
4526 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. 4519 // page's scale factor, which can be 1 in use-zoom-for-dsf mode.
4527 if (!page()) 4520 if (!page())
4528 return 1; 4521 return 1;
4529 4522
4530 return page()->deviceScaleFactor(); 4523 return page()->deviceScaleFactor();
4531 } 4524 }
4532 4525
4533 } // namespace blink 4526 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698