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

Side by Side Diff: Source/core/layout/line/InlineBox.cpp

Issue 983693002: Hover not working correctly on image with border-radius. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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/borders/border-hittest-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) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details. 12 * Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public License 14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to 15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA. 17 * Boston, MA 02110-1301, USA.
18 */ 18 */
19 19
20 #include "config.h" 20 #include "config.h"
21 #include "core/layout/line/InlineBox.h" 21 #include "core/layout/line/InlineBox.h"
22 22
23 #include "core/layout/HitTestLocation.h"
23 #include "core/layout/LayoutBlockFlow.h" 24 #include "core/layout/LayoutBlockFlow.h"
24 #include "core/layout/LayoutObject.h" 25 #include "core/layout/LayoutObject.h"
25 #include "core/layout/PaintInfo.h" 26 #include "core/layout/PaintInfo.h"
26 #include "core/layout/line/InlineFlowBox.h" 27 #include "core/layout/line/InlineFlowBox.h"
27 #include "core/layout/line/RootInlineBox.h" 28 #include "core/layout/line/RootInlineBox.h"
28 #include "core/paint/BlockPainter.h" 29 #include "core/paint/BlockPainter.h"
29 #include "platform/Partitions.h" 30 #include "platform/Partitions.h"
30 #include "platform/fonts/FontMetrics.h" 31 #include "platform/fonts/FontMetrics.h"
31 32
32 #ifndef NDEBUG 33 #ifndef NDEBUG
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 208
208 bool InlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result , const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffs et, LayoutUnit /* lineTop */, LayoutUnit /*lineBottom*/) 209 bool InlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result , const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffs et, LayoutUnit /* lineTop */, LayoutUnit /*lineBottom*/)
209 { 210 {
210 // Hit test all phases of replaced elements atomically, as though the replac ed element established its 211 // Hit test all phases of replaced elements atomically, as though the replac ed element established its
211 // own stacking context. (See Appendix E.2, section 6.4 on inline block/tab le elements in the CSS2.1 212 // own stacking context. (See Appendix E.2, section 6.4 on inline block/tab le elements in the CSS2.1
212 // specification.) 213 // specification.)
213 LayoutPoint childPoint = accumulatedOffset; 214 LayoutPoint childPoint = accumulatedOffset;
214 if (parent()->layoutObject().hasFlippedBlocksWritingMode()) // Faster than c alling containingBlock(). 215 if (parent()->layoutObject().hasFlippedBlocksWritingMode()) // Faster than c alling containingBlock().
215 childPoint = layoutObject().containingBlock()->flipForWritingModeForChil d(&toLayoutBox(layoutObject()), childPoint); 216 childPoint = layoutObject().containingBlock()->flipForWritingModeForChil d(&toLayoutBox(layoutObject()), childPoint);
216 217
218 if (layoutObject().style()->hasBorderRadius()) {
219 LayoutRect borderRect = logicalFrameRect();
220 borderRect.moveBy(accumulatedOffset);
221 FloatRoundedRect border = layoutObject().style()->getRoundedBorderFor(bo rderRect);
222 if (!locationInContainer.intersects(border))
223 return false;
224 }
225
217 return layoutObject().hitTest(request, result, locationInContainer, childPoi nt); 226 return layoutObject().hitTest(request, result, locationInContainer, childPoi nt);
218 } 227 }
219 228
220 const RootInlineBox& InlineBox::root() const 229 const RootInlineBox& InlineBox::root() const
221 { 230 {
222 if (m_parent) 231 if (m_parent)
223 return m_parent->root(); 232 return m_parent->root();
224 ASSERT(isRootInlineBox()); 233 ASSERT(isRootInlineBox());
225 return static_cast<const RootInlineBox&>(*this); 234 return static_cast<const RootInlineBox&>(*this);
226 } 235 }
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 b->showTreeForThis(); 388 b->showTreeForThis();
380 } 389 }
381 390
382 void showLineTree(const blink::InlineBox* b) 391 void showLineTree(const blink::InlineBox* b)
383 { 392 {
384 if (b) 393 if (b)
385 b->showLineTreeForThis(); 394 b->showLineTreeForThis();
386 } 395 }
387 396
388 #endif 397 #endif
OLDNEW
« no previous file with comments | « LayoutTests/fast/borders/border-hittest-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698