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

Unified Diff: Source/core/layout/LayoutTableSection.cpp

Issue 1306433002: Let collapsed border drawings be cacheable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | « Source/core/layout/LayoutTableSection.h ('k') | Source/core/paint/TableCellPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutTableSection.cpp
diff --git a/Source/core/layout/LayoutTableSection.cpp b/Source/core/layout/LayoutTableSection.cpp
index 13715dbd10623afcc0edecbfdecc50b7cad9f90b..f8e4c0b3927abd5e0178c2ee1c8cbc06a382e505 100644
--- a/Source/core/layout/LayoutTableSection.cpp
+++ b/Source/core/layout/LayoutTableSection.cpp
@@ -1602,14 +1602,19 @@ void LayoutTableSection::removeCachedCollapsedBorders(const LayoutTableCell* cel
m_cellsCollapsedBorders.remove(std::make_pair(cell, side));
}
-void LayoutTableSection::setCachedCollapsedBorder(const LayoutTableCell* cell, CollapsedBorderSide side, const CollapsedBorderValue& border)
+bool LayoutTableSection::setCachedCollapsedBorder(const LayoutTableCell* cell, CollapsedBorderSide side, const CollapsedBorderValue& border)
{
ASSERT(table()->collapseBorders());
CellsCollapsedBordersMap::iterator it = m_cellsCollapsedBorders.find(std::make_pair(cell, side));
- if (it == m_cellsCollapsedBorders.end())
+ if (it == m_cellsCollapsedBorders.end()) {
m_cellsCollapsedBorders.add(std::make_pair(cell, side), border);
- else
+ return true;
+ }
+ if (!it->value.equals(border)) {
it->value = border;
+ return true;
+ }
+ return false;
}
const CollapsedBorderValue& LayoutTableSection::cachedCollapsedBorder(const LayoutTableCell* cell, CollapsedBorderSide side) const
« no previous file with comments | « Source/core/layout/LayoutTableSection.h ('k') | Source/core/paint/TableCellPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698