diff --git a/layout/reftests/text/reftest.list b/layout/reftests/text/reftest.list
index 8c2ce7c00093..3c9d9618a45f 100644
--- a/layout/reftests/text/reftest.list
+++ b/layout/reftests/text/reftest.list
@@ -18,6 +18,10 @@ random-if(MOZ_WIDGET_TOOLKIT=="gtk2") == wordwrap-03.html wordwrap-03-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
diff --git a/layout/reftests/text/wordwrap-08-ref.html b/layout/reftests/text/wordwrap-08-ref.html
new file mode 100644
index 000000000000..d0c5bded39c4
--- /dev/null
+++ b/layout/reftests/text/wordwrap-08-ref.html
@@ -0,0 +1,13 @@
+
+
+
+
+
+ Test Wordwrap
+
+
+
+
+
diff --git a/layout/reftests/text/wordwrap-08.html b/layout/reftests/text/wordwrap-08.html
new file mode 100644
index 000000000000..d9b02b83f0c8
--- /dev/null
+++ b/layout/reftests/text/wordwrap-08.html
@@ -0,0 +1,13 @@
+
+
+
+
+
+ Test Wordwrap
+
+
+
+
+
diff --git a/layout/reftests/text/wordwrap-09-ref.html b/layout/reftests/text/wordwrap-09-ref.html
new file mode 100644
index 000000000000..a6dcbe642fd9
--- /dev/null
+++ b/layout/reftests/text/wordwrap-09-ref.html
@@ -0,0 +1,15 @@
+
+
+
+
+
+ Test Wordwrap
+
+
+
+
+
diff --git a/layout/reftests/text/wordwrap-09.html b/layout/reftests/text/wordwrap-09.html
new file mode 100644
index 000000000000..033a8f2691db
--- /dev/null
+++ b/layout/reftests/text/wordwrap-09.html
@@ -0,0 +1,13 @@
+
+
+
+
+
+ Test Wordwrap
+
+
+
+
+
diff --git a/layout/style/forms.css b/layout/style/forms.css
index 6b34fd90ed20..def28ebbdec3 100644
--- a/layout/style/forms.css
+++ b/layout/style/forms.css
@@ -127,7 +127,7 @@ textarea {
text-indent: 0;
-moz-user-select: text;
text-shadow: none;
- word-wrap: break-word !important;
+ word-wrap: break-word;
}
textarea > scrollbar {
diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h
index 8ca1a0aaa717..052374eac665 100644
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -812,7 +812,7 @@ struct nsStyleText {
}
PRBool WordCanWrap() const {
- return mWordWrap == NS_STYLE_WORDWRAP_BREAK_WORD;
+ return WhiteSpaceCanWrap() && mWordWrap == NS_STYLE_WORDWRAP_BREAK_WORD;
}
};