Bug 931464 - Part 1: GetFieldSetBlockFrame needs to drill down through a scrollframe if necessary. r=mats, a=bajaj
authorRobert O'Callahan <robert@ocallahan.org>
Tue, 05 Nov 2013 23:04:00 -0800
changeset 166441 3ba941e15e5e3ef786b2b7e53ebf562be4d169fe
parent 166440 eef59d3645d39e1b53cfafb5fb09024aaed36458
child 166442 eeec8acdb32c9f3ad1657569029cc1efcfa042af
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats, bajaj
bugs931464
milestone27.0a2
Bug 931464 - Part 1: GetFieldSetBlockFrame needs to drill down through a scrollframe if necessary. r=mats, a=bajaj
layout/base/crashtests/931464.html
layout/base/crashtests/crashtests.list
layout/base/nsCSSFrameConstructor.cpp
layout/reftests/bugs/931464-1-ref.html
layout/reftests/bugs/931464-1.html
layout/reftests/bugs/reftest.list
new file mode 100644
--- /dev/null
+++ b/layout/base/crashtests/931464.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<script>
+
+function boom()
+{
+  var fieldset = document.getElementById("f");
+  for (var i = 0; i < 2; ++i)
+    fieldset.appendChild(document.createElement("span"));
+}
+
+</script>
+<body onload="boom();">
+<fieldset id="f" style="overflow: auto;"></fieldset>
+</body>
+</html>
--- a/layout/base/crashtests/crashtests.list
+++ b/layout/base/crashtests/crashtests.list
@@ -410,8 +410,9 @@ load 835056.html
 load 836990-1.html
 load 852293.html
 load 860579-1.html
 pref(layers.force-active,true) load 859526-1.html
 pref(layers.force-active,true) load 859630-1.html
 load 866588.html
 load 897852.html
 asserts(4-6) load 898913.html # bug 847368
+load 931464.html
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -317,17 +317,18 @@ IsAnonymousFlexItem(const nsIFrame* aFra
   return pseudoType == nsCSSAnonBoxes::anonymousFlexItem;
 }
 
 static inline nsIFrame*
 GetFieldSetBlockFrame(nsIFrame* aFieldsetFrame)
 {
   // Depends on the fieldset child frame order - see ConstructFieldSetFrame() below.
   nsIFrame* firstChild = aFieldsetFrame->GetFirstPrincipalChild();
-  return firstChild && firstChild->GetNextSibling() ? firstChild->GetNextSibling() : firstChild;
+  nsIFrame* inner = firstChild && firstChild->GetNextSibling() ? firstChild->GetNextSibling() : firstChild;
+  return inner ? inner->GetContentInsertionFrame() : nullptr;
 }
 
 #define FCDATA_DECL(_flags, _func)                          \
   { _flags, { (FrameCreationFunc)_func }, nullptr, nullptr }
 #define FCDATA_WITH_WRAPPING_BLOCK(_flags, _func, _anon_box)  \
   { _flags | FCDATA_CREATE_BLOCK_WRAPPER_FOR_ALL_KIDS,        \
       { (FrameCreationFunc)_func }, nullptr, &_anon_box }
 
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/931464-1-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+<fieldset style="overflow: auto;">Hello Kitty</fieldset>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/931464-1.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<body>
+<fieldset id="f" style="overflow: auto;"></fieldset>
+<script>
+function boom()
+{
+  var f = document.getElementById("f");
+  var s = document.createElement("span");
+  s.textContent = "Hello Kitty";
+  f.appendChild(s);
+  document.documentElement.removeAttribute("class");
+}
+window.addEventListener("MozReftestInvalidate", boom);
+</script>
+</body>
+</html>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1771,8 +1771,9 @@ test-pref(layout.css.flexbox.enabled,tru
 == 890495-1.html 890495-1-ref.html
 == 894931-1.html 894931-1-ref.html
 == 897491-1.html 897491-1-ref.html
 == 897491-2.html 897491-2-ref.html
 fuzzy(1,10000) fuzzy-if(Android&&AndroidVersion>=15,5,10000) == 902330-1.html 902330-1-ref.html
 fuzzy-if(Android,8,400) == 906199-1.html 906199-1-ref.html
 == 921716-1.html 921716-1-ref.html
 fuzzy-if(cocoaWidget,1,40) == 928607-1.html 928607-1-ref.html
+== 931464-1.html 931464-1-ref.html