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

Side by Side Diff: Source/core/layout/LayoutTable.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/LayoutTable.h ('k') | Source/core/layout/LayoutTableRow.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 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 rect.setY(location.y()); 1304 rect.setY(location.y());
1305 } else { 1305 } else {
1306 rect.setWidth(size().width()); 1306 rect.setWidth(size().width());
1307 rect.setX(location.x()); 1307 rect.setX(location.x());
1308 } 1308 }
1309 } 1309 }
1310 1310
1311 return rect; 1311 return rect;
1312 } 1312 }
1313 1313
1314 bool LayoutTable::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu lt, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOf fset, HitTestAction action) 1314 bool LayoutTable::nodeAtPoint(HitTestResult& result, const HitTestLocation& loca tionInContainer, const LayoutPoint& accumulatedOffset, HitTestAction action)
1315 { 1315 {
1316 LayoutPoint adjustedLocation = accumulatedOffset + location(); 1316 LayoutPoint adjustedLocation = accumulatedOffset + location();
1317 1317
1318 // Check kids first. 1318 // Check kids first.
1319 if (!hasOverflowClip() || locationInContainer.intersects(overflowClipRect(ad justedLocation))) { 1319 if (!hasOverflowClip() || locationInContainer.intersects(overflowClipRect(ad justedLocation))) {
1320 for (LayoutObject* child = lastChild(); child; child = child->previousSi bling()) { 1320 for (LayoutObject* child = lastChild(); child; child = child->previousSi bling()) {
1321 if (child->isBox() && !toLayoutBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || child->isTableCaption())) { 1321 if (child->isBox() && !toLayoutBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || child->isTableCaption())) {
1322 LayoutPoint childPoint = flipForWritingModeForChild(toLayoutBox( child), adjustedLocation); 1322 LayoutPoint childPoint = flipForWritingModeForChild(toLayoutBox( child), adjustedLocation);
1323 if (child->nodeAtPoint(request, result, locationInContainer, chi ldPoint, action)) { 1323 if (child->nodeAtPoint(result, locationInContainer, childPoint, action)) {
1324 updateHitTestResult(result, toLayoutPoint(locationInContaine r.point() - childPoint)); 1324 updateHitTestResult(result, toLayoutPoint(locationInContaine r.point() - childPoint));
1325 return true; 1325 return true;
1326 } 1326 }
1327 } 1327 }
1328 } 1328 }
1329 } 1329 }
1330 1330
1331 // Check our bounds next. 1331 // Check our bounds next.
1332 LayoutRect boundsRect(adjustedLocation, size()); 1332 LayoutRect boundsRect(adjustedLocation, size());
1333 if (visibleToHitTestRequest(request) && (action == HitTestBlockBackground || action == HitTestChildBlockBackground) && locationInContainer.intersects(bounds Rect)) { 1333 if (visibleToHitTestRequest(result.hitTestRequest()) && (action == HitTestBl ockBackground || action == HitTestChildBlockBackground) && locationInContainer.i ntersects(boundsRect)) {
1334 updateHitTestResult(result, flipForWritingMode(locationInContainer.point () - toLayoutSize(adjustedLocation))); 1334 updateHitTestResult(result, flipForWritingMode(locationInContainer.point () - toLayoutSize(adjustedLocation)));
1335 if (!result.addNodeToListBasedTestResult(node(), request, locationInCont ainer, boundsRect)) 1335 if (!result.addNodeToListBasedTestResult(node(), locationInContainer, bo undsRect))
1336 return true; 1336 return true;
1337 } 1337 }
1338 1338
1339 return false; 1339 return false;
1340 } 1340 }
1341 1341
1342 LayoutTable* LayoutTable::createAnonymousWithParentRenderer(const LayoutObject* parent) 1342 LayoutTable* LayoutTable::createAnonymousWithParentRenderer(const LayoutObject* parent)
1343 { 1343 {
1344 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp lay(parent->styleRef(), TABLE); 1344 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp lay(parent->styleRef(), TABLE);
1345 LayoutTable* newTable = new LayoutTable(0); 1345 LayoutTable* newTable = new LayoutTable(0);
(...skipping 14 matching lines...) Expand all
1360 const BorderValue& LayoutTable::tableEndBorderAdjoiningCell(const LayoutTableCel l* cell) const 1360 const BorderValue& LayoutTable::tableEndBorderAdjoiningCell(const LayoutTableCel l* cell) const
1361 { 1361 {
1362 ASSERT(cell->isFirstOrLastCellInRow()); 1362 ASSERT(cell->isFirstOrLastCellInRow());
1363 if (hasSameDirectionAs(cell->row())) 1363 if (hasSameDirectionAs(cell->row()))
1364 return style()->borderEnd(); 1364 return style()->borderEnd();
1365 1365
1366 return style()->borderStart(); 1366 return style()->borderStart();
1367 } 1367 }
1368 1368
1369 } 1369 }
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutTable.h ('k') | Source/core/layout/LayoutTableRow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698