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

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"
davve 2015/03/18 15:20:40 Why do you need to add this include? None of the a
Abhijeet Kandalkar Slow 2015/03/19 13:38:15 locationInContainer is of type HitTestLocation, so
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()->layoutObject().hasFlippedBlocksWritingMode()) // Faster than c alling containingBlock(). 210 if (parent()->layoutObject().hasFlippedBlocksWritingMode()) // Faster than c alling containingBlock().
209 childPoint = layoutObject().containingBlock()->flipForWritingModeForChil d(&toLayoutBox(layoutObject()), childPoint); 211 childPoint = layoutObject().containingBlock()->flipForWritingModeForChil d(&toLayoutBox(layoutObject()), childPoint);
210 212
213 if (layoutObject().style()->hasBorderRadius()) {
davve 2015/03/18 15:20:40 While adding this code addresses the test in the b
Abhijeet Kandalkar Slow 2015/03/19 13:38:15 We can raise separate bug for this special use cas
214 LayoutRect borderRect = logicalFrameRect();
215 LayoutPoint adjustedLocation(accumulatedOffset);
davve 2015/03/18 15:20:40 Not sure there is value in the adjustedLocation va
Abhijeet Kandalkar Slow 2015/03/19 13:38:15 Done.
216 borderRect.moveBy(adjustedLocation);
217 FloatRoundedRect border = layoutObject().style()->getRoundedBorderFor(bo rderRect);
218 if (!locationInContainer.intersects(border))
219 return false;
220 }
221
211 return layoutObject().hitTest(request, result, locationInContainer, childPoi nt); 222 return layoutObject().hitTest(request, result, locationInContainer, childPoi nt);
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 b->showTreeForThis(); 384 b->showTreeForThis();
374 } 385 }
375 386
376 void showLineTree(const blink::InlineBox* b) 387 void showLineTree(const blink::InlineBox* b)
377 { 388 {
378 if (b) 389 if (b)
379 b->showLineTreeForThis(); 390 b->showLineTreeForThis();
380 } 391 }
381 392
382 #endif 393 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698