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

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

Issue 875563003: Ensure that positioned objects' list is always in parent first order (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: WIP (just idea): redesign positioned objects handling Created 5 years, 9 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
Index: Source/core/rendering/RenderBlock.cpp
diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp
index 5f6519f77ca37901b568e9e161b136a5bb61ffc1..65e15be61572decfb500f3a02d6363863e501212 100644
--- a/Source/core/rendering/RenderBlock.cpp
+++ b/Source/core/rendering/RenderBlock.cpp
@@ -319,6 +319,11 @@ void RenderBlock::styleWillChange(StyleDifference diff, const RenderStyle& newSt
if (cb->isRenderBlock())
toRenderBlock(cb)->removePositionedObjects(this, NewContainingBlock);
+ } else if (oldStyle->position() != newStyle.position()) {
+ for (RenderObject* curr = parent(); curr; curr = curr->parent()) {
+ if (curr->isRenderBlock())
+ toRenderBlock(curr)->removePositionedObjects(this, NewContainingBlock);
+ }
}
}
@@ -1939,12 +1944,13 @@ void RenderBlock::insertIntoTrackedRendererMaps(RenderBox* descendant, TrackedDe
descendantSet = new TrackedRendererListHashSet;
descendantsMap->set(this, adoptPtr(descendantSet));
}
- bool added = descendantSet->add(descendant).isNewEntry;
- if (!added) {
+
+ if (descendantSet->contains(descendant)) {
ASSERT(containerMap->get(descendant));
ASSERT(containerMap->get(descendant)->contains(this));
return;
}
+ descendantSet->add(descendant);
HashSet<RenderBlock*>* containerSet = containerMap->get(descendant);
if (!containerSet) {

Powered by Google App Engine
This is Rietveld 408576698