mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Bug 925902 - Ensure that the old ROOT_SCROLL_ID property is cleared when a new one is being set. r=tn, botond
This commit is contained in:
parent
279d848121
commit
d930fb0e6c
@ -500,6 +500,16 @@ nsLayoutUtils::FindOrCreateIDFor(nsIContent* aContent, bool aRoot)
|
||||
|
||||
if (!FindIDFor(aContent, &scrollId)) {
|
||||
scrollId = aRoot ? FrameMetrics::ROOT_SCROLL_ID : sScrollIdCounter++;
|
||||
if (aRoot) {
|
||||
// We are possibly replacing the old ROOT_SCROLL_ID content with a new one, so
|
||||
// we should clear the property on the old content if there is one. Otherwise when
|
||||
// that content is destroyed it will clear its property list and clobber ROOT_SCROLL_ID.
|
||||
nsIContent* oldRoot;
|
||||
bool oldExists = GetContentMap().Get(scrollId, &oldRoot);
|
||||
if (oldExists) {
|
||||
oldRoot->DeleteProperty(nsGkAtoms::RemoteId);
|
||||
}
|
||||
}
|
||||
aContent->SetProperty(nsGkAtoms::RemoteId, new ViewID(scrollId),
|
||||
DestroyViewID);
|
||||
GetContentMap().Put(scrollId, aContent);
|
||||
|
Loading…
Reference in New Issue
Block a user