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

Unified Diff: Source/core/rendering/RenderObject.cpp

Issue 744493002: Let RenderTable reach table cells needing overflow recalc (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Avoid O(rows*cols) Created 6 years, 1 month 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
Index: Source/core/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index ff25785b44017adb01740cf240ed9a6f6d028013..ea8d42c7dad74b6c18d0b76d606892304290f3e0 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -1614,18 +1614,26 @@ void RenderObject::setPseudoStyle(PassRefPtr<RenderStyle> pseudoStyle)
setStyle(pseudoStyle);
}
-void RenderObject::markContainingBlocksForOverflowRecalc()
+static RenderObject* containerForOverflowRecalc(const RenderObject* object)
{
- for (RenderBlock* container = containingBlock(); container && !container->childNeedsOverflowRecalcAfterStyleChange(); container = container->containingBlock())
- container->setChildNeedsOverflowRecalcAfterStyleChange(true);
+ // For table parts, we let the parent (e.g. RenderTableRow for RenderTableCell)
+ // handle the childNeedsOverflowRecalcAfterStyleChange flag, because
+ // RenderBlock::recalcChildOverflowAfterStyleChange() may not reach the table parts.
+ return object->isTablePart() ? object->parent() : object->containingBlock();
+}
Julien - ping for review 2014/11/25 18:33:10 :( Wouldn't container() work without needing this
Xianzhu 2014/11/25 20:17:12 This seems not the best because we'll set the flag
+
+void RenderObject::markContainersForOverflowRecalc()
Julien - ping for review 2014/11/25 18:33:10 If you put container in the name, I would have exp
+{
+ for (RenderObject* container = containerForOverflowRecalc(this); container && !container->childNeedsOverflowRecalcAfterStyleChange(); container = containerForOverflowRecalc(container))
+ container->setChildNeedsOverflowRecalcAfterStyleChange();
}
void RenderObject::setNeedsOverflowRecalcAfterStyleChange()
{
bool neededRecalc = needsOverflowRecalcAfterStyleChange();
- setSelfNeedsOverflowRecalcAfterStyleChange(true);
+ setSelfNeedsOverflowRecalcAfterStyleChange();
if (!neededRecalc)
- markContainingBlocksForOverflowRecalc();
+ markContainersForOverflowRecalc();
}
void RenderObject::setStyle(PassRefPtr<RenderStyle> style)
@@ -1827,7 +1835,7 @@ void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
// Ditto.
if (needsOverflowRecalcAfterStyleChange() && oldStyle->position() != m_style->position())
- markContainingBlocksForOverflowRecalc();
+ markContainersForOverflowRecalc();
if (diff.needsFullLayout())
setNeedsLayoutAndPrefWidthsRecalc();

Powered by Google App Engine
This is Rietveld 408576698