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

Side by Side Diff: Source/core/layout/LayoutTableRow.cpp

Issue 1032823003: Refactor HitTestResult to store the HitTestRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated as per review comments Created 5 years, 8 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 | « Source/core/layout/LayoutTableRow.h ('k') | Source/core/layout/LayoutTableSection.h » ('j') | 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) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 // FIXME: Is this needed when issuing paint invalidations after layo ut? 187 // FIXME: Is this needed when issuing paint invalidations after layo ut?
188 cell->setShouldDoFullPaintInvalidation(); 188 cell->setShouldDoFullPaintInvalidation();
189 } 189 }
190 } 190 }
191 191
192 // LayoutTableSection::layoutRows will set our logical height and width late r, so it calls updateLayerTransform(). 192 // LayoutTableSection::layoutRows will set our logical height and width late r, so it calls updateLayerTransform().
193 clearNeedsLayout(); 193 clearNeedsLayout();
194 } 194 }
195 195
196 // Hit Testing 196 // Hit Testing
197 bool LayoutTableRow::nodeAtPoint(const HitTestRequest& request, HitTestResult& r esult, const HitTestLocation& locationInContainer, const LayoutPoint& accumulate dOffset, HitTestAction action) 197 bool LayoutTableRow::nodeAtPoint(HitTestResult& result, const HitTestLocation& l ocationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction action)
198 { 198 {
199 // Table rows cannot ever be hit tested. Effectively they do not exist. 199 // Table rows cannot ever be hit tested. Effectively they do not exist.
200 // Just forward to our children always. 200 // Just forward to our children always.
201 for (LayoutTableCell* cell = lastCell(); cell; cell = cell->previousCell()) { 201 for (LayoutTableCell* cell = lastCell(); cell; cell = cell->previousCell()) {
202 // FIXME: We have to skip over inline flows, since they can show up insi de table rows 202 // FIXME: We have to skip over inline flows, since they can show up insi de table rows
203 // at the moment (a demoted inline <form> for example). If we ever imple ment a 203 // at the moment (a demoted inline <form> for example). If we ever imple ment a
204 // table-specific hit-test method (which we should do for performance re asons anyway), 204 // table-specific hit-test method (which we should do for performance re asons anyway),
205 // then we can remove this check. 205 // then we can remove this check.
206 if (!cell->hasSelfPaintingLayer()) { 206 if (!cell->hasSelfPaintingLayer()) {
207 LayoutPoint cellPoint = flipForWritingModeForChild(cell, accumulated Offset); 207 LayoutPoint cellPoint = flipForWritingModeForChild(cell, accumulated Offset);
208 if (cell->nodeAtPoint(request, result, locationInContainer, cellPoin t, action)) { 208 if (cell->nodeAtPoint(result, locationInContainer, cellPoint, action )) {
209 updateHitTestResult(result, locationInContainer.point() - toLayo utSize(cellPoint)); 209 updateHitTestResult(result, locationInContainer.point() - toLayo utSize(cellPoint));
210 return true; 210 return true;
211 } 211 }
212 } 212 }
213 } 213 }
214 214
215 return false; 215 return false;
216 } 216 }
217 217
218 void LayoutTableRow::paint(const PaintInfo& paintInfo, const LayoutPoint& paintO ffset) 218 void LayoutTableRow::paint(const PaintInfo& paintInfo, const LayoutPoint& paintO ffset)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 // The cell and the row share the section's coordinate system. However 253 // The cell and the row share the section's coordinate system. However
254 // the visual overflow should be determined in the coordinate system of 254 // the visual overflow should be determined in the coordinate system of
255 // the row, that's why we shift it below. 255 // the row, that's why we shift it below.
256 LayoutUnit cellOffsetLogicalTopDifference = cell->location().y() - location( ).y(); 256 LayoutUnit cellOffsetLogicalTopDifference = cell->location().y() - location( ).y();
257 cellVisualOverflowRect.move(0, cellOffsetLogicalTopDifference); 257 cellVisualOverflowRect.move(0, cellOffsetLogicalTopDifference);
258 258
259 addVisualOverflow(cellVisualOverflowRect); 259 addVisualOverflow(cellVisualOverflowRect);
260 } 260 }
261 261
262 } // namespace blink 262 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutTableRow.h ('k') | Source/core/layout/LayoutTableSection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698