Bug 1304441 Part 1 - Remove unneeded check when constructing frame for summary. draft
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 22 Sep 2016 15:19:19 +0800
changeset 420388 a513df2e33d794224c37bfde780d1277b77fd6a5
parent 420017 955840bfd3c20eb24dd5a01be27bdc55c489a285
child 420389 872f25411851b88ed7cf2a7a8e6cbc34d971d9c7
child 420422 0807db8942c53e27739caf019539524170ba4d2c
push id31186
push userbmo:tlin@mozilla.com
push dateTue, 04 Oct 2016 05:39:49 +0000
bugs1304441, 1258657
milestone52.0a1
Bug 1304441 Part 1 - Remove unneeded check when constructing frame for summary. SummaryFrame had been removed in bug 1258657, so now HTMLSummaryElement is always rendered as an ordinary inline or block frame. Therefore, the check in FindHTMLData is not needed anymore. MozReview-Commit-ID: Ikxla6QoNLT
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -3556,26 +3556,17 @@ nsCSSFrameConstructor::FindHTMLData(Elem
     // <legend> is only special inside fieldset, we only check the frame tree
     // parent because the content tree parent may not be a <fieldset> due to
     // display:contents, Shadow DOM, or XBL. For floated or absolutely
     // positioned legends we want to construct by display type and
     // not do special legend stuff.
     return nullptr;
   }
 
-  if (aTag == nsGkAtoms::details || aTag == nsGkAtoms::summary) {
-    if (!HTMLDetailsElement::IsDetailsEnabled()) {
-      return nullptr;
-    }
-  }
-
-  if (aTag == nsGkAtoms::summary &&
-      (!aParentFrame || aParentFrame->GetType() != nsGkAtoms::detailsFrame)) {
-    // <summary> is special only if it is a direct child of <details>. If it
-    // isn't, construct it as a normal block frame instead of a summary frame.
+  if (aTag == nsGkAtoms::details && !HTMLDetailsElement::IsDetailsEnabled()) {
     return nullptr;
   }
 
   static const FrameConstructionDataByTag sHTMLData[] = {
     SIMPLE_TAG_CHAIN(img, nsCSSFrameConstructor::FindImgData),
     SIMPLE_TAG_CHAIN(mozgeneratedcontentimage,
                      nsCSSFrameConstructor::FindImgData),
     { &nsGkAtoms::br,