diff --git a/mozilla/content/base/src/nsCopySupport.cpp b/mozilla/content/base/src/nsCopySupport.cpp index 78e33b5fd40..6d0ba2584e2 100644 --- a/mozilla/content/base/src/nsCopySupport.cpp +++ b/mozilla/content/base/src/nsCopySupport.cpp @@ -344,7 +344,7 @@ nsresult nsCopySupport::IsPlainTextContext(nsISelection *aSel, nsIDocument *aDoc nsCOMPtr bodyElem = do_QueryInterface(selContent); nsAutoString wsVal; rv = bodyElem->GetAttribute(NS_LITERAL_STRING("style"), wsVal); - if (NS_SUCCEEDED(rv) && (kNotFound != wsVal.Find(NS_LITERAL_STRING("-moz-pre-wrap")))) + if (NS_SUCCEEDED(rv) && (kNotFound != wsVal.Find(NS_LITERAL_STRING("pre-wrap")))) { *aIsPlainTextContext = PR_TRUE; break; diff --git a/mozilla/content/base/src/nsDocumentEncoder.cpp b/mozilla/content/base/src/nsDocumentEncoder.cpp index 1849486f7a0..e0126ec2664 100644 --- a/mozilla/content/base/src/nsDocumentEncoder.cpp +++ b/mozilla/content/base/src/nsDocumentEncoder.cpp @@ -1151,7 +1151,7 @@ nsHTMLCopyEncoder::SetSelection(nsISelection* aSelection) nsCOMPtr bodyElem = do_QueryInterface(selContent); nsAutoString wsVal; rv = bodyElem->GetAttribute(NS_LITERAL_STRING("style"), wsVal); - if (NS_SUCCEEDED(rv) && (kNotFound != wsVal.Find(NS_LITERAL_STRING("-moz-pre-wrap")))) + if (NS_SUCCEEDED(rv) && (kNotFound != wsVal.Find(NS_LITERAL_STRING("pre-wrap")))) { mIsTextWidget = PR_TRUE; break; diff --git a/mozilla/content/base/src/nsPlainTextSerializer.cpp b/mozilla/content/base/src/nsPlainTextSerializer.cpp index c7d48f6aea6..7c0b0bca6b6 100644 --- a/mozilla/content/base/src/nsPlainTextSerializer.cpp +++ b/mozilla/content/base/src/nsPlainTextSerializer.cpp @@ -603,7 +603,7 @@ nsPlainTextSerializer::DoOpenContainer(const nsIParserNode* aNode, PRInt32 aTag) if(NS_SUCCEEDED(GetAttributeValue(aNode, nsGkAtoms::style, style)) && (kNotFound != (whitespace = style.Find("white-space:")))) { - if (kNotFound != style.Find("-moz-pre-wrap", PR_TRUE, whitespace)) { + if (kNotFound != style.Find("pre-wrap", PR_TRUE, whitespace)) { #ifdef DEBUG_preformatted printf("Set mPreFormatted based on style moz-pre-wrap\n"); #endif diff --git a/mozilla/content/html/content/src/nsHTMLPreElement.cpp b/mozilla/content/html/content/src/nsHTMLPreElement.cpp index 3fc3ed858e4..60bef4f5b02 100644 --- a/mozilla/content/html/content/src/nsHTMLPreElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLPreElement.cpp @@ -156,7 +156,7 @@ MapAttributesIntoRule(const nsMappedAttributes* aAttributes, if (aData->mTextData->mWhiteSpace.GetUnit() == eCSSUnit_Null) { // wrap: empty if (aAttributes->GetAttr(nsGkAtoms::wrap)) - aData->mTextData->mWhiteSpace.SetIntValue(NS_STYLE_WHITESPACE_MOZ_PRE_WRAP, eCSSUnit_Enumerated); + aData->mTextData->mWhiteSpace.SetIntValue(NS_STYLE_WHITESPACE_PRE_WRAP, eCSSUnit_Enumerated); // width: int (html4 attribute == nav4 cols) const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width); @@ -168,7 +168,7 @@ MapAttributesIntoRule(const nsMappedAttributes* aAttributes, if (value && value->Type() == nsAttrValue::eInteger) { // Force wrap property on since we want to wrap at a width // boundary not just a newline. - aData->mTextData->mWhiteSpace.SetIntValue(NS_STYLE_WHITESPACE_MOZ_PRE_WRAP, eCSSUnit_Enumerated); + aData->mTextData->mWhiteSpace.SetIntValue(NS_STYLE_WHITESPACE_PRE_WRAP, eCSSUnit_Enumerated); } } } diff --git a/mozilla/editor/libeditor/base/nsEditor.cpp b/mozilla/editor/libeditor/base/nsEditor.cpp index 328035ebc64..cd0214b70f3 100644 --- a/mozilla/editor/libeditor/base/nsEditor.cpp +++ b/mozilla/editor/libeditor/base/nsEditor.cpp @@ -4168,8 +4168,7 @@ nsEditor::IsPreformatted(nsIDOMNode *aNode, PRBool *aResult) const nsStyleText* styleText = frame->GetStyleText(); - *aResult = NS_STYLE_WHITESPACE_PRE == styleText->mWhiteSpace || - NS_STYLE_WHITESPACE_MOZ_PRE_WRAP == styleText->mWhiteSpace; + *aResult = styleText->WhiteSpaceIsSignificant(); return NS_OK; } diff --git a/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp b/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp index c0c5ef81be0..ea2188d4aa0 100644 --- a/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp +++ b/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp @@ -1039,12 +1039,12 @@ nsPlaintextEditor::SetWrapWidth(PRInt32 aWrapColumn) // and now we're ready to set the new whitespace/wrapping style. if (aWrapColumn > 0 && !mWrapToWindow) // Wrap to a fixed column { - styleValue.AppendLiteral("white-space: -moz-pre-wrap; width: "); + styleValue.AppendLiteral("white-space: pre-wrap; width: "); styleValue.AppendInt(aWrapColumn); styleValue.AppendLiteral("ch;"); } else if (mWrapToWindow || aWrapColumn == 0) - styleValue.AppendLiteral("white-space: -moz-pre-wrap;"); + styleValue.AppendLiteral("white-space: pre-wrap;"); else styleValue.AppendLiteral("white-space: pre;"); diff --git a/mozilla/layout/base/nsStyleConsts.h b/mozilla/layout/base/nsStyleConsts.h index 9cf311fab60..510c87ca74e 100644 --- a/mozilla/layout/base/nsStyleConsts.h +++ b/mozilla/layout/base/nsStyleConsts.h @@ -594,7 +594,7 @@ #define NS_STYLE_WHITESPACE_NORMAL 0 #define NS_STYLE_WHITESPACE_PRE 1 #define NS_STYLE_WHITESPACE_NOWRAP 2 -#define NS_STYLE_WHITESPACE_MOZ_PRE_WRAP 3 +#define NS_STYLE_WHITESPACE_PRE_WRAP 3 // See nsStyleText #define NS_STYLE_UNICODE_BIDI_NORMAL 0 diff --git a/mozilla/layout/generic/nsLineLayout.cpp b/mozilla/layout/generic/nsLineLayout.cpp index 26bef0e0666..107ea824631 100644 --- a/mozilla/layout/generic/nsLineLayout.cpp +++ b/mozilla/layout/generic/nsLineLayout.cpp @@ -1592,8 +1592,7 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd) nsCOMPtr fm; rc->GetFontMetrics(*getter_AddRefs(fm)); - PRBool preMode = (mStyleText->mWhiteSpace == NS_STYLE_WHITESPACE_PRE) || - (mStyleText->mWhiteSpace == NS_STYLE_WHITESPACE_MOZ_PRE_WRAP); + PRBool preMode = mStyleText->WhiteSpaceIsSignificant(); // See if the span is an empty continuation. It's an empty continuation iff: // - it has a prev-in-flow diff --git a/mozilla/layout/inspector/src/inDOMUtils.cpp b/mozilla/layout/inspector/src/inDOMUtils.cpp index d76587bc72f..74e2815157b 100644 --- a/mozilla/layout/inspector/src/inDOMUtils.cpp +++ b/mozilla/layout/inspector/src/inDOMUtils.cpp @@ -104,8 +104,7 @@ inDOMUtils::IsIgnorableWhitespace(nsIDOMCharacterData *aDataNode, nsIFrame* frame = presShell->GetPrimaryFrameFor(content); if (frame) { const nsStyleText* text = frame->GetStyleText(); - *aReturn = text->mWhiteSpace != NS_STYLE_WHITESPACE_PRE && - text->mWhiteSpace != NS_STYLE_WHITESPACE_MOZ_PRE_WRAP; + *aReturn = !text->WhiteSpaceIsSignificant(); } else { // empty inter-tag text node without frame, e.g., in between \n diff --git a/mozilla/layout/style/nsCSSKeywordList.h b/mozilla/layout/style/nsCSSKeywordList.h index df9ac9e1e34..b435a114989 100644 --- a/mozilla/layout/style/nsCSSKeywordList.h +++ b/mozilla/layout/style/nsCSSKeywordList.h @@ -367,6 +367,7 @@ CSS_KEY(physical, physical) CSS_KEY(pointer, pointer) CSS_KEY(portrait, portrait) CSS_KEY(pre, pre) +CSS_KEY(pre-wrap, pre_wrap) CSS_KEY(progress, progress) CSS_KEY(pt, pt) CSS_KEY(px, px) diff --git a/mozilla/layout/style/nsCSSProps.cpp b/mozilla/layout/style/nsCSSProps.cpp index 42fdbf96914..dca3c2cdb46 100644 --- a/mozilla/layout/style/nsCSSProps.cpp +++ b/mozilla/layout/style/nsCSSProps.cpp @@ -957,7 +957,8 @@ const PRInt32 nsCSSProps::kVolumeKTable[] = { const PRInt32 nsCSSProps::kWhitespaceKTable[] = { eCSSKeyword_pre, NS_STYLE_WHITESPACE_PRE, eCSSKeyword_nowrap, NS_STYLE_WHITESPACE_NOWRAP, - eCSSKeyword__moz_pre_wrap, NS_STYLE_WHITESPACE_MOZ_PRE_WRAP, + eCSSKeyword_pre_wrap, NS_STYLE_WHITESPACE_PRE_WRAP, + eCSSKeyword__moz_pre_wrap, NS_STYLE_WHITESPACE_PRE_WRAP, eCSSKeyword_UNKNOWN,-1 }; diff --git a/mozilla/layout/style/nsStyleStruct.h b/mozilla/layout/style/nsStyleStruct.h index 47edcfa14f2..8ee7169aba9 100644 --- a/mozilla/layout/style/nsStyleStruct.h +++ b/mozilla/layout/style/nsStyleStruct.h @@ -697,12 +697,12 @@ struct nsStyleText { PRBool WhiteSpaceIsSignificant() const { return mWhiteSpace == NS_STYLE_WHITESPACE_PRE || - mWhiteSpace == NS_STYLE_WHITESPACE_MOZ_PRE_WRAP; + mWhiteSpace == NS_STYLE_WHITESPACE_PRE_WRAP; } PRBool WhiteSpaceCanWrap() const { return mWhiteSpace == NS_STYLE_WHITESPACE_NORMAL || - mWhiteSpace == NS_STYLE_WHITESPACE_MOZ_PRE_WRAP; + mWhiteSpace == NS_STYLE_WHITESPACE_PRE_WRAP; } }; diff --git a/mozilla/layout/style/test/property_database.js b/mozilla/layout/style/test/property_database.js index 761e4ce9e3e..0f2b20d8cdf 100644 --- a/mozilla/layout/style/test/property_database.js +++ b/mozilla/layout/style/test/property_database.js @@ -1563,7 +1563,7 @@ var gCSSProperties = { inherited: true, type: CSS_TYPE_LONGHAND, initial_values: [ "normal" ], - other_values: [ "pre", "nowrap" ], + other_values: [ "pre", "nowrap", "pre-wrap" ], invalid_values: [] }, "widows": {