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

Side by Side Diff: Source/core/rendering/RenderBlock.cpp

Issue 230943003: hitTest should check the location if it is inside borderBoxRect in case of overflow: hidden (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review comments addressed Created 6 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
« no previous file with comments | « LayoutTests/fast/overflow/hit-test-overflow-hidden-with-box-shadow-expected.txt ('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) 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 2845 matching lines...) Expand 10 before | Expand all | Expand 10 after
2856 return isAnonymousBlockContinuation() ? continuation()->node() : node(); 2856 return isAnonymousBlockContinuation() ? continuation()->node() : node();
2857 } 2857 }
2858 2858
2859 bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu lt, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOf fset, HitTestAction hitTestAction) 2859 bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu lt, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOf fset, HitTestAction hitTestAction)
2860 { 2860 {
2861 LayoutPoint adjustedLocation(accumulatedOffset + location()); 2861 LayoutPoint adjustedLocation(accumulatedOffset + location());
2862 LayoutSize localOffset = toLayoutSize(adjustedLocation); 2862 LayoutSize localOffset = toLayoutSize(adjustedLocation);
2863 2863
2864 if (!isRenderView()) { 2864 if (!isRenderView()) {
2865 // Check if we need to do anything at all. 2865 // Check if we need to do anything at all.
2866 LayoutRect overflowBox = visualOverflowRect(); 2866 // If we have clipping, then we can't have any spillout.
2867 LayoutRect overflowBox = hasOverflowClip() ? borderBoxRect() : visualOve rflowRect();
2867 flipForWritingMode(overflowBox); 2868 flipForWritingMode(overflowBox);
2868 overflowBox.moveBy(adjustedLocation); 2869 overflowBox.moveBy(adjustedLocation);
2869 if (!locationInContainer.intersects(overflowBox)) 2870 if (!locationInContainer.intersects(overflowBox))
2870 return false; 2871 return false;
2871 } 2872 }
2872 2873
2873 if ((hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChil dBlockBackground) 2874 if ((hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChil dBlockBackground)
2874 && visibleToHitTestRequest(request) 2875 && visibleToHitTestRequest(request)
2875 && isPointInOverflowControl(result, locationInContainer.point(), adjuste dLocation)) { 2876 && isPointInOverflowControl(result, locationInContainer.point(), adjuste dLocation)) {
2876 updateHitTestResult(result, locationInContainer.point() - localOffset); 2877 updateHitTestResult(result, locationInContainer.point() - localOffset);
(...skipping 2144 matching lines...) Expand 10 before | Expand all | Expand 10 after
5021 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 5022 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
5022 { 5023 {
5023 showRenderObject(); 5024 showRenderObject();
5024 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 5025 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
5025 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 5026 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
5026 } 5027 }
5027 5028
5028 #endif 5029 #endif
5029 5030
5030 } // namespace WebCore 5031 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/overflow/hit-test-overflow-hidden-with-box-shadow-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698