diff --git a/content/base/src/nsCopySupport.cpp b/content/base/src/nsCopySupport.cpp index cae61fa0..d4e11ae8 100644 --- a/content/base/src/nsCopySupport.cpp +++ b/content/base/src/nsCopySupport.cpp @@ -340,7 +340,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/content/base/src/nsDocumentEncoder.cpp b/content/base/src/nsDocumentEncoder.cpp index 53a94f92..800df5ed 100644 --- a/content/base/src/nsDocumentEncoder.cpp +++ b/content/base/src/nsDocumentEncoder.cpp @@ -1149,7 +1149,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/content/base/src/nsPlainTextSerializer.cpp b/content/base/src/nsPlainTextSerializer.cpp index 6c0f5c26..00b65ab1 100644 --- a/content/base/src/nsPlainTextSerializer.cpp +++ b/content/base/src/nsPlainTextSerializer.cpp @@ -677,7 +677,7 @@ nsPlainTextSerializer::DoOpenContainer(const nsIParserNode* aNode, PRInt32 aTag) if(NS_SUCCEEDED(GetAttributeValue(aNode, nsHTMLAtoms::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/content/html/content/src/nsHTMLPreElement.cpp b/content/html/content/src/nsHTMLPreElement.cpp index 0c0a249d..5045b061 100644 --- a/content/html/content/src/nsHTMLPreElement.cpp +++ b/content/html/content/src/nsHTMLPreElement.cpp @@ -150,7 +150,7 @@ MapAttributesIntoRule(const nsMappedAttributes* aAttributes, if (aData->mTextData->mWhiteSpace.GetUnit() == eCSSUnit_Null) { // wrap: empty if (aAttributes->GetAttr(nsHTMLAtoms::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(nsHTMLAtoms::width); @@ -162,7 +162,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/editor/libeditor/base/nsEditor.cpp b/editor/libeditor/base/nsEditor.cpp index 2676d428..c06384e6 100644 --- a/editor/libeditor/base/nsEditor.cpp +++ b/editor/libeditor/base/nsEditor.cpp @@ -4434,8 +4434,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/editor/libeditor/text/nsPlaintextEditor.cpp b/editor/libeditor/text/nsPlaintextEditor.cpp index a3b02cd4..d618f75e 100644 --- a/editor/libeditor/text/nsPlaintextEditor.cpp +++ b/editor/libeditor/text/nsPlaintextEditor.cpp @@ -1002,12 +1002,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/layout/base/nsStyleConsts.h b/layout/base/nsStyleConsts.h index 66eaa4b4..dc04fcca 100644 --- a/layout/base/nsStyleConsts.h +++ b/layout/base/nsStyleConsts.h @@ -569,7 +569,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/layout/generic/nsLineLayout.cpp b/layout/generic/nsLineLayout.cpp index 23d114c9..4b2875c7 100644 --- a/layout/generic/nsLineLayout.cpp +++ b/layout/generic/nsLineLayout.cpp @@ -1927,8 +1927,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/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index b6693221..408b6a94 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -631,7 +631,7 @@ public: mNumJustifiableCharacterReceivingExtraJot = 0; mExtraSpacePerJustifiableCharacter = 0; mPreformatted = (NS_STYLE_WHITESPACE_PRE == mText->mWhiteSpace) || - (NS_STYLE_WHITESPACE_MOZ_PRE_WRAP == mText->mWhiteSpace); + (NS_STYLE_WHITESPACE_PRE_WRAP == mText->mWhiteSpace); mJustifying = (NS_STYLE_TEXT_ALIGN_JUSTIFY == mText->mTextAlign) && !mPreformatted; @@ -5907,7 +5907,7 @@ nsTextFrame::Reflow(nsPresContext* aPresContext, } PRBool wrapping = (NS_STYLE_WHITESPACE_NORMAL == ts.mText->mWhiteSpace) || - (NS_STYLE_WHITESPACE_MOZ_PRE_WRAP == ts.mText->mWhiteSpace); + (NS_STYLE_WHITESPACE_PRE_WRAP == ts.mText->mWhiteSpace); // Set whitespace skip flag PRBool skipWhitespace = PR_FALSE; @@ -6179,7 +6179,7 @@ nsTextFrame::TrimTrailingWhiteSpace(nsPresContext* aPresContext, const nsStyleText* textStyle = GetStyleText(); if (mContentLength && (NS_STYLE_WHITESPACE_PRE != textStyle->mWhiteSpace) && - (NS_STYLE_WHITESPACE_MOZ_PRE_WRAP != textStyle->mWhiteSpace)) { + (NS_STYLE_WHITESPACE_PRE_WRAP != textStyle->mWhiteSpace)) { // Get the text fragments that make up our content nsCOMPtr tc = do_QueryInterface(mContent); diff --git a/layout/generic/nsTextTransformer.cpp b/layout/generic/nsTextTransformer.cpp index 3891d50a..16e75e0e 100644 --- a/layout/generic/nsTextTransformer.cpp +++ b/layout/generic/nsTextTransformer.cpp @@ -260,7 +260,7 @@ nsTextTransformer::Init(nsIFrame* aFrame, if (NS_STYLE_WHITESPACE_PRE == styleText->mWhiteSpace) { mMode = ePreformatted; } - else if (NS_STYLE_WHITESPACE_MOZ_PRE_WRAP == styleText->mWhiteSpace) { + else if (NS_STYLE_WHITESPACE_PRE_WRAP == styleText->mWhiteSpace) { mMode = ePreWrap; } mTextTransform = styleText->mTextTransform; @@ -1569,7 +1569,7 @@ struct SelfTestData { static PRUint8 preModeValue[NUM_MODES] = { NS_STYLE_WHITESPACE_NORMAL, NS_STYLE_WHITESPACE_PRE, - NS_STYLE_WHITESPACE_MOZ_PRE_WRAP + NS_STYLE_WHITESPACE_PRE_WRAP }; static PRUnichar test1text[] = { @@ -1812,7 +1812,7 @@ nsTextTransformer::Init2(const nsTextFragment* aFrag, if (NS_STYLE_WHITESPACE_PRE == aWhiteSpace) { mMode = ePreformatted; } - else if (NS_STYLE_WHITESPACE_MOZ_PRE_WRAP == aWhiteSpace) { + else if (NS_STYLE_WHITESPACE_PRE_WRAP == aWhiteSpace) { mMode = ePreWrap; } mTextTransform = aTextTransform; diff --git a/layout/inspector/src/inDOMUtils.cpp b/layout/inspector/src/inDOMUtils.cpp index 3b961384..b27e1c79 100644 --- a/layout/inspector/src/inDOMUtils.cpp +++ b/layout/inspector/src/inDOMUtils.cpp @@ -108,8 +108,7 @@ inDOMUtils::IsIgnorableWhitespace(nsIDOMCharacterData *aDataNode, presShell->GetPrimaryFrameFor(content, &frame); 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/layout/style/nsCSSKeywordList.h b/layout/style/nsCSSKeywordList.h index 36d0f72c..8f42280e 100644 --- a/layout/style/nsCSSKeywordList.h +++ b/layout/style/nsCSSKeywordList.h @@ -355,6 +355,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/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index fecaf7d5..771b01a2 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -928,7 +928,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/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 1b937f6f..56d1ba86 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -740,7 +740,7 @@ struct nsStyleText : public nsStyleStruct { PRBool WhiteSpaceIsSignificant() const { return mWhiteSpace == NS_STYLE_WHITESPACE_PRE || - mWhiteSpace == NS_STYLE_WHITESPACE_MOZ_PRE_WRAP; + mWhiteSpace == NS_STYLE_WHITESPACE_PRE_WRAP; } };