Bug 403524: Make textarea not inherit text decorations and correct the failing reftest (r=dbaron)
authorVitor Menezes <vmenezes@mozilla.com>
Wed, 03 Aug 2011 11:30:58 -0700
changeset 73783 c9dff8b867f0d74ef23396bcb896696cf9436b08
parent 73782 941c6bc7d7280719d25516f699130aa9d4f080a3
child 73784 1dcf967393a00e84a87f9b658021dc9926e40789
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewersdbaron
bugs403524, 585684
milestone8.0a1
Bug 403524: Make textarea not inherit text decorations and correct the failing reftest (r=dbaron) Originally, this reftest only failed on Windows (see bug 585684). However, upon making standards mode compliant with CSS2.1, the bug described in 585684 spread to all platforms, indicating it was actually a layout bug and not d2d per se. This patch makes the anonymous div inside textareas and text inputs inline-blocks so that they ignore decorations defined on ancestors.
layout/reftests/text-decoration/reftest.list
layout/reftests/text-decoration/underline-block-propagation-2-standards-ref.html
layout/style/forms.css
--- a/layout/reftests/text-decoration/reftest.list
+++ b/layout/reftests/text-decoration/reftest.list
@@ -76,17 +76,17 @@ fails == underline-block-propagation-2-q
 != underline-block-standards.html underline-block-standards-notref.html
 == underline-inline-block-standards.html underline-inline-block-standards-ref.html
 != underline-inline-block-standards.html underline-inline-block-standards-notref.html
 == underline-table-caption-standards.html underline-table-caption-standards-ref.html
 != underline-table-caption-standards.html underline-table-caption-standards-notref.html
 == underline-table-cell-standards.html underline-table-cell-standards-ref.html
 != underline-table-cell-standards.html underline-table-cell-standards-notref.html
 == underline-block-propagation-standards.html underline-block-propagation-standards-ref.html
-fails-if(Android) fails-if(d2d) == underline-block-propagation-2-standards.html underline-block-propagation-2-standards-ref.html # bug 585684
+fails-if(Android) == underline-block-propagation-2-standards.html underline-block-propagation-2-standards-ref.html
 == text-decoration-zorder-1-standards.html text-decoration-zorder-1-ref.html
 == text-decoration-zorder-1-quirks.html text-decoration-zorder-1-ref.html
 == table-quirk-1.html table-quirk-1-ref.html
 == table-quirk-2.html table-quirk-2-ref.html
 == text-decoration-propagation-1-quirks.html text-decoration-propagation-1-quirks-ref.html
 == text-decoration-propagation-1-standards.html text-decoration-propagation-1-standards-ref.html
 == 641444-1.html 641444-1-ref.html
 == decoration-css21.html decoration-css21-ref.html
--- a/layout/reftests/text-decoration/underline-block-propagation-2-standards-ref.html
+++ b/layout/reftests/text-decoration/underline-block-propagation-2-standards-ref.html
@@ -1,21 +1,21 @@
 <!DOCTYPE HTML>
 <html><head>
 <title>More tests of propagation of text-decoration</title>
 <style>
 textarea { -moz-appearance: none }
+textarea + textarea { margin-left: 10px }
 </style>
 </head>
 <body>
 <!-- t-d should not propagate to the content of a form control -->
 <form>
 <span style="text-decoration:underline">This text should be underlined.</span><br>
 <textarea rows="2" cols="40">This text should not be underlined.</textarea
-><span style="display:inline-block;width:10px;text-decoration:underline">&nbsp;&nbsp;&nbsp;</span
 ><textarea rows="2" cols="40" style="text-decoration:line-through"
 >This text should be struck out.</textarea>
 <p style="text-decoration:underline">This text should also be underlined.</p>
 </form>
 <!-- t-d should propagate from parent elements to table-cells -->
 <div>
   <table>
     <tr>
--- a/layout/style/forms.css
+++ b/layout/style/forms.css
@@ -151,21 +151,20 @@ textarea > scrollbar {
 textarea > .anonymous-div,
 input > .anonymous-div {
   white-space: pre;
   overflow: auto;
   border: 0px !important;
   /* The 1px horizontal padding is for parity with Win/IE */
   padding: 0px 1px;
   margin: 0px;
-  /* XXXldb I'm not sure if we really want the 'text-decoration: inherit',
-     but it's needed to make 'text-decoration' "work" on text inputs. */
   text-decoration: inherit;
   -moz-text-decoration-color: inherit;
   -moz-text-decoration-style: inherit;
+  display: inline-block;
   ime-mode: inherit;
   resize: inherit;
 }
 
 textarea > .anonymous-div.wrap,
 input > .anonymous-div.wrap {
   white-space: pre-wrap;
 }