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

Side by Side Diff: Source/core/layout/line/RootInlineBox.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, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2008 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 void RootInlineBox::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOf fset, LayoutUnit lineTop, LayoutUnit lineBottom) 153 void RootInlineBox::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOf fset, LayoutUnit lineTop, LayoutUnit lineBottom)
154 { 154 {
155 RootInlineBoxPainter(*this).paint(paintInfo, paintOffset, lineTop, lineBotto m); 155 RootInlineBoxPainter(*this).paint(paintInfo, paintOffset, lineTop, lineBotto m);
156 } 156 }
157 157
158 bool RootInlineBox::nodeAtPoint(HitTestResult& result, const HitTestLocation& lo cationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, Lay outUnit lineBottom) 158 bool RootInlineBox::nodeAtPoint(HitTestResult& result, const HitTestLocation& lo cationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, Lay outUnit lineBottom)
159 { 159 {
160 if (hasEllipsisBox() && visibleToHitTestRequest(result.hitTestRequest())) { 160 if (hasEllipsisBox() && visibleToHitTestRequest(result.hitTestRequest())) {
161 if (ellipsisBox()->nodeAtPoint(result, locationInContainer, accumulatedO ffset, lineTop, lineBottom)) { 161 if (ellipsisBox()->nodeAtPoint(result, locationInContainer, accumulatedO ffset, lineTop, lineBottom)) {
162 layoutObject().updateHitTestResult(result, locationInContainer.point () - toLayoutSize(accumulatedOffset)); 162 // TODO(dtapuska): Calculate the right line box
163 layoutObject().updateHitTestResult(result, locationInContainer.point () - toLayoutSize(accumulatedOffset), result.validityRect());
163 return true; 164 return true;
164 } 165 }
165 } 166 }
166 return InlineFlowBox::nodeAtPoint(result, locationInContainer, accumulatedOf fset, lineTop, lineBottom); 167 return InlineFlowBox::nodeAtPoint(result, locationInContainer, accumulatedOf fset, lineTop, lineBottom);
167 } 168 }
168 169
169 void RootInlineBox::adjustPosition(FloatWillBeLayoutUnit dx, FloatWillBeLayoutUn it dy) 170 void RootInlineBox::adjustPosition(FloatWillBeLayoutUnit dx, FloatWillBeLayoutUn it dy)
170 { 171 {
171 InlineFlowBox::adjustPosition(dx, dy); 172 InlineFlowBox::adjustPosition(dx, dy);
172 LayoutUnit blockDirectionDelta = isHorizontal() ? dy : dx; // The block dire ction delta is a LayoutUnit. 173 LayoutUnit blockDirectionDelta = isHorizontal() ? dy : dx; // The block dire ction delta is a LayoutUnit.
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 endBox = 0; 848 endBox = 0;
848 return 0; 849 return 0;
849 } 850 }
850 851
851 const char* RootInlineBox::boxName() const 852 const char* RootInlineBox::boxName() const
852 { 853 {
853 return "RootInlineBox"; 854 return "RootInlineBox";
854 } 855 }
855 856
856 } // namespace blink 857 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698