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

Side by Side Diff: Source/core/layout/LayoutTableSection.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) 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, 2008, 2009, 2010, 2013 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc. All r ights 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 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 1521
1522 if (hasOverflowingCell()) { 1522 if (hasOverflowingCell()) {
1523 for (LayoutTableRow* row = lastRow(); row; row = row->previousRow()) { 1523 for (LayoutTableRow* row = lastRow(); row; row = row->previousRow()) {
1524 // FIXME: We have to skip over inline flows, since they can show up inside table rows 1524 // FIXME: We have to skip over inline flows, since they can show up inside table rows
1525 // at the moment (a demoted inline <form> for example). If we ever i mplement a 1525 // at the moment (a demoted inline <form> for example). If we ever i mplement a
1526 // table-specific hit-test method (which we should do for performanc e reasons anyway), 1526 // table-specific hit-test method (which we should do for performanc e reasons anyway),
1527 // then we can remove this check. 1527 // then we can remove this check.
1528 if (!row->hasSelfPaintingLayer()) { 1528 if (!row->hasSelfPaintingLayer()) {
1529 LayoutPoint childPoint = flipForWritingModeForChild(row, adjuste dLocation); 1529 LayoutPoint childPoint = flipForWritingModeForChild(row, adjuste dLocation);
1530 if (row->nodeAtPoint(result, locationInContainer, childPoint, ac tion)) { 1530 if (row->nodeAtPoint(result, locationInContainer, childPoint, ac tion)) {
1531 updateHitTestResult(result, toLayoutPoint(locationInContaine r.point() - childPoint)); 1531 // TODO(dtapuska): Calculate correct box for row.
1532 updateHitTestResult(result, toLayoutPoint(locationInContaine r.point() - childPoint), result.validityRect());
1532 return true; 1533 return true;
1533 } 1534 }
1534 } 1535 }
1535 } 1536 }
1536 return false; 1537 return false;
1537 } 1538 }
1538 1539
1539 recalcCellsIfNeeded(); 1540 recalcCellsIfNeeded();
1540 1541
1541 LayoutRect hitTestRect = LayoutRect(locationInContainer.boundingBox()); 1542 LayoutRect hitTestRect = LayoutRect(locationInContainer.boundingBox());
(...skipping 10 matching lines...) Expand all
1552 1553
1553 // If the cell is empty, there's nothing to do 1554 // If the cell is empty, there's nothing to do
1554 if (!current.hasCells()) 1555 if (!current.hasCells())
1555 continue; 1556 continue;
1556 1557
1557 for (unsigned i = current.cells.size() ; i; ) { 1558 for (unsigned i = current.cells.size() ; i; ) {
1558 --i; 1559 --i;
1559 LayoutTableCell* cell = current.cells[i]; 1560 LayoutTableCell* cell = current.cells[i];
1560 LayoutPoint cellPoint = flipForWritingModeForChild(cell, adjuste dLocation); 1561 LayoutPoint cellPoint = flipForWritingModeForChild(cell, adjuste dLocation);
1561 if (static_cast<LayoutObject*>(cell)->nodeAtPoint(result, locati onInContainer, cellPoint, action)) { 1562 if (static_cast<LayoutObject*>(cell)->nodeAtPoint(result, locati onInContainer, cellPoint, action)) {
1562 updateHitTestResult(result, locationInContainer.point() - to LayoutSize(cellPoint)); 1563 updateHitTestResult(result, locationInContainer.point() - to LayoutSize(cellPoint), overflowClipRect(adjustedLocation));
1563 return true; 1564 return true;
1564 } 1565 }
1565 } 1566 }
1566 if (!result.hitTestRequest().listBased()) 1567 if (!result.hitTestRequest().listBased())
1567 break; 1568 break;
1568 } 1569 }
1569 if (!result.hitTestRequest().listBased()) 1570 if (!result.hitTestRequest().listBased())
1570 break; 1571 break;
1571 } 1572 }
1572 1573
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1622 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691). 1623 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691).
1623 if (!style()->isLeftToRightDirection()) 1624 if (!style()->isLeftToRightDirection())
1624 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); 1625 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing);
1625 else 1626 else
1626 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); 1627 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing);
1627 1628
1628 cell->setLogicalLocation(cellLocation); 1629 cell->setLogicalLocation(cellLocation);
1629 } 1630 }
1630 1631
1631 } // namespace blink 1632 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698