Bug 1377648 - Check summary frame instead of summary element on removing the summary. r=heycam

In case of removing summary element, we need to check details *frame* children
instead of details *element* children since the summary element has been
already removed from details element children list.

MozReview-Commit-ID: GEzDId9CYf9
This commit is contained in:
Hiroyuki Ikezoe
2017-07-05 15:52:37 +09:00
parent ffa2a1877e
commit ec24d5e55b
3 changed files with 20 additions and 1 deletions

View File

@@ -9732,8 +9732,12 @@ nsCSSFrameConstructor::MaybeRecreateContainerForFrameRemoval(nsIFrame* aFrame,
if (parent && parent->IsDetailsFrame()) {
HTMLSummaryElement* summary =
HTMLSummaryElement::FromContent(aFrame->GetContent());
DetailsFrame* detailsFrame = static_cast<DetailsFrame*>(parent);
if (summary && summary->IsMainSummary()) {
// Unlike adding summary element cases, we need to check children of the
// parent details frame since at this moment the summary element has been
// already removed from the parent details element's child list.
if (summary && detailsFrame->HasMainSummaryFrame(aFrame)) {
// When removing a summary, we should reframe the parent details frame to
// ensure that another summary is used or the default summary is
// generated.