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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTableCell.cpp

Issue 2616463003: Reference table via the cell for collapsed border display item client (Closed)
Patch Set: - Created 3 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableCell.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutTableCell.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp b/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp
index bfacd7af9777c4b9c14841dc961c30ee69e1a493..063d7bed3b6a0f9155d028b0d03a9ece9495bf26 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp
@@ -69,12 +69,12 @@ LayoutTableCell::LayoutTableCell(Element* element)
}
LayoutTableCell::CollapsedBorderValues::CollapsedBorderValues(
- const LayoutTable& layoutTable,
+ const LayoutTableCell& layoutTableCell,
const CollapsedBorderValue& startBorder,
const CollapsedBorderValue& endBorder,
const CollapsedBorderValue& beforeBorder,
const CollapsedBorderValue& afterBorder)
- : m_layoutTable(layoutTable),
+ : m_layoutTableCell(layoutTableCell),
m_startBorder(startBorder),
m_endBorder(endBorder),
m_beforeBorder(beforeBorder),
@@ -93,7 +93,7 @@ String LayoutTableCell::CollapsedBorderValues::debugName() const {
}
LayoutRect LayoutTableCell::CollapsedBorderValues::visualRect() const {
- return m_layoutTable.visualRect();
+ return m_layoutTableCell.table()->visualRect();
}
void LayoutTableCell::willBeRemovedFromTree() {
@@ -1321,7 +1321,7 @@ static void addBorderStyle(LayoutTable::CollapsedBorderValues& borderValues,
void LayoutTableCell::collectBorderValues(
LayoutTable::CollapsedBorderValues& borderValues) {
CollapsedBorderValues newValues(
- *table(), computeCollapsedStartBorder(), computeCollapsedEndBorder(),
+ *this, computeCollapsedStartBorder(), computeCollapsedEndBorder(),
computeCollapsedBeforeBorder(), computeCollapsedAfterBorder());
bool changed = false;
@@ -1333,9 +1333,8 @@ void LayoutTableCell::collectBorderValues(
m_collapsedBorderValues = nullptr;
} else if (!m_collapsedBorderValues) {
changed = true;
- m_collapsedBorderValues = WTF::wrapUnique(new CollapsedBorderValues(
- *table(), newValues.startBorder(), newValues.endBorder(),
- newValues.beforeBorder(), newValues.afterBorder()));
+ m_collapsedBorderValues =
+ WTF::wrapUnique(new CollapsedBorderValues(newValues));
wkorman 2017/01/03 21:36:58 The params don't seem to match the ctor, but I mus
Xianzhu 2017/01/03 21:48:56 This uses the default copy constructor. I think th
wkorman 2017/01/03 22:05:36 Ah, LOL, ok.
} else {
// We check visuallyEquals so that the table cell is invalidated only if a
// changed collapsed border is visible in the first place.
@@ -1355,10 +1354,11 @@ void LayoutTableCell::collectBorderValues(
// the table's backing.
// TODO(crbug.com/451090#c5): Need a way to invalidate/repaint the borders
// only.
- if (changed)
+ if (changed) {
ObjectPaintInvalidator(*table())
.slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(
*this, PaintInvalidationStyleChange);
+ }
addBorderStyle(borderValues, newValues.startBorder());
addBorderStyle(borderValues, newValues.endBorder());
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableCell.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698