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

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

Issue 1616673005: Revert "Fix-up a wrong hit testing when a parent inline has border radius." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « third_party/WebKit/LayoutTests/fast/inline-block/hittest-child-of-inlineblock.html ('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
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 bool InlineBox::nodeAtPoint(HitTestResult& result, const HitTestLocation& locati onInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit /* lineTop */, L ayoutUnit /* lineBottom */) 220 bool InlineBox::nodeAtPoint(HitTestResult& result, const HitTestLocation& locati onInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit /* lineTop */, L ayoutUnit /* lineBottom */)
221 { 221 {
222 // Hit test all phases of replaced elements atomically, as though the replac ed element established its 222 // Hit test all phases of replaced elements atomically, as though the replac ed element established its
223 // own stacking context. (See Appendix E.2, section 6.4 on inline block/tab le elements in the CSS2.1 223 // own stacking context. (See Appendix E.2, section 6.4 on inline block/tab le elements in the CSS2.1
224 // specification.) 224 // specification.)
225 LayoutPoint childPoint = accumulatedOffset; 225 LayoutPoint childPoint = accumulatedOffset;
226 if (parent()->lineLayoutItem().hasFlippedBlocksWritingMode()) // Faster than calling containingBlock(). 226 if (parent()->lineLayoutItem().hasFlippedBlocksWritingMode()) // Faster than calling containingBlock().
227 childPoint = layoutObject().containingBlock()->flipForWritingModeForChil d(&toLayoutBox(layoutObject()), childPoint); 227 childPoint = layoutObject().containingBlock()->flipForWritingModeForChil d(&toLayoutBox(layoutObject()), childPoint);
228 228
229 if (lineLayoutItem().hitTest(result, locationInContainer, childPoint))
230 return true;
231
232 if (lineLayoutItem().style()->hasBorderRadius()) { 229 if (lineLayoutItem().style()->hasBorderRadius()) {
233 LayoutRect borderRect = logicalFrameRect(); 230 LayoutRect borderRect = logicalFrameRect();
234 borderRect.moveBy(accumulatedOffset); 231 borderRect.moveBy(accumulatedOffset);
235 FloatRoundedRect border = lineLayoutItem().style()->getRoundedBorderFor( borderRect); 232 FloatRoundedRect border = lineLayoutItem().style()->getRoundedBorderFor( borderRect);
236 if (locationInContainer.intersects(border)) 233 if (!locationInContainer.intersects(border))
237 return true; 234 return false;
238 } 235 }
239 return false; 236
237 return lineLayoutItem().hitTest(result, locationInContainer, childPoint);
240 } 238 }
241 239
242 const RootInlineBox& InlineBox::root() const 240 const RootInlineBox& InlineBox::root() const
243 { 241 {
244 if (m_parent) 242 if (m_parent)
245 return m_parent->root(); 243 return m_parent->root();
246 ASSERT(isRootInlineBox()); 244 ASSERT(isRootInlineBox());
247 return static_cast<const RootInlineBox&>(*this); 245 return static_cast<const RootInlineBox&>(*this);
248 } 246 }
249 247
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 410
413 void showLineTree(const blink::InlineBox* b) 411 void showLineTree(const blink::InlineBox* b)
414 { 412 {
415 if (b) 413 if (b)
416 b->showLineTreeForThis(); 414 b->showLineTreeForThis();
417 else 415 else
418 fprintf(stderr, "Cannot showLineTree for (nil) InlineBox.\n"); 416 fprintf(stderr, "Cannot showLineTree for (nil) InlineBox.\n");
419 } 417 }
420 418
421 #endif 419 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/inline-block/hittest-child-of-inlineblock.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698