Bug 959311 - Splitting nsComboboxControlFrame makes no sense so it should always report COMPLETE reflow status. Also, make them page-break-inside:avoid by default. r=bz
authorMats Palmgren <matspal@gmail.com>
Thu, 30 Jan 2014 12:12:02 +0000
changeset 181982 044deda0cbcb8eaa86ac97761eb0dd39379d6375
parent 181981 9024723e97d3343640f916e683a6adeb111ef61b
child 181983 0847543adbfdf67a14d07fd047ae99e24f2607c4
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs959311
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 959311 - Splitting nsComboboxControlFrame makes no sense so it should always report COMPLETE reflow status. Also, make them page-break-inside:avoid by default. r=bz
layout/forms/crashtests/959311.html
layout/forms/crashtests/crashtests.list
layout/forms/nsComboboxControlFrame.cpp
layout/reftests/pagination/combobox-page-break-inside-ref.html
layout/reftests/pagination/combobox-page-break-inside.html
layout/reftests/pagination/reftest.list
layout/style/forms.css
new file mode 100644
--- /dev/null
+++ b/layout/forms/crashtests/959311.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html class="reftest-print">
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+@page { size:5in 3in; margin:0in; }
+div { height: 2.5in; }
+select { height: 0.5in; display:block; padding:20px; page-break-inside:initial; }
+</style>
+</head>
+<body>
+    <div></div>
+    <select>
+      <option>Text</option>
+    </select>
+  </body>
+</html>
--- a/layout/forms/crashtests/crashtests.list
+++ b/layout/forms/crashtests/crashtests.list
@@ -49,9 +49,10 @@ asserts(1) load 578604-1.html # bug 5845
 asserts(4-7) load 590302-1.xhtml # bug 584564
 load 626014.xhtml
 load 639733.xhtml
 asserts(0-1) load 669767.html
 load 682684.xhtml
 load 865602.html
 load 944198.html
 load 949891.xhtml
+load 959311.html
 load 960277-2.html
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -861,16 +861,22 @@ nsComboboxControlFrame::Reflow(nsPresCon
 
   if (StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL) {
     // Make sure the right edge of the button frame stays where it is now
     buttonRect.x -= buttonWidth - buttonRect.width;
   }
   buttonRect.width = buttonWidth;
   mButtonFrame->SetRect(buttonRect);
 
+  if (!NS_INLINE_IS_BREAK_BEFORE(aStatus) &&
+      !NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
+    // This frame didn't fit inside a fragmentation container.  Splitting
+    // a nsComboboxControlFrame makes no sense, so we override the status here.
+    aStatus = NS_FRAME_COMPLETE;
+  }
   return rv;
 }
 
 //--------------------------------------------------------------
 
 nsIAtom*
 nsComboboxControlFrame::GetType() const
 {
new file mode 100644
--- /dev/null
+++ b/layout/reftests/pagination/combobox-page-break-inside-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html class="reftest-print">
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+@page { size:5in 3in; margin:0in; }
+div { height: 0in; }
+select { height: 0.5in; display:block; padding:20px; page-break-before:always; }
+</style>
+</head>
+<body>
+    <div></div>
+    <select>
+      <option>Text</option>
+    </select>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/pagination/combobox-page-break-inside.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html class="reftest-print">
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+@page { size:5in 3in; margin:0in; }
+div { height: 2.5in; }
+select { height: 0.5in; display:block; padding:20px; page-break-inside:avoid; }
+</style>
+</head>
+<body>
+    <div></div>
+    <select>
+      <option>Text</option>
+    </select>
+  </body>
+</html>
--- a/layout/reftests/pagination/reftest.list
+++ b/layout/reftests/pagination/reftest.list
@@ -55,8 +55,9 @@ skip-if(B2G) == table-caption-splitafter
 skip-if(B2G) == table-caption-splitaftercaption-5.html table-caption-splitaftercaption-5-ref.html # bug 773482
 skip-if(B2G) == table-caption-splitaftercaption-6.html table-caption-splitaftercaption-6-ref.html # bug 773482
 skip-if(B2G) == table-caption-splitaftercaption-7.html table-caption-splitaftercaption-7-ref.html # bug 773482
 # == table-caption-splitaftercaption-8.html blank.html # bug 672654
 # == table-caption-splitaftercaption-9.html blank.html # bug 672654
 # == table-caption-splitaftercaption-10.html blank.html # bug 672654
 # == table-caption-splitaftercaption-11.html blank.html # bug 672654
 == column-balancing-break-inside-avoid-2.html column-balancing-break-inside-avoid-2-ref.html
+== combobox-page-break-inside.html combobox-page-break-inside-ref.html
--- a/layout/style/forms.css
+++ b/layout/style/forms.css
@@ -201,16 +201,17 @@ select {
   -moz-appearance: menulist;
   border-width: 2px;
   border-style: inset;
   text-indent: 0;
   overflow: -moz-hidden-unscrollable;
   text-shadow: none;
   /* No text-decoration reaching inside, by default */
   display: inline-block;
+  page-break-inside: avoid;
 }
 
 /* Need the "select[size][multiple]" selector to override the settings on
    'select[size="1"]', eg if one has <select size="1" multiple> */
    
 select[size],
 select[multiple],
 select[size][multiple] {