Bug 453468: fix regression in wrap attribute in textareas from bug 99457. r+sr=dbaron
authorSimon Montagu <smontagu@smontagu.org>
Thu, 16 Oct 2008 14:34:10 -0700
changeset 20548 b7253556900e26a64252f163ee6db897d3e669db
parent 20547 b75910d0ea045e7b73e2a6504132777950169c4e
child 20549 c87e873bbef98ab8e2509ffe6d9d3d66b1c51219
push id2955
push usersmontagu@mozilla.com
push dateThu, 16 Oct 2008 21:41:22 +0000
treeherdermozilla-central@b7253556900e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs453468, 99457
milestone1.9.1b2pre
Bug 453468: fix regression in wrap attribute in textareas from bug 99457. r+sr=dbaron
layout/reftests/text/reftest.list
layout/reftests/text/wordwrap-08-ref.html
layout/reftests/text/wordwrap-08.html
layout/reftests/text/wordwrap-09-ref.html
layout/reftests/text/wordwrap-09.html
layout/style/forms.css
layout/style/nsStyleStruct.h
--- a/layout/reftests/text/reftest.list
+++ b/layout/reftests/text/reftest.list
@@ -13,14 +13,18 @@
 == white-space-2.html white-space-2-ref.html
 == wordwrap-01.html wordwrap-01-ref.html
 random == wordwrap-02.html wordwrap-02-ref.html # bad fonts on test boxes
 random-if(MOZ_WIDGET_TOOLKIT=="gtk2") == wordwrap-03.html wordwrap-03-ref.html # Bad fonts on test boxes
 == wordwrap-04.html wordwrap-04-ref.html
 == wordwrap-05.html wordwrap-05-ref.html
 == wordwrap-06.html wordwrap-06-ref.html
 == wordwrap-07.html wordwrap-07-ref.html
+!= wordwrap-08.html wordwrap-01-ref.html
+== wordwrap-08.html wordwrap-08-ref.html
+!= wordwrap-09.html wordwrap-01-ref.html
+== wordwrap-09.html wordwrap-09-ref.html
 == zwnj-01.html zwnj-01-ref.html
 == zwnj-02.html zwnj-02-ref.html
 random-if(MOZ_WIDGET_TOOLKIT=="gtk2") != zwnj-01.html zwnj-02-ref.html # Bad fonts on the tinderbox -- works locally
 fails-if(MOZ_WIDGET_TOOLKIT=="windows") == cgj-01.html cgj-01-ref.html # bug 455455
 == 444656.html 444656-ref.html
 == 449555-1.html 449555-1-ref.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text/wordwrap-08-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+  <style type="text/css">
+textarea { overflow: scroll; word-wrap: normal; white-space: pre}
+  </style>
+  <title>Test Wordwrap</title>
+ </head>
+ <body>
+  <textarea rows="10" cols="20">It's&nbsp;lipsmackinthirstquenchinacetastinmotivatingoodbuzzincooltalkinhighwalkinfastlivinevergivincoolfizzin&nbsp;Firefox!</textarea>
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text/wordwrap-08.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+  <style type="text/css">
+textarea { overflow: scroll}
+  </style>
+  <title>Test Wordwrap</title>
+ </head>
+ <body>
+  <textarea rows="10" cols="20" wrap="off">It's lipsmackinthirstquenchinacetastinmotivatingoodbuzzincooltalkinhighwalkinfastlivinevergivincoolfizzin Firefox!</textarea>
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text/wordwrap-09-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+  <style type="text/css">
+textarea { overflow: scroll; word-wrap: normal; white-space: pre; }
+  </style>
+  <title>Test Wordwrap</title>
+ </head>
+ <body>
+  <textarea rows="10" cols="20">It's
+lipsmackinthirstquenchinacetastinmotivatingoodbuzzincooltalkinhighwalkinfastlivinevergivincoolfizzin
+Firefox!</textarea>
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text/wordwrap-09.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+  <style type="text/css">
+textarea { overflow: scroll; word-wrap: normal; }
+  </style>
+  <title>Test Wordwrap</title>
+ </head>
+ <body>
+  <textarea rows="10" cols="20">It's lipsmackinthirstquenchinacetastinmotivatingoodbuzzincooltalkinhighwalkinfastlivinevergivincoolfizzin Firefox!</textarea>
+ </body>
+</html>
--- a/layout/style/forms.css
+++ b/layout/style/forms.css
@@ -122,17 +122,17 @@ textarea {
   letter-spacing: normal;
   vertical-align: text-bottom;
   cursor: text;
   -moz-binding: url("chrome://global/content/platformHTMLBindings.xml#textAreas");
   -moz-appearance: textfield-multiline;
   text-indent: 0;
   -moz-user-select: text;
   text-shadow: none;
-  word-wrap: break-word !important;
+  word-wrap: break-word;
 }
 
 textarea > scrollbar {
   cursor: default;
 }
 
 textarea > .anonymous-div,
 input > .anonymous-div {
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -807,17 +807,17 @@ struct nsStyleText {
 
   PRBool WhiteSpaceCanWrap() const {
     return mWhiteSpace == NS_STYLE_WHITESPACE_NORMAL ||
            mWhiteSpace == NS_STYLE_WHITESPACE_PRE_WRAP ||
            mWhiteSpace == NS_STYLE_WHITESPACE_PRE_LINE;
   }
 
   PRBool WordCanWrap() const {
-    return mWordWrap == NS_STYLE_WORDWRAP_BREAK_WORD;
+    return WhiteSpaceCanWrap() && mWordWrap == NS_STYLE_WORDWRAP_BREAK_WORD;
   }
 };
 
 struct nsStyleVisibility {
   nsStyleVisibility(nsPresContext* aPresContext);
   nsStyleVisibility(const nsStyleVisibility& aVisibility);
   ~nsStyleVisibility() {}