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

Unified Diff: Source/WebCore/rendering/RenderBlock.cpp

Issue 10756009: Merge 120862 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 5 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/WebCore/rendering/RenderBlock.h ('k') | Source/WebCore/rendering/RenderBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderBlock.cpp
===================================================================
--- Source/WebCore/rendering/RenderBlock.cpp (revision 122126)
+++ Source/WebCore/rendering/RenderBlock.cpp (working copy)
@@ -3872,17 +3872,49 @@
return gPercentHeightDescendantsMap ? gPercentHeightDescendantsMap->get(this) : 0;
}
-#if !ASSERT_DISABLED
+bool RenderBlock::hasPercentHeightContainerMap()
+{
+ return gPercentHeightContainerMap;
+}
+
bool RenderBlock::hasPercentHeightDescendant(RenderBox* descendant)
{
- ASSERT(descendant);
- if (!gPercentHeightContainerMap)
- return false;
- HashSet<RenderBlock*>* containerSet = gPercentHeightContainerMap->take(descendant);
- return containerSet && containerSet->size();
+ // We don't null check gPercentHeightContainerMap since the caller
+ // already ensures this and we need to call this function on every
+ // descendant in clearPercentHeightDescendantsFrom().
+ ASSERT(gPercentHeightContainerMap);
+ return gPercentHeightContainerMap->contains(descendant);
}
-#endif
+void RenderBlock::removePercentHeightDescendantIfNeeded(RenderBox* descendant)
+{
+ // We query the map directly, rather than looking at style's
+ // logicalHeight()/logicalMinHeight()/logicalMaxHeight() since those
+ // can change with writing mode/directional changes.
+ if (!hasPercentHeightContainerMap())
+ return;
+
+ if (!hasPercentHeightDescendant(descendant))
+ return;
+
+ removePercentHeightDescendant(descendant);
+}
+
+void RenderBlock::clearPercentHeightDescendantsFrom(RenderBox* parent)
+{
+ ASSERT(gPercentHeightContainerMap);
+ for (RenderObject* curr = parent->firstChild(); curr; curr = curr->nextInPreOrder(parent)) {
+ if (!curr->isBox())
+ continue;
+
+ RenderBox* box = toRenderBox(curr);
+ if (!hasPercentHeightDescendant(box))
+ continue;
+
+ removePercentHeightDescendant(box);
+ }
+}
+
template <RenderBlock::FloatingObject::Type FloatTypeValue>
inline void RenderBlock::FloatIntervalSearchAdapter<FloatTypeValue>::collectIfNeeded(const IntervalType& interval) const
{
« no previous file with comments | « Source/WebCore/rendering/RenderBlock.h ('k') | Source/WebCore/rendering/RenderBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698