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

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

Issue 1142283004: Implement a Hit Test Cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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, 2006 Apple Computer, Inc. 2 * Copyright (C) 2003, 2006 Apple Computer, Inc.
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 bool EllipsisBox::nodeAtPoint(HitTestResult& result, const HitTestLocation& loca tionInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, Layou tUnit lineBottom) 47 bool EllipsisBox::nodeAtPoint(HitTestResult& result, const HitTestLocation& loca tionInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, Layou tUnit lineBottom)
48 { 48 {
49 // FIXME: the call to roundedLayoutPoint() below is temporary and should be removed once 49 // FIXME: the call to roundedLayoutPoint() below is temporary and should be removed once
50 // the transition to LayoutUnit-based types is complete (crbug.com/321237) 50 // the transition to LayoutUnit-based types is complete (crbug.com/321237)
51 LayoutPoint adjustedLocation = accumulatedOffset + topLeft().roundedLayoutPo int(); 51 LayoutPoint adjustedLocation = accumulatedOffset + topLeft().roundedLayoutPo int();
52 52
53 FloatPointWillBeLayoutPoint boxOrigin = locationIncludingFlipping(); 53 FloatPointWillBeLayoutPoint boxOrigin = locationIncludingFlipping();
54 boxOrigin.moveBy(accumulatedOffset); 54 boxOrigin.moveBy(accumulatedOffset);
55 FloatRectWillBeLayoutRect boundsRect(boxOrigin, size()); 55 FloatRectWillBeLayoutRect boundsRect(boxOrigin, size());
56 if (visibleToHitTestRequest(result.hitTestRequest()) && boundsRect.intersect s(FloatRectWillBeLayoutRect(HitTestLocation::rectForPoint(locationInContainer.po int(), 0, 0, 0, 0)))) { 56 if (visibleToHitTestRequest(result.hitTestRequest()) && boundsRect.intersect s(FloatRectWillBeLayoutRect(HitTestLocation::rectForPoint(locationInContainer.po int(), 0, 0, 0, 0)))) {
57 layoutObject().updateHitTestResult(result, locationInContainer.point() - toLayoutSize(adjustedLocation)); 57 layoutObject().updateHitTestResult(result, locationInContainer.point() - toLayoutSize(adjustedLocation), boundsRect);
58 // FIXME: the call to rawValue() below is temporary and should be remove d once the transition 58 // FIXME: the call to rawValue() below is temporary and should be remove d once the transition
59 // to LayoutUnit-based types is complete (crbug.com/321237) 59 // to LayoutUnit-based types is complete (crbug.com/321237)
60 if (!result.addNodeToListBasedTestResult(layoutObject().node(), location InContainer, boundsRect.rawValue())) 60 if (!result.addNodeToListBasedTestResult(layoutObject().node(), location InContainer, boundsRect.rawValue()))
61 return true; 61 return true;
62 } 62 }
63 63
64 return false; 64 return false;
65 } 65 }
66 66
67 const char* EllipsisBox::boxName() const 67 const char* EllipsisBox::boxName() const
68 { 68 {
69 return "EllipsisBox"; 69 return "EllipsisBox";
70 } 70 }
71 71
72 } // namespace blink 72 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698