Bug 1007065 - Don't apply the special -moz-hidden-unscrollable clipping on nsTextControlFrame since it always has an anonymous scroll frame that deals with overflow. r=roc, a=lsblakk
authorMats Palmgren <matspal@gmail.com>
Mon, 12 May 2014 11:45:27 +0000
changeset 192357 36df173cb6a2
parent 192356 3090db8c413f
child 192358 841a1b085b5b
push id3583
push userryanvm@gmail.com
push date2014-05-22 12:45 +0000
Treeherderresults
reviewersroc, lsblakk
bugs1007065
milestone30.0
Bug 1007065 - Don't apply the special -moz-hidden-unscrollable clipping on nsTextControlFrame since it always has an anonymous scroll frame that deals with overflow. r=roc, a=lsblakk
layout/base/tests/bug1007065-1-ref.html
layout/base/tests/bug1007065-1.html
layout/base/tests/mochitest.ini
layout/base/tests/test_reftests_with_caret.html
layout/generic/nsFrame.h
new file mode 100644
--- /dev/null
+++ b/layout/base/tests/bug1007065-1-ref.html
@@ -0,0 +1,15 @@
+<html class="reftest-wait">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+  </head>
+  <body onload="start()">
+    <input type="text" style="text-align:right;">
+    <script>
+      function start() {
+        var input = document.querySelector("input");
+        input.focus();
+        document.documentElement.removeAttribute("class");
+      }
+    </script>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/base/tests/bug1007065-1.html
@@ -0,0 +1,15 @@
+<html class="reftest-wait">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+  </head>
+  <body onload="start()">
+    <input type="text" style="text-align:right; overflow:hidden;">
+    <script>
+      function start() {
+        var input = document.querySelector("input");
+        input.focus();
+        document.documentElement.removeAttribute("class");
+      }
+    </script>
+  </body>
+</html>
--- a/layout/base/tests/mochitest.ini
+++ b/layout/base/tests/mochitest.ini
@@ -148,16 +148,18 @@ support-files =
   bug746993-1.html
   bug746993-1-ref.html
   bug966992-1.html
   bug966992-1-ref.html
   bug966992-2.html
   bug966992-2-ref.html
   bug966992-3.html
   bug966992-3-ref.html
+  bug1007065-1.html
+  bug1007065-1-ref.html
 [test_bug514127.html]
 [test_bug518777.html]
 [test_bug548545.xhtml]
 [test_bug558663.html]
 [test_bug559499.html]
 [test_bug569520.html]
 [test_bug582181-1.html]
 [test_bug582181-2.html]
--- a/layout/base/tests/test_reftests_with_caret.html
+++ b/layout/base/tests/test_reftests_with_caret.html
@@ -131,16 +131,17 @@ var tests = [
     function() {SpecialPowers.setBoolPref("bidi.browser.ui", true);} ,
     [ 'bug646382-1.html' , 'bug646382-1-ref.html' ] ,
     [ 'bug646382-2.html' , 'bug646382-2-ref.html' ] ,
     [ 'bug664087-1.html' , 'bug664087-1-ref.html' ] ,
     [ 'bug664087-2.html' , 'bug664087-2-ref.html' ] ,
     [ 'bug682712-1.html' , 'bug682712-1-ref.html' ] ,
     function() {SpecialPowers.clearUserPref("bidi.browser.ui");} ,
     [ 'bug746993-1.html' , 'bug746993-1-ref.html' ] ,
+    [ 'bug1007065-1.html' , 'bug1007065-1-ref.html' ] ,
 ];
 
 if (navigator.appVersion.indexOf("Android") == -1 &&
   SpecialPowers.Services.appinfo.name != "B2G") {
   tests.push([ 'bug512295-1.html' , 'bug512295-1-ref.html' ]);
   tests.push([ 'bug512295-2.html' , 'bug512295-2-ref.html' ]);
   tests.push(function() {SpecialPowers.setBoolPref("layout.css.overflow-clip-box.enabled", true);});
   tests.push([ 'bug966992-1.html' , 'bug966992-1-ref.html' ]);
--- a/layout/generic/nsFrame.h
+++ b/layout/generic/nsFrame.h
@@ -578,16 +578,20 @@ public:
           type == nsGkAtoms::tableCellFrame ||
           type == nsGkAtoms::bcTableCellFrame ||
           type == nsGkAtoms::svgOuterSVGFrame ||
           type == nsGkAtoms::svgInnerSVGFrame ||
           type == nsGkAtoms::svgForeignObjectFrame) {
         return true;
       }
       if (aFrame->IsFrameOfType(nsIFrame::eReplacedContainsBlock)) {
+        if (type == nsGkAtoms::textInputFrame) {
+          // It always has an anonymous scroll frame that handles any overflow.
+          return false;
+        }
         return true;
       }
     }
 
     if ((aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT)) {
       return false;
     }