mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 1682193 - Don't append null content nodes in InspectorUtils.getOverflowingChildrenOfElement. r=dholbert
And add an assertion for this to fail earlier (in debug builds at least). The issue is that in paginated mode canvas frames (which are not associated to a node) might overflow their page content frame. Differential Revision: https://phabricator.services.mozilla.com/D99630
This commit is contained in:
parent
edd1803ffc
commit
5e3c951c42
@ -52,10 +52,13 @@ class nsBaseContentList : public nsINodeList {
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsBaseContentList)
|
||||
|
||||
void AppendElement(nsIContent* aContent) {
|
||||
MOZ_ASSERT(aContent);
|
||||
mElements.AppendElement(aContent);
|
||||
}
|
||||
void MaybeAppendElement(nsIContent* aContent) {
|
||||
if (aContent) AppendElement(aContent);
|
||||
if (aContent) {
|
||||
AppendElement(aContent);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -769,7 +769,7 @@ static void AddOverflowingChildrenOfElement(const nsIFrame* aFrame,
|
||||
|
||||
if (FrameHasSpecifiedSize(child) &&
|
||||
IsFrameOutsideOfAncestor(child, aAncestorFrame, aRect)) {
|
||||
aList.AppendElement(child->GetContent());
|
||||
aList.MaybeAppendElement(child->GetContent());
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -780,7 +780,7 @@ static void AddOverflowingChildrenOfElement(const nsIFrame* aFrame,
|
||||
// calling AddOverflowingChildrenOfElement on it.
|
||||
if (currListLength == aList.Length() &&
|
||||
IsFrameOutsideOfAncestor(child, aAncestorFrame, aRect)) {
|
||||
aList.AppendElement(child->GetContent());
|
||||
aList.MaybeAppendElement(child->GetContent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user