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

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

Issue 15425005: 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
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 if (!m_frame->contentRenderer()) 929 // RenderView::hitTest causes a layout, and we don't want to hit that until the first
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())
930 return result; 936 return result;
931 937
932 // hitTestResultAtPoint is specifically used to hitTest into all frames, thu s it always allows child frame content. 938 // hitTestResultAtPoint is specifically used to hitTest into all frames, thu s it always allows child frame content.
933 HitTestRequest request(hitType | HitTestRequest::AllowChildFrameContent); 939 HitTestRequest request(hitType | HitTestRequest::AllowChildFrameContent);
934 m_frame->contentRenderer()->hitTest(request, result); 940 m_frame->contentRenderer()->hitTest(request, result);
935 if (!request.readOnly()) 941 if (!request.readOnly())
936 m_frame->document()->updateHoverActiveState(request, result.innerElement ()); 942 m_frame->document()->updateHoverActiveState(request, result.innerElement ());
937 943
938 if (request.disallowsShadowContent()) 944 if (request.disallowsShadowContent())
939 result.setToNodesInDocumentTreeScope(); 945 result.setToNodesInDocumentTreeScope();
(...skipping 2955 matching lines...) Expand 10 before | Expand all | Expand 10 after
3895 unsigned EventHandler::accessKeyModifiers() 3901 unsigned EventHandler::accessKeyModifiers()
3896 { 3902 {
3897 #if OS(DARWIN) 3903 #if OS(DARWIN)
3898 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3904 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3899 #else 3905 #else
3900 return PlatformEvent::AltKey; 3906 return PlatformEvent::AltKey;
3901 #endif 3907 #endif
3902 } 3908 }
3903 3909
3904 } // namespace WebCore 3910 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698