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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlock.cpp

Issue 1897753002: Check scrollbars before hit testing border radius (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after
1622 } 1622 }
1623 1623
1624 return false; 1624 return false;
1625 } 1625 }
1626 1626
1627 bool LayoutBlock::hitTestChildren(HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTest Action) 1627 bool LayoutBlock::hitTestChildren(HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTest Action)
1628 { 1628 {
1629 // TODO(pdr): We should also check for css clip in the !isSelfPaintingLayer 1629 // TODO(pdr): We should also check for css clip in the !isSelfPaintingLayer
1630 // case, similar to overflow clip below. 1630 // case, similar to overflow clip below.
1631 if (hasOverflowClip() && !hasSelfPaintingLayer()) { 1631 if (hasOverflowClip() && !hasSelfPaintingLayer()) {
1632 if (!locationInContainer.intersects(overflowClipRect(accumulatedOffset, IncludeOverlayScrollbarSize)))
chrishtr 2016/04/18 16:17:38 When would overflowClipRect(...) be smaller than s
1633 return false;
1632 if (style()->hasBorderRadius()) { 1634 if (style()->hasBorderRadius()) {
1633 LayoutRect borderRect = borderBoxRect(); 1635 LayoutRect borderRect = borderBoxRect();
1634 borderRect.moveBy(accumulatedOffset); 1636 borderRect.moveBy(accumulatedOffset);
1635 if (!locationInContainer.intersects(style()->getRoundedInnerBorderFo r(borderRect))) 1637 if (!locationInContainer.intersects(style()->getRoundedInnerBorderFo r(borderRect)))
1636 return false; 1638 return false;
1637 } else {
1638 if (!locationInContainer.intersects(overflowClipRect(accumulatedOffs et, IncludeOverlayScrollbarSize)))
1639 return false;
1640 } 1639 }
1641 } 1640 }
1642 1641
1643 // A control clip can also clip out child hit testing. 1642 // A control clip can also clip out child hit testing.
1644 if (hasControlClip() && !locationInContainer.intersects(controlClipRect(accu mulatedOffset))) 1643 if (hasControlClip() && !locationInContainer.intersects(controlClipRect(accu mulatedOffset)))
1645 return false; 1644 return false;
1646 1645
1647 LayoutPoint scrolledOffset(hasOverflowClip() ? accumulatedOffset - scrolledC ontentOffset() : accumulatedOffset); 1646 LayoutPoint scrolledOffset(hasOverflowClip() ? accumulatedOffset - scrolledC ontentOffset() : accumulatedOffset);
1648 if (childrenInline() && !isTable()) { 1647 if (childrenInline() && !isTable()) {
1649 if (m_lineBoxes.hitTest(LineLayoutBoxModel(this), result, locationInCont ainer, scrolledOffset, hitTestAction)) { 1648 if (m_lineBoxes.hitTest(LineLayoutBoxModel(this), result, locationInCont ainer, scrolledOffset, hitTestAction)) {
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
2833 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const 2832 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
2834 { 2833 {
2835 showLayoutObject(); 2834 showLayoutObject();
2836 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 2835 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
2837 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 2836 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
2838 } 2837 }
2839 2838
2840 #endif 2839 #endif
2841 2840
2842 } // namespace blink 2841 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698