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

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 2261663002: Disallow cast/implicit conversion from LayoutUnit to int/unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 3 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
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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 FrameView* mainView = mainFrame->view(); 466 FrameView* mainView = mainFrame->view();
467 if (frameView && mainView) { 467 if (frameView && mainView) {
468 IntPoint mainFramePoint = mainView->rootFrameToContents(frameVie w->contentsToRootFrame(roundedIntPoint(point))); 468 IntPoint mainFramePoint = mainView->rootFrameToContents(frameVie w->contentsToRootFrame(roundedIntPoint(point)));
469 return mainFrame->eventHandler().hitTestResultAtPoint(mainFrameP oint, hitType, padding); 469 return mainFrame->eventHandler().hitTestResultAtPoint(mainFrameP oint, hitType, padding);
470 } 470 }
471 } 471 }
472 } 472 }
473 473
474 // hitTestResultAtPoint is specifically used to hitTest into all frames, thu s it always allows child frame content. 474 // hitTestResultAtPoint is specifically used to hitTest into all frames, thu s it always allows child frame content.
475 HitTestRequest request(hitType | HitTestRequest::AllowChildFrameContent); 475 HitTestRequest request(hitType | HitTestRequest::AllowChildFrameContent);
476 HitTestResult result(request, point, padding.height(), padding.width(), padd ing.height(), padding.width()); 476 HitTestResult result(request, point, padding.height().toUnsigned(), padding. width().toUnsigned(), padding.height().toUnsigned(), padding.width().toUnsigned( ));
477 477
478 // LayoutView::hitTest causes a layout, and we don't want to hit that until the first 478 // LayoutView::hitTest causes a layout, and we don't want to hit that until the first
479 // layout because until then, there is nothing shown on the screen - the use r can't 479 // layout because until then, there is nothing shown on the screen - the use r can't
480 // have intentionally clicked on something belonging to this page. Furthermo re, 480 // have intentionally clicked on something belonging to this page. Furthermo re,
481 // mousemove events before the first layout should not lead to a premature l ayout() 481 // mousemove events before the first layout should not lead to a premature l ayout()
482 // happening, which could show a flash of white. 482 // happening, which could show a flash of white.
483 // See also the similar code in Document::prepareMouseEvent. 483 // See also the similar code in Document::prepareMouseEvent.
484 if (m_frame->contentLayoutItem().isNull() || !m_frame->view() || !m_frame->v iew()->didFirstLayout()) 484 if (m_frame->contentLayoutItem().isNull() || !m_frame->view() || !m_frame->v iew()->didFirstLayout())
485 return result; 485 return result;
486 486
(...skipping 2113 matching lines...) Expand 10 before | Expand all | Expand 10 after
2600 2600
2601 FrameHost* EventHandler::frameHost() const 2601 FrameHost* EventHandler::frameHost() const
2602 { 2602 {
2603 if (!m_frame->page()) 2603 if (!m_frame->page())
2604 return nullptr; 2604 return nullptr;
2605 2605
2606 return &m_frame->page()->frameHost(); 2606 return &m_frame->page()->frameHost();
2607 } 2607 }
2608 2608
2609 } // namespace blink 2609 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698