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

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
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"
24 #include "core/layout/HitTestResult.h"
23 #include "core/layout/LayoutBlockFlow.h" 25 #include "core/layout/LayoutBlockFlow.h"
24 #include "core/layout/LayoutObject.h" 26 #include "core/layout/LayoutObject.h"
25 #include "core/layout/PaintInfo.h" 27 #include "core/layout/PaintInfo.h"
26 #include "core/layout/line/InlineFlowBox.h" 28 #include "core/layout/line/InlineFlowBox.h"
27 #include "core/layout/line/RootInlineBox.h" 29 #include "core/layout/line/RootInlineBox.h"
28 #include "core/paint/BlockPainter.h" 30 #include "core/paint/BlockPainter.h"
29 #include "platform/Partitions.h" 31 #include "platform/Partitions.h"
30 #include "platform/fonts/FontMetrics.h" 32 #include "platform/fonts/FontMetrics.h"
31 33
32 #ifndef NDEBUG 34 #ifndef NDEBUG
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 203
202 bool InlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result , const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffs et, LayoutUnit /* lineTop */, LayoutUnit /*lineBottom*/) 204 bool InlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result , const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffs et, LayoutUnit /* lineTop */, LayoutUnit /*lineBottom*/)
203 { 205 {
204 // Hit test all phases of replaced elements atomically, as though the replac ed element established its 206 // Hit test all phases of replaced elements atomically, as though the replac ed element established its
205 // own stacking context. (See Appendix E.2, section 6.4 on inline block/tab le elements in the CSS2.1 207 // own stacking context. (See Appendix E.2, section 6.4 on inline block/tab le elements in the CSS2.1
206 // specification.) 208 // specification.)
207 LayoutPoint childPoint = accumulatedOffset; 209 LayoutPoint childPoint = accumulatedOffset;
208 if (parent()->renderer().hasFlippedBlocksWritingMode()) // Faster than calli ng containingBlock(). 210 if (parent()->renderer().hasFlippedBlocksWritingMode()) // Faster than calli ng containingBlock().
209 childPoint = renderer().containingBlock()->flipForWritingModeForChild(&t oLayoutBox(renderer()), childPoint); 211 childPoint = renderer().containingBlock()->flipForWritingModeForChild(&t oLayoutBox(renderer()), childPoint);
210 212
213 if (renderer().style()->hasBorderRadius()) {
214 LayoutRect borderRect = logicalFrameRect();
215 LayoutPoint adjustedLocation(accumulatedOffset);
216 borderRect.moveBy(adjustedLocation);
217 FloatRoundedRect border = renderer().style()->getRoundedBorderFor(border Rect);
218 if (!locationInContainer.intersects(border))
219 return false;
220 }
221
211 return renderer().hitTest(request, result, locationInContainer, childPoint); 222 return renderer().hitTest(request, result, locationInContainer, childPoint);
212 } 223 }
213 224
214 const RootInlineBox& InlineBox::root() const 225 const RootInlineBox& InlineBox::root() const
215 { 226 {
216 if (m_parent) 227 if (m_parent)
217 return m_parent->root(); 228 return m_parent->root();
218 ASSERT(isRootInlineBox()); 229 ASSERT(isRootInlineBox());
219 return static_cast<const RootInlineBox&>(*this); 230 return static_cast<const RootInlineBox&>(*this);
220 } 231 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 b->showTreeForThis(); 369 b->showTreeForThis();
359 } 370 }
360 371
361 void showLineTree(const blink::InlineBox* b) 372 void showLineTree(const blink::InlineBox* b)
362 { 373 {
363 if (b) 374 if (b)
364 b->showLineTreeForThis(); 375 b->showLineTreeForThis();
365 } 376 }
366 377
367 #endif 378 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698