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

Side by Side Diff: Source/core/page/EventHandler.cpp

Issue 15508003: Revert "Don't force layout for mouse event hit tests" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 FrameView* mainView = mainFrame->view(); 919 FrameView* mainView = mainFrame->view();
920 if (frameView && mainView) { 920 if (frameView && mainView) {
921 IntPoint mainFramePoint = mainView->rootViewToContents(frameView ->contentsToRootView(roundedIntPoint(point))); 921 IntPoint mainFramePoint = mainView->rootViewToContents(frameView ->contentsToRootView(roundedIntPoint(point)));
922 return mainFrame->eventHandler()->hitTestResultAtPoint(mainFrame Point, hitType, padding); 922 return mainFrame->eventHandler()->hitTestResultAtPoint(mainFrame Point, hitType, padding);
923 } 923 }
924 } 924 }
925 } 925 }
926 926
927 HitTestResult result(point, padding.height(), padding.width(), padding.heigh t(), padding.width()); 927 HitTestResult result(point, padding.height(), padding.width(), padding.heigh t(), padding.width());
928 928
929 // RenderView::hitTest causes a layout, and we don't want to hit that until the first 929 if (!m_frame->contentRenderer())
930 // layout because until then, there is nothing shown on the screen - the use r can't
931 // have intentionally clicked on something belonging to this page. Furthermo re,
932 // mousemove events before the first layout should not lead to a premature l ayout()
933 // happening, which could show a flash of white.
934 // See also the similar code in Document::prepareMouseEvent.
935 if (!m_frame->contentRenderer() || !m_frame->view() || !m_frame->view()->did FirstLayout())
936 return result; 930 return result;
937 931
938 // hitTestResultAtPoint is specifically used to hitTest into all frames, thu s it always allows child frame content. 932 // hitTestResultAtPoint is specifically used to hitTest into all frames, thu s it always allows child frame content.
939 HitTestRequest request(hitType | HitTestRequest::AllowChildFrameContent); 933 HitTestRequest request(hitType | HitTestRequest::AllowChildFrameContent);
940 m_frame->contentRenderer()->hitTest(request, result); 934 m_frame->contentRenderer()->hitTest(request, result);
941 if (!request.readOnly()) 935 if (!request.readOnly())
942 m_frame->document()->updateHoverActiveState(request, result.innerElement ()); 936 m_frame->document()->updateHoverActiveState(request, result.innerElement ());
943 937
944 if (request.disallowsShadowContent()) 938 if (request.disallowsShadowContent())
945 result.setToNodesInDocumentTreeScope(); 939 result.setToNodesInDocumentTreeScope();
(...skipping 2955 matching lines...) Expand 10 before | Expand all | Expand 10 after
3901 unsigned EventHandler::accessKeyModifiers() 3895 unsigned EventHandler::accessKeyModifiers()
3902 { 3896 {
3903 #if OS(DARWIN) 3897 #if OS(DARWIN)
3904 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3898 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3905 #else 3899 #else
3906 return PlatformEvent::AltKey; 3900 return PlatformEvent::AltKey;
3907 #endif 3901 #endif
3908 } 3902 }
3909 3903
3910 } // namespace WebCore 3904 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698