Bug 226439. Convert codebase to use AppendLiteral/AssignLiteral/LowerCaseEqualsLiteral. r+sr=darin

This commit is contained in:
roc+%cs.cmu.edu 2004-06-17 00:13:25 +00:00
parent 7056c5e6fd
commit 0f4150a4e5
457 changed files with 2384 additions and 2416 deletions

View File

@ -568,13 +568,13 @@ NS_IMETHODIMP nsAppRootAccessible::Shutdown()
NS_IMETHODIMP nsAppRootAccessible::GetName(nsAString& _retval)
{
_retval = NS_LITERAL_STRING("Mozilla");
_retval.AssignLiteral("Mozilla");
return NS_OK;
}
NS_IMETHODIMP nsAppRootAccessible::GetDescription(nsAString& aDescription)
{
aDescription = NS_LITERAL_STRING("Mozilla Root Accessible");
aDescription.AssignLiteral("Mozilla Root Accessible");
return NS_OK;
}

View File

@ -68,7 +68,7 @@ NS_IMETHODIMP nsHTMLTextFieldAccessibleWrap::GetExtState(PRUint32 *aState)
if (NS_SUCCEEDED(rv) && htmlFormElement) {
nsAutoString typeString;
htmlFormElement->GetType(typeString);
if (typeString.EqualsIgnoreCase("text"))
if (typeString.LowerCaseEqualsLiteral("text"))
*aState |= STATE_SINGLE_LINE;
}
return NS_OK;

View File

@ -214,7 +214,7 @@ getKeyBindingCB(AtkAction *aAction, gint aActionIndex)
}
}
else //don't have accesskey
allKeyBinding = NS_LITERAL_STRING(";");
allKeyBinding.AssignLiteral(";");
//get shortcut
nsAutoString keyBinding, subShortcut;
@ -235,8 +235,8 @@ getKeyBindingCB(AtkAction *aAction, gint aActionIndex)
keyBinding.Mid(subString, oldPos, curPos - oldPos);
//change "Ctrl" to "Control"
if (subString.EqualsIgnoreCase("ctrl"))
subString = NS_LITERAL_STRING("Control");
if (subString.LowerCaseEqualsLiteral("ctrl"))
subString.AssignLiteral("Control");
subShortcut += NS_LITERAL_STRING("<") + subString +
NS_LITERAL_STRING(">");

View File

@ -88,7 +88,7 @@ NS_IMETHODIMP nsXULProgressMeterAccessibleWrap::SetCurrentValue(double aValue, P
PRUint32 value = PRUint32(aValue * 100.0 + 0.5);
nsAutoString valueString;
valueString.AppendInt(value);
valueString.Append(NS_LITERAL_STRING("%"));
valueString.AppendLiteral("%");
if (NS_SUCCEEDED(element->SetAttribute(NS_LITERAL_STRING("value"), valueString))) {
*_retval = PR_TRUE;
return NS_OK;

View File

@ -1629,7 +1629,7 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
// Please leave this in for now, it's a convenient debugging method
nsAutoString name;
aNode->GetLocalName(name);
if (name.EqualsIgnoreCase("ol"))
if (name.LowerCaseEqualsLiteral("ol"))
printf("## aaronl debugging tag name\n");
nsAutoString attrib;

View File

@ -181,9 +181,9 @@ NS_IMETHODIMP nsAccessible::GetKeyboardShortcut(nsAString& _retval)
}
nsAutoString propertyKey;
switch (gGeneralAccesskeyModifier) {
case nsIDOMKeyEvent::DOM_VK_CONTROL: propertyKey = NS_LITERAL_STRING("VK_CONTROL"); break;
case nsIDOMKeyEvent::DOM_VK_ALT: propertyKey = NS_LITERAL_STRING("VK_ALT"); break;
case nsIDOMKeyEvent::DOM_VK_META: propertyKey = NS_LITERAL_STRING("VK_META"); break;
case nsIDOMKeyEvent::DOM_VK_CONTROL: propertyKey.AssignLiteral("VK_CONTROL"); break;
case nsIDOMKeyEvent::DOM_VK_ALT: propertyKey.AssignLiteral("VK_ALT"); break;
case nsIDOMKeyEvent::DOM_VK_META: propertyKey.AssignLiteral("VK_META"); break;
}
if (!propertyKey.IsEmpty())
nsAccessible::GetFullKeyName(propertyKey, accesskey, _retval);
@ -1044,7 +1044,7 @@ NS_IMETHODIMP nsAccessible::AppendFlatStringFromContentNode(nsIContent *aContent
nsCOMPtr<nsIDOMHTMLBRElement> brElement(do_QueryInterface(aContent));
if (brElement) { // If it's a line break, insert a space so that words aren't jammed together
aFlatString->Append(NS_LITERAL_STRING("\r\n"));
aFlatString->AppendLiteral("\r\n");
return NS_OK;
}

View File

@ -226,7 +226,7 @@ NS_IMETHODIMP nsDocAccessible::GetDocType(nsAString& aDocType)
#ifdef MOZ_XUL
nsCOMPtr<nsIXULDocument> xulDoc(do_QueryInterface(mDocument));
if (xulDoc) {
aDocType = NS_LITERAL_STRING("window"); // doctype not implemented for XUL at time of writing - causes assertion
aDocType.AssignLiteral("window"); // doctype not implemented for XUL at time of writing - causes assertion
return NS_OK;
} else
#endif

View File

@ -71,7 +71,7 @@ NS_IMETHODIMP nsFormControlAccessible::GetState(PRUint32 *_retval)
htmlFormElement->GetDisabled(&disabled);
nsAutoString typeString;
htmlFormElement->GetType(typeString);
if (typeString.EqualsIgnoreCase("password"))
if (typeString.LowerCaseEqualsLiteral("password"))
*_retval |= STATE_PROTECTED;
}
else {

View File

@ -334,7 +334,7 @@ NS_IMETHODIMP nsRootAccessible::HandleEvent(nsIDOMEvent* aEvent)
targetNode->GetLocalName(localName);
#ifdef DEBUG_aleventhal
// Very useful for debugging, please leave this here.
if (eventType.EqualsIgnoreCase("DOMMenuItemActive")) {
if (eventType.LowerCaseEqualsLiteral("dommenuitemactive")) {
printf("debugging events");
}
if (localName.EqualsIgnoreCase("tree")) {
@ -402,9 +402,9 @@ NS_IMETHODIMP nsRootAccessible::HandleEvent(nsIDOMEvent* aEvent)
#ifndef MOZ_ACCESSIBILITY_ATK
#ifdef MOZ_XUL
// tree event
if (treeItemAccessible && (eventType.EqualsIgnoreCase("DOMMenuItemActive") ||
eventType.EqualsIgnoreCase("select") ||
eventType.EqualsIgnoreCase("focus"))) {
if (treeItemAccessible && (eventType.LowerCaseEqualsLiteral("dommenuitemactive") ||
eventType.LowerCaseEqualsLiteral("select") ||
eventType.LowerCaseEqualsLiteral("focus"))) {
FireAccessibleFocusEvent(accessible, targetNode); // Tree has focus
privAcc = do_QueryInterface(treeItemAccessible);
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_FOCUS,
@ -415,19 +415,19 @@ NS_IMETHODIMP nsRootAccessible::HandleEvent(nsIDOMEvent* aEvent)
}
#endif
if (eventType.EqualsIgnoreCase("unload")) {
if (eventType.LowerCaseEqualsLiteral("unload")) {
nsCOMPtr<nsPIAccessibleDocument> privateAccDoc =
do_QueryInterface(accessible);
if (privateAccDoc) {
privateAccDoc->Destroy();
}
}
else if (eventType.EqualsIgnoreCase("focus") ||
eventType.EqualsIgnoreCase("DOMMenuItemActive")) {
else if (eventType.LowerCaseEqualsLiteral("focus") ||
eventType.LowerCaseEqualsLiteral("dommenuitemactive")) {
if (optionTargetNode &&
NS_SUCCEEDED(mAccService->GetAccessibleInShell(optionTargetNode, eventShell,
getter_AddRefs(accessible)))) {
if (eventType.EqualsIgnoreCase("focus")) {
if (eventType.LowerCaseEqualsLiteral("focus")) {
nsCOMPtr<nsIAccessible> selectAccessible;
mAccService->GetAccessibleInShell(targetNode, eventShell,
getter_AddRefs(selectAccessible));
@ -440,15 +440,15 @@ NS_IMETHODIMP nsRootAccessible::HandleEvent(nsIDOMEvent* aEvent)
else
FireAccessibleFocusEvent(accessible, targetNode);
}
else if (eventType.EqualsIgnoreCase("ValueChange")) {
else if (eventType.LowerCaseEqualsLiteral("valuechange")) {
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE,
accessible, nsnull);
}
else if (eventType.EqualsIgnoreCase("CheckboxStateChange")) {
else if (eventType.LowerCaseEqualsLiteral("checkboxstatechange")) {
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_STATE_CHANGE,
accessible, nsnull);
}
else if (eventType.EqualsIgnoreCase("RadioStateChange") ) {
else if (eventType.LowerCaseEqualsLiteral("radiostatechange") ) {
// first the XUL radio buttons
if (targetNode &&
NS_SUCCEEDED(mAccService->GetAccessibleInShell(targetNode, eventShell,
@ -462,9 +462,9 @@ NS_IMETHODIMP nsRootAccessible::HandleEvent(nsIDOMEvent* aEvent)
accessible, nsnull);
}
}
else if (eventType.EqualsIgnoreCase("DOMMenuBarActive"))
else if (eventType.LowerCaseEqualsLiteral("dommenubaractive"))
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_MENUSTART, accessible, nsnull);
else if (eventType.EqualsIgnoreCase("DOMMenuBarInactive")) {
else if (eventType.LowerCaseEqualsLiteral("dommenubarinactive")) {
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_MENUEND, accessible, nsnull);
GetFocusedChild(getter_AddRefs(accessible));
if (accessible) {
@ -475,9 +475,9 @@ NS_IMETHODIMP nsRootAccessible::HandleEvent(nsIDOMEvent* aEvent)
else {
// Menu popup events
PRUint32 menuEvent = 0;
if (eventType.EqualsIgnoreCase("popupshowing"))
if (eventType.LowerCaseEqualsLiteral("popupshowing"))
menuEvent = nsIAccessibleEvent::EVENT_MENUPOPUPSTART;
else if (eventType.EqualsIgnoreCase("popuphiding"))
else if (eventType.LowerCaseEqualsLiteral("popuphiding"))
menuEvent = nsIAccessibleEvent::EVENT_MENUPOPUPEND;
if (menuEvent) {
PRUint32 role = ROLE_NOTHING;
@ -488,15 +488,15 @@ NS_IMETHODIMP nsRootAccessible::HandleEvent(nsIDOMEvent* aEvent)
}
#else
AtkStateChange stateData;
if (eventType.EqualsIgnoreCase("unload")) {
if (eventType.LowerCaseEqualsLiteral("unload")) {
nsCOMPtr<nsPIAccessibleDocument> privateAccDoc =
do_QueryInterface(accessible);
if (privateAccDoc) {
privateAccDoc->Destroy();
}
}
else if (eventType.EqualsIgnoreCase("focus") ||
eventType.EqualsIgnoreCase("DOMMenuItemActive")) {
else if (eventType.LowerCaseEqualsLiteral("focus") ||
eventType.LowerCaseEqualsLiteral("dommenuitemactive")) {
if (treeItemAccessible) { // use focused treeitem
privAcc = do_QueryInterface(treeItemAccessible);
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_FOCUS,
@ -517,37 +517,37 @@ NS_IMETHODIMP nsRootAccessible::HandleEvent(nsIDOMEvent* aEvent)
else
FireAccessibleFocusEvent(accessible, targetNode);
}
else if (eventType.EqualsIgnoreCase("select")) {
else if (eventType.LowerCaseEqualsLiteral("select")) {
if (treeItemAccessible) { // it's a XUL <tree>
// use EVENT_FOCUS instead of EVENT_ATK_SELECTION_CHANGE
privAcc = do_QueryInterface(treeItemAccessible);
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_FOCUS,
treeItemAccessible, nsnull);
}
}
}
#if 0
// XXX todo: value change events for ATK are done with
// AtkPropertyChange, PROP_VALUE. Need the old and new value.
// Not sure how we'll get the old value.
else if (eventType.EqualsIgnoreCase("ValueChange")) {
else if (eventType.LowerCaseEqualsLiteral("valuechange")) {
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE,
accessible, nsnull);
}
#endif
else if (eventType.EqualsIgnoreCase("CheckboxStateChange") || // it's a XUL <checkbox>
eventType.EqualsIgnoreCase("RadioStateChange")) { // it's a XUL <radio>
else if (eventType.LowerCaseEqualsLiteral("checkboxstatechange") || // it's a XUL <checkbox>
eventType.LowerCaseEqualsLiteral("radiostatechange")) { // it's a XUL <radio>
accessible->GetState(&stateData.state);
stateData.enable = (stateData.state & STATE_CHECKED) != 0;
stateData.state = STATE_CHECKED;
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_STATE_CHANGE, accessible, &stateData);
if (eventType.EqualsIgnoreCase("RadioStateChange")) {
if (eventType.LowerCaseEqualsLiteral("radiostatechange")) {
FireAccessibleFocusEvent(accessible, targetNode);
}
}
else if (eventType.EqualsIgnoreCase("popupshowing")) {
else if (eventType.LowerCaseEqualsLiteral("popupshowing")) {
FireAccessibleFocusEvent(accessible, targetNode);
}
else if (eventType.EqualsIgnoreCase("popuphiding")) {
else if (eventType.LowerCaseEqualsLiteral("popuphiding")) {
//FireAccessibleFocusEvent(accessible, targetNode);
}
#endif

View File

@ -186,7 +186,7 @@ NS_IMETHODIMP nsHTMLButtonAccessible::GetState(PRUint32 *_retval)
nsAutoString buttonType;
element->GetAttribute(NS_LITERAL_STRING("type"), buttonType);
if (buttonType.EqualsIgnoreCase("submit"))
if (buttonType.LowerCaseEqualsLiteral("submit"))
*_retval |= STATE_DEFAULT;
return NS_OK;
@ -271,7 +271,7 @@ NS_IMETHODIMP nsHTML4ButtonAccessible::GetState(PRUint32 *_retval)
nsAutoString buttonType;
element->GetAttribute(NS_LITERAL_STRING("type"), buttonType);
if (buttonType.EqualsIgnoreCase("submit"))
if (buttonType.LowerCaseEqualsLiteral("submit"))
*_retval |= STATE_DEFAULT;
return NS_OK;

View File

@ -256,9 +256,9 @@ NS_IMETHODIMP nsXULDropmarkerAccessible::GetActionName(PRUint8 index, nsAString&
{
if (index == eAction_Click) {
if (DropmarkerOpen(PR_FALSE))
aResult = NS_LITERAL_STRING("close");
aResult.AssignLiteral("close");
else
aResult = NS_LITERAL_STRING("open");
aResult.AssignLiteral("open");
return NS_OK;
}
@ -337,9 +337,9 @@ NS_IMETHODIMP nsXULCheckboxAccessible::GetActionName(PRUint8 index, nsAString& _
GetState(&state);
if (state & STATE_CHECKED)
_retval = NS_LITERAL_STRING("uncheck");
_retval.AssignLiteral("uncheck");
else
_retval = NS_LITERAL_STRING("check");
_retval.AssignLiteral("check");
return NS_OK;
}
@ -464,7 +464,7 @@ NS_IMETHODIMP nsXULProgressMeterAccessible::GetValue(nsAString& _retval)
NS_ASSERTION(element, "No element for DOM node!");
element->GetAttribute(NS_LITERAL_STRING("value"), _retval);
if (!_retval.IsEmpty() && _retval.Last() != '%')
_retval.Append(NS_LITERAL_STRING("%"));
_retval.AppendLiteral("%");
return NS_OK;
}

View File

@ -139,9 +139,9 @@ NS_IMETHODIMP nsXULMenuitemAccessible::GetKeyboardShortcut(nsAString& _retval)
}
nsAutoString propertyKey;
switch (gMenuAccesskeyModifier) {
case nsIDOMKeyEvent::DOM_VK_CONTROL: propertyKey = NS_LITERAL_STRING("VK_CONTROL"); break;
case nsIDOMKeyEvent::DOM_VK_ALT: propertyKey = NS_LITERAL_STRING("VK_ALT"); break;
case nsIDOMKeyEvent::DOM_VK_META: propertyKey = NS_LITERAL_STRING("VK_META"); break;
case nsIDOMKeyEvent::DOM_VK_CONTROL: propertyKey.AssignLiteral("VK_CONTROL"); break;
case nsIDOMKeyEvent::DOM_VK_ALT: propertyKey.AssignLiteral("VK_ALT"); break;
case nsIDOMKeyEvent::DOM_VK_META: propertyKey.AssignLiteral("VK_META"); break;
}
if (!propertyKey.IsEmpty())
nsAccessible::GetFullKeyName(propertyKey, accesskey, _retval);
@ -372,7 +372,7 @@ NS_IMETHODIMP nsXULMenubarAccessible::GetState(PRUint32 *_retval)
NS_IMETHODIMP nsXULMenubarAccessible::GetName(nsAString& _retval)
{
_retval = NS_LITERAL_STRING("Application");
_retval.AssignLiteral("Application");
return NS_OK;
}

View File

@ -287,7 +287,7 @@ NS_IMETHODIMP nsXULSelectListAccessible::GetState(PRUint32 *_retval)
nsCOMPtr<nsIDOMElement> element(do_QueryInterface(mDOMNode));
NS_ASSERTION(element, "No nsIDOMElement for caption node!");
element->GetAttribute(NS_LITERAL_STRING("seltype"), selectionTypeString) ;
if (selectionTypeString.EqualsIgnoreCase("multiple"))
if (selectionTypeString.LowerCaseEqualsLiteral("multiple"))
*_retval |= STATE_MULTISELECTABLE | STATE_EXTSELECTABLE;
return NS_OK;

View File

@ -755,13 +755,13 @@ nsScriptSecurityManager::CheckPropertyAccessImpl(PRUint32 aAction,
switch(aAction)
{
case nsIXPCSecurityManager::ACCESS_GET_PROPERTY:
stringName.Assign(NS_LITERAL_STRING("GetPropertyDenied"));
stringName.AssignLiteral("GetPropertyDenied");
break;
case nsIXPCSecurityManager::ACCESS_SET_PROPERTY:
stringName.Assign(NS_LITERAL_STRING("SetPropertyDenied"));
stringName.AssignLiteral("SetPropertyDenied");
break;
case nsIXPCSecurityManager::ACCESS_CALL_METHOD:
stringName.Assign(NS_LITERAL_STRING("CallMethodDenied"));
stringName.AssignLiteral("CallMethodDenied");
}
NS_ConvertUTF8toUTF16 className(classInfoData.GetName());

View File

@ -607,8 +607,7 @@ mozSanitizingHTMLSerializer::SanitizeAttrValue(nsHTMLTag aTag,
// Check img src scheme
if (aTag == eHTMLTag_img &&
anAttrName.Equals(NS_LITERAL_STRING("src"),
nsCaseInsensitiveStringComparator()))
anAttrName.LowerCaseEqualsLiteral("src"))
{
nsresult rv;
nsCOMPtr<nsIIOService> ioService = do_GetIOService(&rv);

View File

@ -120,7 +120,7 @@ nsCommentNode::Tag() const
NS_IMETHODIMP
nsCommentNode::GetNodeName(nsAString& aNodeName)
{
aNodeName.Assign(NS_LITERAL_STRING("#comment"));
aNodeName.AssignLiteral("#comment");
return NS_OK;
}

View File

@ -1162,11 +1162,11 @@ nsTransferableFactory::Produce(nsITransferable** outTrans)
mIsAnchor = PR_TRUE;
GetAnchorURL(area, mUrlString); // gives an absolute link
mHtmlString = NS_LITERAL_STRING("<a href=\"");
mHtmlString.AssignLiteral("<a href=\"");
mHtmlString.Append(mUrlString);
mHtmlString.Append(NS_LITERAL_STRING("\">"));
mHtmlString.AppendLiteral("\">");
mHtmlString.Append(mTitleString);
mHtmlString.Append(NS_LITERAL_STRING("</a>"));
mHtmlString.AppendLiteral("</a>");
}
else if (image)
{
@ -1268,7 +1268,7 @@ nsTransferableFactory::ConvertStringsToTransferable(nsITransferable** outTrans)
// in the drag data
if ( !mUrlString.IsEmpty() && mIsAnchor ) {
nsAutoString dragData ( mUrlString );
dragData += NS_LITERAL_STRING("\n");
dragData.AppendLiteral("\n");
dragData += mTitleString;
nsCOMPtr<nsISupportsString> urlPrimitive(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
if ( !urlPrimitive )

View File

@ -398,7 +398,7 @@ nsContentSink::ProcessHeaderData(nsIAtom* aHeader, const nsAString& aValue,
else if (aHeader == nsHTMLAtoms::msthemecompatible) {
// Disable theming for the presshell if the value is no.
nsAutoString value(aValue);
if (value.EqualsIgnoreCase("no")) {
if (value.LowerCaseEqualsLiteral("no")) {
nsIPresShell* shell = mDocument->GetShellAt(0);
if (shell) {
shell->DisableThemeSupport();
@ -553,22 +553,22 @@ nsContentSink::ProcessLinkHeader(nsIContent* aElement,
value++;
}
if (attr.EqualsIgnoreCase("rel")) {
if (attr.LowerCaseEqualsLiteral("rel")) {
if (rel.IsEmpty()) {
rel = value;
rel.CompressWhitespace();
}
} else if (attr.EqualsIgnoreCase("title")) {
} else if (attr.LowerCaseEqualsLiteral("title")) {
if (title.IsEmpty()) {
title = value;
title.CompressWhitespace();
}
} else if (attr.EqualsIgnoreCase("type")) {
} else if (attr.LowerCaseEqualsLiteral("type")) {
if (type.IsEmpty()) {
type = value;
type.StripWhitespace();
}
} else if (attr.EqualsIgnoreCase("media")) {
} else if (attr.LowerCaseEqualsLiteral("media")) {
if (media.IsEmpty()) {
media = value;
@ -656,7 +656,7 @@ nsContentSink::ProcessStyleLink(nsIContent* aElement,
nsParserUtils::SplitMimeType(aType, mimeType, params);
// see bug 18817
if (!mimeType.IsEmpty() && !mimeType.EqualsIgnoreCase("text/css")) {
if (!mimeType.IsEmpty() && !mimeType.LowerCaseEqualsLiteral("text/css")) {
// Unknown stylesheet language
return NS_OK;
}

View File

@ -1338,8 +1338,7 @@ static inline PRBool IsAutocompleteOff(nsIDOMElement* aElement)
{
nsAutoString autocomplete;
aElement->GetAttribute(NS_LITERAL_STRING("autocomplete"), autocomplete);
return autocomplete.Equals(NS_LITERAL_STRING("off"),
nsCaseInsensitiveStringComparator());
return autocomplete.LowerCaseEqualsLiteral("off");
}
/*static*/ nsresult

View File

@ -96,11 +96,11 @@ nsresult nsCopySupport::HTMLCopy(nsISelection *aSel, nsIDocument *aDoc, PRInt16
nsAutoString mimeType;
if (bIsHTMLCopy)
mimeType = NS_LITERAL_STRING(kHTMLMime);
mimeType.AssignLiteral(kHTMLMime);
else
{
flags |= nsIDocumentEncoder::OutputBodyOnly | nsIDocumentEncoder::OutputPreformatted;
mimeType = NS_LITERAL_STRING(kUnicodeMime);
mimeType.AssignLiteral(kUnicodeMime);
}
rv = docEncoder->Init(aDoc, mimeType, flags);

View File

@ -2936,7 +2936,7 @@ nsDocument::SetDir(const nsAString& aDirection)
NS_IMETHODIMP
nsDocument::GetNodeName(nsAString& aNodeName)
{
aNodeName.Assign(NS_LITERAL_STRING("#document"));
aNodeName.AssignLiteral("#document");
return NS_OK;
}
@ -3538,7 +3538,7 @@ nsDocument::GetXmlVersion(nsAString& aXmlVersion)
// If there is no declaration, the value is "1.0".
// XXX We only support "1.0", so always output "1.0" until that changes.
aXmlVersion.Assign(NS_LITERAL_STRING("1.0"));
aXmlVersion.AssignLiteral("1.0");
return NS_OK;
}
@ -4021,7 +4021,7 @@ nsDocument::GetXMLDeclaration(nsAString& aVersion, nsAString& aEncoding,
}
// always until we start supporting 1.1 etc.
aVersion.Assign(NS_LITERAL_STRING("1.0"));
aVersion.AssignLiteral("1.0");
if (mXMLDeclarationBits & XML_DECLARATION_BITS_ENCODING_EXISTS) {
// This is what we have stored, not necessarily what was written
@ -4031,9 +4031,9 @@ nsDocument::GetXMLDeclaration(nsAString& aVersion, nsAString& aEncoding,
if (mXMLDeclarationBits & XML_DECLARATION_BITS_STANDALONE_EXISTS) {
if (mXMLDeclarationBits & XML_DECLARATION_BITS_STANDALONE_YES) {
aStandalone.Assign(NS_LITERAL_STRING("yes"));
aStandalone.AssignLiteral("yes");
} else {
aStandalone.Assign(NS_LITERAL_STRING("no"));
aStandalone.AssignLiteral("no");
}
}
}

View File

@ -181,7 +181,7 @@ NS_INTERFACE_MAP_END
nsDocumentEncoder::nsDocumentEncoder()
{
mMimeType.Assign(NS_LITERAL_STRING("text/plain"));
mMimeType.AssignLiteral("text/plain");
mFlags = 0;
mWrapColumn = 72;
@ -951,7 +951,7 @@ nsDocumentEncoder::EncodeToStream(nsIOutputStream* aStream)
getter_AddRefs(mUnicodeEncoder));
NS_ENSURE_SUCCESS(rv, rv);
if (mMimeType.EqualsIgnoreCase("text/plain")) {
if (mMimeType.LowerCaseEqualsLiteral("text/plain")) {
rv = mUnicodeEncoder->SetOutputErrorBehavior(nsIUnicodeEncoder::kOnError_Replace, nsnull, '?');
NS_ENSURE_SUCCESS(rv, rv);
}
@ -1072,7 +1072,7 @@ nsHTMLCopyEncoder::Init(nsIDocument* aDocument,
mIsCopying = PR_TRUE;
mDocument = aDocument;
mMimeType = NS_LITERAL_STRING("text/html");
mMimeType.AssignLiteral("text/html");
// Make all links absolute when copying
// (see related bugs #57296, #41924, #58646, #32768)
@ -1150,7 +1150,7 @@ nsHTMLCopyEncoder::SetSelection(nsISelection* aSelection)
if (mIsTextWidget)
{
mSelection = aSelection;
mMimeType = NS_LITERAL_STRING("text/plain");
mMimeType.AssignLiteral("text/plain");
return NS_OK;
}

View File

@ -2378,7 +2378,7 @@ DocumentViewerImpl::GetDefaultCharacterSet(nsACString& aDefaultCharacterSet)
if (!defCharset.IsEmpty())
LossyCopyUTF16toASCII(defCharset, mDefaultCharacterSet);
else
mDefaultCharacterSet.Assign(NS_LITERAL_CSTRING("ISO-8859-1"));
mDefaultCharacterSet.AssignLiteral("ISO-8859-1");
}
aDefaultCharacterSet = mDefaultCharacterSet;
return NS_OK;

View File

@ -168,7 +168,7 @@ nsFrameLoader::LoadFrame()
src.Trim(" \t\n\r");
if (src.IsEmpty()) {
src.Assign(NS_LITERAL_STRING("about:blank"));
src.AssignLiteral("about:blank");
}
// Make an absolute URI

View File

@ -552,11 +552,11 @@ nsGenericDOMDataNode::ToCString(nsAString& aBuf, PRInt32 aOffset,
while (cp < end) {
PRUnichar ch = *cp++;
if (ch == '\r') {
aBuf.Append(NS_LITERAL_STRING("\\r"));
aBuf.AppendLiteral("\\r");
} else if (ch == '\n') {
aBuf.Append(NS_LITERAL_STRING("\\n"));
aBuf.AppendLiteral("\\n");
} else if (ch == '\t') {
aBuf.Append(NS_LITERAL_STRING("\\t"));
aBuf.AppendLiteral("\\t");
} else if ((ch < ' ') || (ch >= 127)) {
char buf[10];
PR_snprintf(buf, sizeof(buf), "\\u%04x", ch);
@ -572,11 +572,11 @@ nsGenericDOMDataNode::ToCString(nsAString& aBuf, PRInt32 aOffset,
while (cp < end) {
PRUnichar ch = *cp++;
if (ch == '\r') {
aBuf.Append(NS_LITERAL_STRING("\\r"));
aBuf.AppendLiteral("\\r");
} else if (ch == '\n') {
aBuf.Append(NS_LITERAL_STRING("\\n"));
aBuf.AppendLiteral("\\n");
} else if (ch == '\t') {
aBuf.Append(NS_LITERAL_STRING("\\t"));
aBuf.AppendLiteral("\\t");
} else if ((ch < ' ') || (ch >= 127)) {
char buf[10];
PR_snprintf(buf, sizeof(buf), "\\u%04x", ch);

View File

@ -3481,7 +3481,7 @@ nsGenericElement::List(FILE* out, PRInt32 aIndent) const
mAttrsAndChildren.GetSafeAttrNameAt(index)->GetQualifiedName(buffer);
// value
buffer.Append(NS_LITERAL_STRING("="));
buffer.AppendLiteral("=");
nsAutoString value;
mAttrsAndChildren.AttrAt(index)->ToString(value);
buffer.Append(value);

View File

@ -124,13 +124,13 @@ nsHTMLContentSerializer::Init(PRUint32 aFlags, PRUint32 aWrapColumn,
// Set the line break character:
if ((mFlags & nsIDocumentEncoder::OutputCRLineBreak)
&& (mFlags & nsIDocumentEncoder::OutputLFLineBreak)) { // Windows
mLineBreak.Assign(NS_LITERAL_STRING("\r\n"));
mLineBreak.AssignLiteral("\r\n");
}
else if (mFlags & nsIDocumentEncoder::OutputCRLineBreak) { // Mac
mLineBreak.Assign(NS_LITERAL_STRING("\r"));
mLineBreak.AssignLiteral("\r");
}
else if (mFlags & nsIDocumentEncoder::OutputLFLineBreak) { // Unix/DOM
mLineBreak.Assign(NS_LITERAL_STRING("\n"));
mLineBreak.AssignLiteral("\n");
}
else {
mLineBreak.AssignWithConversion(NS_LINEBREAK); // Platform/default
@ -1303,7 +1303,7 @@ nsHTMLContentSerializer::SerializeLIValueAttribute(nsIDOMElement* aElement,
if (currElement) {
nsAutoString tagName;
currElement->GetTagName(tagName);
if (tagName.EqualsIgnoreCase("LI")) {
if (tagName.LowerCaseEqualsLiteral("li")) {
currElement->GetAttribute(NS_LITERAL_STRING("value"), valueStr);
if (valueStr.IsEmpty())
offset++;
@ -1351,7 +1351,7 @@ nsHTMLContentSerializer::IsFirstChildOfOL(nsIDOMElement* aElement){
else
return PR_FALSE;
if (parentName.EqualsIgnoreCase("OL")) {
if (parentName.LowerCaseEqualsLiteral("ol")) {
olState defaultOLState(0, PR_FALSE);
olState* state = nsnull;
if (mOLStateStack.Count() > 0)

View File

@ -128,27 +128,27 @@ nsParserUtils::IsJavaScriptLanguage(const nsString& aName, const char* *aVersion
{
JSVersion version = JSVERSION_UNKNOWN;
if (aName.EqualsIgnoreCase("JavaScript") ||
aName.EqualsIgnoreCase("LiveScript") ||
aName.EqualsIgnoreCase("Mocha")) {
if (aName.LowerCaseEqualsLiteral("javascript") ||
aName.LowerCaseEqualsLiteral("livescript") ||
aName.LowerCaseEqualsLiteral("mocha")) {
version = JSVERSION_DEFAULT;
}
else if (aName.EqualsIgnoreCase("JavaScript1.0")) {
else if (aName.LowerCaseEqualsLiteral("javascript1.0")) {
version = JSVERSION_1_0;
}
else if (aName.EqualsIgnoreCase("JavaScript1.1")) {
else if (aName.LowerCaseEqualsLiteral("javascript1.1")) {
version = JSVERSION_1_1;
}
else if (aName.EqualsIgnoreCase("JavaScript1.2")) {
else if (aName.LowerCaseEqualsLiteral("javascript1.2")) {
version = JSVERSION_1_2;
}
else if (aName.EqualsIgnoreCase("JavaScript1.3")) {
else if (aName.LowerCaseEqualsLiteral("javascript1.3")) {
version = JSVERSION_1_3;
}
else if (aName.EqualsIgnoreCase("JavaScript1.4")) {
else if (aName.LowerCaseEqualsLiteral("javascript1.4")) {
version = JSVERSION_1_4;
}
else if (aName.EqualsIgnoreCase("JavaScript1.5")) {
else if (aName.LowerCaseEqualsLiteral("javascript1.5")) {
version = JSVERSION_1_5;
}
if (version == JSVERSION_UNKNOWN)

View File

@ -184,7 +184,7 @@ nsPlainTextSerializer::Init(PRUint32 aFlags, PRUint32 aWrapColumn,
if ((mFlags & nsIDocumentEncoder::OutputCRLineBreak)
&& (mFlags & nsIDocumentEncoder::OutputLFLineBreak)) {
// Windows
mLineBreak.Assign(NS_LITERAL_STRING("\r\n"));
mLineBreak.AssignLiteral("\r\n");
}
else if (mFlags & nsIDocumentEncoder::OutputCRLineBreak) {
// Mac
@ -803,7 +803,7 @@ nsPlainTextSerializer::DoOpenContainer(const nsIParserNode* aNode, PRInt32 aTag)
nsresult rv = GetAttributeValue(aNode, nsHTMLAtoms::type, value);
PRBool isInCiteBlockquote =
NS_SUCCEEDED(rv) && value.EqualsIgnoreCase("cite");
NS_SUCCEEDED(rv) && value.LowerCaseEqualsLiteral("cite");
// Push
PushBool(mIsInCiteBlockquote, isInCiteBlockquote);
if (isInCiteBlockquote) {
@ -1058,7 +1058,7 @@ nsPlainTextSerializer::DoCloseContainer(PRInt32 aTag)
}
else if (type == eHTMLTag_a && !currentNodeIsConverted && !mURL.IsEmpty()) {
nsAutoString temp;
temp.Assign(NS_LITERAL_STRING(" <"));
temp.AssignLiteral(" <");
temp += mURL;
temp.Append(PRUnichar('>'));
Write(temp);

View File

@ -2230,7 +2230,7 @@ nsPrintEngine::ShowPrintErrorDialog(nsresult aPrintError, PRBool aIsPrinting)
switch(aPrintError)
{
#define NS_ERROR_TO_LOCALIZED_PRINT_ERROR_MSG(nserr) case nserr: stringName = NS_LITERAL_STRING(#nserr); break;
#define NS_ERROR_TO_LOCALIZED_PRINT_ERROR_MSG(nserr) case nserr: stringName.AssignLiteral(#nserr); break;
NS_ERROR_TO_LOCALIZED_PRINT_ERROR_MSG(NS_ERROR_GFX_PRINTER_CMD_NOT_FOUND)
NS_ERROR_TO_LOCALIZED_PRINT_ERROR_MSG(NS_ERROR_GFX_PRINTER_CMD_FAILURE)
NS_ERROR_TO_LOCALIZED_PRINT_ERROR_MSG(NS_ERROR_GFX_PRINTER_NO_PRINTER_AVAILABLE)
@ -3411,14 +3411,14 @@ nsPrintEngine::ElipseLongString(PRUnichar *& aStr, const PRUint32 aLen, PRBool a
if (aDoFront) {
PRUnichar * ptr = &aStr[nsCRT::strlen(aStr)-aLen+3];
nsAutoString newStr;
newStr.AppendWithConversion("...");
newStr.AppendLiteral("...");
newStr += ptr;
nsMemory::Free(aStr);
aStr = ToNewUnicode(newStr);
} else {
nsAutoString newStr(aStr);
newStr.SetLength(aLen-3);
newStr.AppendWithConversion("...");
newStr.AppendLiteral("...");
nsMemory::Free(aStr);
aStr = ToNewUnicode(newStr);
}

View File

@ -2466,7 +2466,7 @@ nsRange::CreateContextualFragment(const nsAString& aFragment,
}
else {
// Who're we kidding. This only works for html.
contentType = NS_LITERAL_CSTRING("text/html");
contentType.AssignLiteral("text/html");
}
// If there's no JS or system JS running,

View File

@ -301,8 +301,7 @@ nsScriptLoader::IsScriptEventHandler(nsIDOMHTMLScriptElement *aScriptElement)
const nsAString& for_str = nsContentUtils::TrimWhitespace(str);
if (!for_str.Equals(NS_LITERAL_STRING("window"),
nsCaseInsensitiveStringComparator())) {
if (!for_str.LowerCaseEqualsLiteral("window")) {
return PR_TRUE;
}
@ -405,8 +404,8 @@ nsScriptLoader::ProcessScriptElement(nsIDOMHTMLScriptElement *aElement,
nsAutoString params;
nsParserUtils::SplitMimeType(type, mimeType, params);
isJavaScript = mimeType.EqualsIgnoreCase("application/x-javascript") ||
mimeType.EqualsIgnoreCase("text/javascript");
isJavaScript = mimeType.LowerCaseEqualsLiteral("application/x-javascript") ||
mimeType.LowerCaseEqualsLiteral("text/javascript");
if (isJavaScript) {
JSVersion jsVersion = JSVERSION_DEFAULT;
if (params.Find("version=", PR_TRUE) == 0) {
@ -818,7 +817,7 @@ nsScriptLoader::OnStreamComplete(nsIStreamLoader* aLoader,
if (characterSet.IsEmpty()) {
// fall back to ISO-8859-1, see bug 118404
characterSet = NS_LITERAL_CSTRING("ISO-8859-1");
characterSet.AssignLiteral("ISO-8859-1");
}
nsCOMPtr<nsICharsetConverterManager> charsetConv =

View File

@ -250,7 +250,7 @@ nsStyleLinkElement::UpdateStyleSheet(nsIDocument *aOldDocument,
GetStyleSheetInfo(title, type, media, &isAlternate);
if (!type.EqualsIgnoreCase("text/css")) {
if (!type.LowerCaseEqualsLiteral("text/css")) {
return NS_OK;
}

View File

@ -168,7 +168,7 @@ nsTextNode::Tag() const
NS_IMETHODIMP
nsTextNode::GetNodeName(nsAString& aNodeName)
{
aNodeName.Assign(NS_LITERAL_STRING("#text"));
aNodeName.AssignLiteral("#text");
return NS_OK;
}

View File

@ -378,7 +378,7 @@ nsXMLContentSerializer::ConfirmPrefix(nsAString& aPrefix,
}
// If we don't have a prefix, create one
else if (aPrefix.IsEmpty()) {
aPrefix.Assign(NS_LITERAL_STRING("a"));
aPrefix.AssignLiteral("a");
char buf[128];
PR_snprintf(buf, sizeof(buf), "%d", mPrefixIndex++);
AppendASCIItoUTF16(buf, aPrefix);
@ -865,7 +865,7 @@ nsXMLContentSerializer::AppendDocumentStart(nsIDOMDocument *aDocument,
aStr += NS_LITERAL_STRING(" standalone=\"") + standalone + endQuote;
}
aStr += NS_LITERAL_STRING("?>");
aStr.AppendLiteral("?>");
mAddNewline = PR_TRUE;
return NS_OK;

View File

@ -1569,25 +1569,25 @@ nsDOMEvent::AllocateEvent(const nsAString& aEventType)
{
//Allocate internal event
nsAutoString eventType(aEventType);
if (eventType.EqualsIgnoreCase("MouseEvents")) {
if (eventType.LowerCaseEqualsLiteral("mouseevents")) {
mEvent = new nsMouseEvent();
}
else if (eventType.EqualsIgnoreCase("MouseScrollEvents")) {
else if (eventType.LowerCaseEqualsLiteral("mousescrollevents")) {
mEvent = new nsMouseScrollEvent();
}
else if (eventType.EqualsIgnoreCase("KeyEvents")) {
else if (eventType.LowerCaseEqualsLiteral("keyevents")) {
mEvent = new nsKeyEvent();
}
else if (eventType.EqualsIgnoreCase("MutationEvents")) {
else if (eventType.LowerCaseEqualsLiteral("mutationevents")) {
mEvent = new nsMutationEvent();
}
else if (eventType.EqualsIgnoreCase("PopupEvents")) {
else if (eventType.LowerCaseEqualsLiteral("popupevents")) {
mEvent = new nsGUIEvent();
}
else if (eventType.EqualsIgnoreCase("PopupBlockedEvents")) {
else if (eventType.LowerCaseEqualsLiteral("popupblockedevents")) {
mEvent = new nsPopupBlockedEvent();
}
else if (eventType.EqualsIgnoreCase("UIEvents")) {
else if (eventType.LowerCaseEqualsLiteral("uievents")) {
mEvent = new nsDOMUIEvent();
}
else {

View File

@ -1606,19 +1606,19 @@ nsEventListenerManager::CreateEvent(nsIPresContext* aPresContext,
*aDOMEvent = nsnull;
nsAutoString str(aEventType);
if (!aEvent && !str.EqualsIgnoreCase("MouseEvents") &&
!str.EqualsIgnoreCase("KeyEvents") &&
!str.EqualsIgnoreCase("HTMLEvents") &&
!str.EqualsIgnoreCase("MutationEvents") &&
!str.EqualsIgnoreCase("MouseScrollEvents") &&
!str.EqualsIgnoreCase("PopupBlockedEvents") &&
!str.EqualsIgnoreCase("UIEvents") &&
!str.EqualsIgnoreCase("Events")) {
if (!aEvent && !str.LowerCaseEqualsLiteral("mouseevents") &&
!str.LowerCaseEqualsLiteral("keyevents") &&
!str.LowerCaseEqualsLiteral("htmlevents") &&
!str.LowerCaseEqualsLiteral("mutationevents") &&
!str.LowerCaseEqualsLiteral("mousescrollevents") &&
!str.LowerCaseEqualsLiteral("popupblockedevents") &&
!str.LowerCaseEqualsLiteral("uievents") &&
!str.LowerCaseEqualsLiteral("events")) {
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
if ((aEvent && aEvent->eventStructType == NS_MUTATION_EVENT) ||
(!aEvent && str.EqualsIgnoreCase("MutationEvents")))
(!aEvent && str.LowerCaseEqualsLiteral("mutationevents")))
return NS_NewDOMMutationEvent(aDOMEvent, aPresContext, aEvent);
return NS_NewDOMUIEvent(aDOMEvent, aPresContext, aEventType, aEvent);
}

View File

@ -447,7 +447,7 @@ HandleMailtoSubject(nsCString& aPath) {
aPath.Append('?');
}
aPath += NS_LITERAL_CSTRING("subject=Form%20Post%20From%20Mozilla&");
aPath.AppendLiteral("subject=Form%20Post%20From%20Mozilla&");
}
}
@ -809,7 +809,7 @@ nsFSMultipartFormData::AddNameFilePair(nsIDOMHTMLElement* aSource,
//
// CRLF after file
//
mPostDataChunk += NS_LITERAL_CSTRING(CRLF);
mPostDataChunk.AppendLiteral(CRLF);
return NS_OK;
}
@ -835,7 +835,7 @@ nsFSMultipartFormData::Init()
//
// Build boundary
//
mBoundary = NS_LITERAL_CSTRING("---------------------------");
mBoundary.AssignLiteral("---------------------------");
mBoundary.AppendInt(rand());
mBoundary.AppendInt(rand());
mBoundary.AppendInt(rand());
@ -1258,7 +1258,7 @@ nsFormSubmission::GetSubmitCharset(nsIHTMLContent* aForm,
PRUint8 aCtrlsModAtSubmit,
nsACString& oCharset)
{
oCharset = NS_LITERAL_CSTRING("UTF-8"); // default to utf-8
oCharset.AssignLiteral("UTF-8"); // default to utf-8
nsresult rv = NS_OK;
nsAutoString acceptCharsetValue;
@ -1304,22 +1304,22 @@ nsFormSubmission::GetSubmitCharset(nsIHTMLContent* aForm,
&& oCharset.Equals(NS_LITERAL_CSTRING("windows-1256"),
nsCaseInsensitiveCStringComparator())) {
//Mohamed
oCharset = NS_LITERAL_CSTRING("IBM864");
oCharset.AssignLiteral("IBM864");
}
else if (aCtrlsModAtSubmit==IBMBIDI_CONTROLSTEXTMODE_LOGICAL
&& oCharset.Equals(NS_LITERAL_CSTRING("IBM864"),
nsCaseInsensitiveCStringComparator())) {
oCharset = NS_LITERAL_CSTRING("IBM864i");
oCharset.AssignLiteral("IBM864i");
}
else if (aCtrlsModAtSubmit==IBMBIDI_CONTROLSTEXTMODE_VISUAL
&& oCharset.Equals(NS_LITERAL_CSTRING("ISO-8859-6"),
nsCaseInsensitiveCStringComparator())) {
oCharset = NS_LITERAL_CSTRING("IBM864");
oCharset.AssignLiteral("IBM864");
}
else if (aCtrlsModAtSubmit==IBMBIDI_CONTROLSTEXTMODE_VISUAL
&& oCharset.Equals(NS_LITERAL_CSTRING("UTF-8"),
nsCaseInsensitiveCStringComparator())) {
oCharset = NS_LITERAL_CSTRING("IBM864");
oCharset.AssignLiteral("IBM864");
}
}
@ -1337,7 +1337,7 @@ nsFormSubmission::GetEncoder(nsIHTMLContent* aForm,
nsCAutoString charset(aCharset);
if(charset.EqualsLiteral("ISO-8859-1"))
charset.Assign(NS_LITERAL_CSTRING("windows-1252"));
charset.AssignLiteral("windows-1252");
rv = CallCreateInstance( NS_SAVEASCHARSET_CONTRACTID, aEncoder);
NS_ASSERTION(NS_SUCCEEDED(rv), "create nsISaveAsCharset failed");

View File

@ -2040,13 +2040,13 @@ nsGenericHTMLElement::ListAttributes(FILE* out) const
// value
nsAutoString value;
GetAttr(nameSpaceID, attr, value);
buffer.Append(NS_LITERAL_STRING("=\""));
buffer.AppendLiteral("=\"");
for (int i = value.Length(); i >= 0; --i) {
if (value[i] == PRUnichar('"'))
value.Insert(PRUnichar('\\'), PRUint32(i));
}
buffer.Append(value);
buffer.Append(NS_LITERAL_STRING("\""));
buffer.AppendLiteral("\"");
fputs(" ", out);
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
@ -3708,7 +3708,7 @@ nsGenericHTMLElement::SetHostInHrefString(const nsAString &aHref,
uri->GetPath(path);
CopyASCIItoUTF16(scheme, aResult);
aResult.Append(NS_LITERAL_STRING("://"));
aResult.AppendLiteral("://");
if (!userpass.IsEmpty()) {
AppendUTF8toUTF16(userpass, aResult);
aResult.Append(PRUnichar('@'));
@ -3832,7 +3832,7 @@ nsGenericHTMLElement::GetProtocolFromHrefString(const nsAString& aHref,
if (protocol.IsEmpty()) {
// set the protocol to http since it is the most likely protocol
// to be used.
aProtocol.Assign(NS_LITERAL_STRING("http"));
aProtocol.AssignLiteral("http");
} else {
CopyASCIItoUTF16(protocol, aProtocol);
}

View File

@ -281,7 +281,7 @@ protected:
GetAttr(kNameSpaceID_None, nsHTMLAtoms::type, tmp);
return tmp.EqualsIgnoreCase("image");
return tmp.LowerCaseEqualsLiteral("image");
}
/**
@ -630,7 +630,7 @@ nsHTMLInputElement::GetValue(nsAString& aValue)
if (rv == NS_CONTENT_ATTR_NOT_THERE &&
(mType == NS_FORM_INPUT_RADIO || mType == NS_FORM_INPUT_CHECKBOX)) {
// The default value of a radio or checkbox input is "on".
aValue.Assign(NS_LITERAL_STRING("on"));
aValue.AssignLiteral("on");
return NS_OK;
}
@ -2226,7 +2226,7 @@ nsHTMLInputElement::SubmitNamesValues(nsIFormSubmission* aFormSubmission,
nsCAutoString contentType;
rv = MIMEService->GetTypeFromFile(file, contentType);
if (NS_FAILED(rv)) {
contentType = NS_LITERAL_CSTRING("application/octet-stream");
contentType.AssignLiteral("application/octet-stream");
}
//

View File

@ -227,7 +227,7 @@ nsHTMLLinkElement::CreateAndDispatchEvent(nsIDocument* aDoc,
// doing the "right" thing costs virtually nothing here, even if it doesn't
// make much sense.
if (aRev.IsEmpty() &&
(aRel.IsEmpty() || aRel.EqualsIgnoreCase("stylesheet")))
(aRel.IsEmpty() || aRel.LowerCaseEqualsLiteral("stylesheet")))
return;
nsCOMPtr<nsIDOMDocumentEvent> docEvent(do_QueryInterface(aDoc));
@ -355,13 +355,13 @@ nsHTMLLinkElement::GetStyleSheetInfo(nsAString& aTitle,
nsAutoString notUsed;
GetAttr(kNameSpaceID_None, nsHTMLAtoms::type, aType);
nsParserUtils::SplitMimeType(aType, mimeType, notUsed);
if (!mimeType.IsEmpty() && !mimeType.EqualsIgnoreCase("text/css")) {
if (!mimeType.IsEmpty() && !mimeType.LowerCaseEqualsLiteral("text/css")) {
return;
}
// If we get here we assume that we're loading a css file, so set the
// type to 'text/css'
aType.Assign(NS_LITERAL_STRING("text/css"));
aType.AssignLiteral("text/css");
return;
}

View File

@ -1015,10 +1015,10 @@ nsHTMLSelectElement::GetType(nsAString& aType)
PRBool isMultiple;
GetMultiple(&isMultiple);
if (isMultiple) {
aType.Assign(NS_LITERAL_STRING("select-multiple"));
aType.AssignLiteral("select-multiple");
}
else {
aType.Assign(NS_LITERAL_STRING("select-one"));
aType.AssignLiteral("select-one");
}
return NS_OK;

View File

@ -376,10 +376,10 @@ SpacerMapAttributesIntoRule(const nsMappedAttributes* aAttributes,
const nsAttrValue* value = aAttributes->GetAttr(nsHTMLAtoms::type);
if (value && value->Type() == nsAttrValue::eString) {
nsAutoString tmp(value->GetStringValue());
if (tmp.EqualsIgnoreCase("line") ||
tmp.EqualsIgnoreCase("vert") ||
tmp.EqualsIgnoreCase("vertical") ||
tmp.EqualsIgnoreCase("block")) {
if (tmp.LowerCaseEqualsLiteral("line") ||
tmp.LowerCaseEqualsLiteral("vert") ||
tmp.LowerCaseEqualsLiteral("vertical") ||
tmp.LowerCaseEqualsLiteral("block")) {
// This is not strictly 100% compatible: if the spacer is given
// a width of zero then it is basically ignored.
aData->mDisplayData->mDisplay = NS_STYLE_DISPLAY_BLOCK;

View File

@ -312,13 +312,13 @@ nsHTMLStyleElement::GetStyleSheetInfo(nsAString& aTitle,
nsAutoString mimeType;
nsAutoString notUsed;
nsParserUtils::SplitMimeType(aType, mimeType, notUsed);
if (!mimeType.IsEmpty() && !mimeType.EqualsIgnoreCase("text/css")) {
if (!mimeType.IsEmpty() && !mimeType.LowerCaseEqualsLiteral("text/css")) {
return;
}
// If we get here we assume that we're loading a css file, so set the
// type to 'text/css'
aType.Assign(NS_LITERAL_STRING("text/css"));
aType.AssignLiteral("text/css");
return;
}

View File

@ -349,7 +349,7 @@ NS_IMPL_INT_ATTR(nsHTMLTextAreaElement, TabIndex, tabindex)
NS_IMETHODIMP
nsHTMLTextAreaElement::GetType(nsAString& aType)
{
aType.Assign(NS_LITERAL_STRING("textarea"));
aType.AssignLiteral("textarea");
return NS_OK;
}

View File

@ -470,7 +470,7 @@ public:
// nsIRequest
NS_IMETHOD GetName(nsACString &result)
{
result = NS_LITERAL_CSTRING("about:layout-dummy-request");
result.AssignLiteral("about:layout-dummy-request");
return NS_OK;
}
@ -3486,7 +3486,7 @@ HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
}
if (name.IsEmpty()) {
name.Assign(NS_LITERAL_STRING("HTML"));
name.AssignLiteral("HTML");
}
rv = domImpl->CreateDocumentType(name, publicId, systemId,

View File

@ -590,7 +590,7 @@ nsHTMLDocument::UseWeakDocTypeDefault(PRInt32& aCharsetSource,
if (kCharsetFromWeakDocTypeDefault <= aCharsetSource)
return PR_TRUE;
// fallback value in case docshell return error
aCharset = NS_LITERAL_CSTRING("ISO-8859-1");
aCharset.AssignLiteral("ISO-8859-1");
const nsAdoptingString& defCharset =
nsContentUtils::GetLocalizedStringPref("intl.charset.default");
@ -796,7 +796,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
if (IsXHTML()) {
charsetSource = kCharsetFromDocTypeDefault;
charset = NS_LITERAL_CSTRING("UTF-8");
charset.AssignLiteral("UTF-8");
TryChannelCharset(aChannel, charsetSource, charset);
} else {
charsetSource = kCharsetUninitialized;
@ -858,8 +858,8 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
// ahmed
// Check if 864 but in Implicit mode !
if ((mTexttype == IBMBIDI_TEXTTYPE_LOGICAL) &&
(charset.EqualsIgnoreCase("ibm864"))) {
charset = NS_LITERAL_CSTRING("IBM864i");
(charset.LowerCaseEqualsLiteral("ibm864"))) {
charset.AssignLiteral("IBM864i");
}
}
@ -1648,7 +1648,7 @@ nsHTMLDocument::SetDomain(const nsAString& aDomain)
nsCAutoString path;
if (NS_FAILED(uri->GetPath(path)))
return NS_ERROR_FAILURE;
newURIString.Append(NS_LITERAL_CSTRING("://"));
newURIString.AppendLiteral("://");
AppendUTF16toUTF8(aDomain, newURIString);
newURIString.Append(path);
@ -2929,9 +2929,9 @@ nsHTMLDocument::GetCompatMode(nsAString& aCompatMode)
"mCompatMode is neither quirks nor strict for this document");
if (mCompatMode == eCompatibility_NavQuirks) {
aCompatMode.Assign(NS_LITERAL_STRING("BackCompat"));
aCompatMode.AssignLiteral("BackCompat");
} else {
aCompatMode.Assign(NS_LITERAL_STRING("CSS1Compat"));
aCompatMode.AssignLiteral("CSS1Compat");
}
return NS_OK;
@ -3563,10 +3563,10 @@ NS_IMETHODIMP
nsHTMLDocument::GetDesignMode(nsAString & aDesignMode)
{
if (mEditingIsOn) {
aDesignMode.Assign(NS_LITERAL_STRING("on"));
aDesignMode.AssignLiteral("on");
}
else {
aDesignMode.Assign(NS_LITERAL_STRING("off"));
aDesignMode.AssignLiteral("off");
}
return NS_OK;
}
@ -3600,8 +3600,7 @@ nsHTMLDocument::SetDesignMode(const nsAString & aDesignMode)
if (!editSession)
return NS_ERROR_FAILURE;
if (aDesignMode.Equals(NS_LITERAL_STRING("on"),
nsCaseInsensitiveStringComparator())) {
if (aDesignMode.LowerCaseEqualsLiteral("on")) {
// go through hoops to get dom window (see nsHTMLDocument::GetSelection)
nsCOMPtr<nsIPresShell> shell = (nsIPresShell*)mPresShells.SafeElementAt(0);
NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE);
@ -3889,13 +3888,13 @@ nsHTMLDocument::ExecCommand(const nsAString & commandID,
nsresult rv = NS_OK;
if (commandID.Equals(NS_LITERAL_STRING("gethtml"), nsCaseInsensitiveStringComparator()))
if (commandID.LowerCaseEqualsLiteral("gethtml"))
return NS_ERROR_FAILURE;
if (commandID.Equals(NS_LITERAL_STRING("cut"), nsCaseInsensitiveStringComparator()) ||
(commandID.Equals(NS_LITERAL_STRING("copy"), nsCaseInsensitiveStringComparator()))) {
if (commandID.LowerCaseEqualsLiteral("cut") ||
(commandID.LowerCaseEqualsLiteral("copy"))) {
rv = DoClipboardSecurityCheck(PR_FALSE);
} else if (commandID.Equals(NS_LITERAL_STRING("paste"), nsCaseInsensitiveStringComparator())) {
} else if (commandID.LowerCaseEqualsLiteral("paste")) {
rv = DoClipboardSecurityCheck(PR_TRUE);
}

View File

@ -251,7 +251,7 @@ nsWyciwygChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
NS_IMETHODIMP
nsWyciwygChannel::GetContentType(nsACString &aContentType)
{
aContentType = NS_LITERAL_CSTRING(wyciwyg_TYPE);
aContentType.AssignLiteral(wyciwyg_TYPE);
return NS_OK;
}

View File

@ -202,7 +202,7 @@ PRBool nsCSSDeclaration::AppendValueToString(nsCSSProperty aProperty, nsAString&
"Top inherit or initial, left isn't. Fix the parser!");
AppendCSSValueToString(aProperty, rect->mTop, aResult);
} else {
aResult.Append(NS_LITERAL_STRING("rect("));
aResult.AppendLiteral("rect(");
AppendCSSValueToString(aProperty, rect->mTop, aResult);
NS_NAMED_LITERAL_STRING(comma, ", ");
aResult.Append(comma);
@ -269,7 +269,7 @@ PRBool nsCSSDeclaration::AppendValueToString(nsCSSProperty aProperty, nsAString&
}
if (AppendCSSValueToString(aProperty, shadow->mRadius, aResult) &&
shadow->mNext)
aResult.Append(NS_LITERAL_STRING(", "));
aResult.AppendLiteral(", ");
shadow = shadow->mNext;
}
}
@ -292,11 +292,11 @@ PRBool nsCSSDeclaration::AppendCSSValueToString(nsCSSProperty aProperty, const n
if ((eCSSUnit_String <= unit) && (unit <= eCSSUnit_Counters)) {
switch (unit) {
case eCSSUnit_Attr: aResult.Append(NS_LITERAL_STRING("attr("));
case eCSSUnit_Attr: aResult.AppendLiteral("attr(");
break;
case eCSSUnit_Counter: aResult.Append(NS_LITERAL_STRING("counter("));
case eCSSUnit_Counter: aResult.AppendLiteral("counter(");
break;
case eCSSUnit_Counters: aResult.Append(NS_LITERAL_STRING("counters("));
case eCSSUnit_Counters: aResult.AppendLiteral("counters(");
break;
default: break;
}
@ -397,7 +397,7 @@ PRBool nsCSSDeclaration::AppendCSSValueToString(nsCSSProperty aProperty, const n
nsAutoString tmpStr;
nscolor color = aValue.GetColorValue();
aResult.Append(NS_LITERAL_STRING("rgb("));
aResult.AppendLiteral("rgb(");
NS_NAMED_LITERAL_STRING(comma, ", ");
@ -432,11 +432,11 @@ PRBool nsCSSDeclaration::AppendCSSValueToString(nsCSSProperty aProperty, const n
switch (unit) {
case eCSSUnit_Null: break;
case eCSSUnit_Auto: aResult.Append(NS_LITERAL_STRING("auto")); break;
case eCSSUnit_Inherit: aResult.Append(NS_LITERAL_STRING("inherit")); break;
case eCSSUnit_Initial: aResult.Append(NS_LITERAL_STRING("initial")); break;
case eCSSUnit_None: aResult.Append(NS_LITERAL_STRING("none")); break;
case eCSSUnit_Normal: aResult.Append(NS_LITERAL_STRING("normal")); break;
case eCSSUnit_Auto: aResult.AppendLiteral("auto"); break;
case eCSSUnit_Inherit: aResult.AppendLiteral("inherit"); break;
case eCSSUnit_Initial: aResult.AppendLiteral("initial"); break;
case eCSSUnit_None: aResult.AppendLiteral("none"); break;
case eCSSUnit_Normal: aResult.AppendLiteral("normal"); break;
case eCSSUnit_String: break;
case eCSSUnit_URL: break;
@ -450,37 +450,37 @@ PRBool nsCSSDeclaration::AppendCSSValueToString(nsCSSProperty aProperty, const n
case eCSSUnit_Percent: aResult.Append(PRUnichar('%')); break;
case eCSSUnit_Number: break;
case eCSSUnit_Inch: aResult.Append(NS_LITERAL_STRING("in")); break;
case eCSSUnit_Foot: aResult.Append(NS_LITERAL_STRING("ft")); break;
case eCSSUnit_Mile: aResult.Append(NS_LITERAL_STRING("mi")); break;
case eCSSUnit_Millimeter: aResult.Append(NS_LITERAL_STRING("mm")); break;
case eCSSUnit_Centimeter: aResult.Append(NS_LITERAL_STRING("cm")); break;
case eCSSUnit_Meter: aResult.Append(NS_LITERAL_STRING("m")); break;
case eCSSUnit_Kilometer: aResult.Append(NS_LITERAL_STRING("km")); break;
case eCSSUnit_Point: aResult.Append(NS_LITERAL_STRING("pt")); break;
case eCSSUnit_Pica: aResult.Append(NS_LITERAL_STRING("pc")); break;
case eCSSUnit_Didot: aResult.Append(NS_LITERAL_STRING("dt")); break;
case eCSSUnit_Cicero: aResult.Append(NS_LITERAL_STRING("cc")); break;
case eCSSUnit_Inch: aResult.AppendLiteral("in"); break;
case eCSSUnit_Foot: aResult.AppendLiteral("ft"); break;
case eCSSUnit_Mile: aResult.AppendLiteral("mi"); break;
case eCSSUnit_Millimeter: aResult.AppendLiteral("mm"); break;
case eCSSUnit_Centimeter: aResult.AppendLiteral("cm"); break;
case eCSSUnit_Meter: aResult.AppendLiteral("m"); break;
case eCSSUnit_Kilometer: aResult.AppendLiteral("km"); break;
case eCSSUnit_Point: aResult.AppendLiteral("pt"); break;
case eCSSUnit_Pica: aResult.AppendLiteral("pc"); break;
case eCSSUnit_Didot: aResult.AppendLiteral("dt"); break;
case eCSSUnit_Cicero: aResult.AppendLiteral("cc"); break;
case eCSSUnit_EM: aResult.Append(NS_LITERAL_STRING("em")); break;
case eCSSUnit_EN: aResult.Append(NS_LITERAL_STRING("en")); break;
case eCSSUnit_XHeight: aResult.Append(NS_LITERAL_STRING("ex")); break;
case eCSSUnit_CapHeight: aResult.Append(NS_LITERAL_STRING("cap")); break;
case eCSSUnit_Char: aResult.Append(NS_LITERAL_STRING("ch")); break;
case eCSSUnit_EM: aResult.AppendLiteral("em"); break;
case eCSSUnit_EN: aResult.AppendLiteral("en"); break;
case eCSSUnit_XHeight: aResult.AppendLiteral("ex"); break;
case eCSSUnit_CapHeight: aResult.AppendLiteral("cap"); break;
case eCSSUnit_Char: aResult.AppendLiteral("ch"); break;
case eCSSUnit_Pixel: aResult.Append(NS_LITERAL_STRING("px")); break;
case eCSSUnit_Pixel: aResult.AppendLiteral("px"); break;
case eCSSUnit_Proportional: aResult.Append(NS_LITERAL_STRING("*")); break;
case eCSSUnit_Proportional: aResult.AppendLiteral("*"); break;
case eCSSUnit_Degree: aResult.Append(NS_LITERAL_STRING("deg")); break;
case eCSSUnit_Grad: aResult.Append(NS_LITERAL_STRING("grad")); break;
case eCSSUnit_Radian: aResult.Append(NS_LITERAL_STRING("rad")); break;
case eCSSUnit_Degree: aResult.AppendLiteral("deg"); break;
case eCSSUnit_Grad: aResult.AppendLiteral("grad"); break;
case eCSSUnit_Radian: aResult.AppendLiteral("rad"); break;
case eCSSUnit_Hertz: aResult.Append(NS_LITERAL_STRING("Hz")); break;
case eCSSUnit_Kilohertz: aResult.Append(NS_LITERAL_STRING("kHz")); break;
case eCSSUnit_Hertz: aResult.AppendLiteral("Hz"); break;
case eCSSUnit_Kilohertz: aResult.AppendLiteral("kHz"); break;
case eCSSUnit_Seconds: aResult.Append(PRUnichar('s')); break;
case eCSSUnit_Milliseconds: aResult.Append(NS_LITERAL_STRING("ms")); break;
case eCSSUnit_Milliseconds: aResult.AppendLiteral("ms"); break;
}
return PR_TRUE;
@ -736,7 +736,7 @@ void
nsCSSDeclaration::AppendImportanceToString(PRBool aIsImportant, nsAString& aString) const
{
if (aIsImportant) {
aString.Append(NS_LITERAL_STRING(" ! important"));
aString.AppendLiteral(" ! important");
}
}
@ -748,11 +748,11 @@ nsCSSDeclaration::AppendPropertyAndValueToString(nsCSSProperty aProperty,
NS_ASSERTION(0 <= aProperty && aProperty < eCSSProperty_COUNT_no_shorthands,
"property enum out of range");
AppendASCIItoUTF16(nsCSSProps::GetStringValue(aPropertyName), aResult);
aResult.Append(NS_LITERAL_STRING(": "));
aResult.AppendLiteral(": ");
AppendValueToString(aProperty, aResult);
PRBool isImportant = GetValueIsImportant(aProperty);
AppendImportanceToString(isImportant, aResult);
aResult.Append(NS_LITERAL_STRING("; "));
aResult.AppendLiteral("; ");
}
PRBool
@ -804,7 +804,7 @@ nsCSSDeclaration::TryBorderShorthand(nsAString & aString, PRUint32 aPropertiesSe
}
if (border) {
AppendASCIItoUTF16(nsCSSProps::GetStringValue(eCSSProperty_border), aString);
aString.Append(NS_LITERAL_STRING(": "));
aString.AppendLiteral(": ");
AppendValueToString(eCSSProperty_border_top_width, aString);
aString.Append(PRUnichar(' '));
@ -822,7 +822,7 @@ nsCSSDeclaration::TryBorderShorthand(nsAString & aString, PRUint32 aPropertiesSe
aString.Append(valueString);
}
AppendImportanceToString(isImportant, aString);
aString.Append(NS_LITERAL_STRING("; "));
aString.AppendLiteral("; ");
}
return border;
}
@ -839,7 +839,7 @@ nsCSSDeclaration::TryBorderSideShorthand(nsAString & aString,
0, 0, 0,
isImportant)) {
AppendASCIItoUTF16(nsCSSProps::GetStringValue(aShorthand), aString);
aString.Append(NS_LITERAL_STRING(": "));
aString.AppendLiteral(": ");
AppendValueToString(OrderValueAt(aBorderWidth-1), aString);
@ -849,11 +849,11 @@ nsCSSDeclaration::TryBorderSideShorthand(nsAString & aString,
nsAutoString valueString;
AppendValueToString(OrderValueAt(aBorderColor-1), valueString);
if (!valueString.EqualsLiteral("-moz-use-text-color")) {
aString.Append(NS_LITERAL_STRING(" "));
aString.AppendLiteral(" ");
aString.Append(valueString);
}
AppendImportanceToString(isImportant, aString);
aString.Append(NS_LITERAL_STRING("; "));
aString.AppendLiteral("; ");
return PR_TRUE;
}
return PR_FALSE;
@ -876,7 +876,7 @@ nsCSSDeclaration::TryFourSidesShorthand(nsAString & aString,
isImportant)) {
// all 4 properties are set, we can output a shorthand
AppendASCIItoUTF16(nsCSSProps::GetStringValue(aShorthand), aString);
aString.Append(NS_LITERAL_STRING(": "));
aString.AppendLiteral(": ");
nsCSSValue topValue, bottomValue, leftValue, rightValue;
nsCSSProperty topProp = OrderValueAt(aTop-1);
nsCSSProperty bottomProp = OrderValueAt(aBottom-1);
@ -903,7 +903,7 @@ nsCSSDeclaration::TryFourSidesShorthand(nsAString & aString,
aTop = 0; aBottom = 0; aLeft = 0; aRight = 0;
}
AppendImportanceToString(isImportant, aString);
aString.Append(NS_LITERAL_STRING("; "));
aString.AppendLiteral("; ");
return PR_TRUE;
}
return PR_FALSE;
@ -926,7 +926,7 @@ nsCSSDeclaration::TryBackgroundShorthand(nsAString & aString,
AllPropertiesSameImportance(aBgColor, aBgImage, aBgRepeat, aBgAttachment,
aBgPositionX, aBgPositionY, isImportant)) {
AppendASCIItoUTF16(nsCSSProps::GetStringValue(eCSSProperty_background), aString);
aString.Append(NS_LITERAL_STRING(": "));
aString.AppendLiteral(": ");
AppendValueToString(eCSSProperty_background_color, aString);
aBgColor = 0;
@ -946,7 +946,7 @@ nsCSSDeclaration::TryBackgroundShorthand(nsAString & aString,
aString.Append(PRUnichar(' '));
UseBackgroundPosition(aString, aBgPositionX, aBgPositionY);
AppendImportanceToString(isImportant, aString);
aString.Append(NS_LITERAL_STRING("; "));
aString.AppendLiteral("; ");
}
}
@ -1198,10 +1198,10 @@ nsCSSDeclaration::ToString(nsAString& aString) const
AllPropertiesSameImportance(bgPositionX, bgPositionY,
0, 0, 0, 0, isImportant)) {
AppendASCIItoUTF16(nsCSSProps::GetStringValue(eCSSProperty_background_position), aString);
aString.Append(NS_LITERAL_STRING(": "));
aString.AppendLiteral(": ");
UseBackgroundPosition(aString, bgPositionX, bgPositionY);
AppendImportanceToString(isImportant, aString);
aString.Append(NS_LITERAL_STRING("; "));
aString.AppendLiteral("; ");
}
else if (eCSSProperty_background_x_position == property && bgPositionX) {
AppendPropertyAndValueToString(eCSSProperty_background_x_position, aString);

View File

@ -652,7 +652,7 @@ SheetLoadData::OnDetermineCharset(nsIUnicharStreamLoader* aLoader,
#ifdef PR_LOGGING
LOG_WARN((" Falling back to ISO-8859-1"));
#endif
aCharset = NS_LITERAL_CSTRING("ISO-8859-1");
aCharset.AssignLiteral("ISO-8859-1");
}
mCharset = aCharset;

View File

@ -405,9 +405,9 @@ static void ReportUnexpectedToken(nsCSSScanner *sc,
// Flatten the string so we don't append to a concatenation, since
// that goes into an infinite loop. See bug 70083.
nsAutoString error(err);
error += NS_LITERAL_STRING(" '");
error.AppendLiteral(" '");
tok.AppendToString(error);
error += NS_LITERAL_STRING("'.");
error.AppendLiteral("'.");
sc->AddToError(error);
}
@ -953,39 +953,39 @@ PRBool CSSParserImpl::ParseAtRule(nsresult& aErrorCode, RuleAppendFunc aAppendFu
void* aData)
{
if ((mSection <= eCSSSection_Charset) &&
(mToken.mIdent.EqualsIgnoreCase("charset"))) {
(mToken.mIdent.LowerCaseEqualsLiteral("charset"))) {
if (ParseCharsetRule(aErrorCode, aAppendFunc, aData)) {
mSection = eCSSSection_Import; // only one charset allowed
return PR_TRUE;
}
}
if ((mSection <= eCSSSection_Import) &&
mToken.mIdent.EqualsIgnoreCase("import")) {
mToken.mIdent.LowerCaseEqualsLiteral("import")) {
if (ParseImportRule(aErrorCode, aAppendFunc, aData)) {
mSection = eCSSSection_Import;
return PR_TRUE;
}
}
if ((mSection <= eCSSSection_NameSpace) &&
mToken.mIdent.EqualsIgnoreCase("namespace")) {
mToken.mIdent.LowerCaseEqualsLiteral("namespace")) {
if (ParseNameSpaceRule(aErrorCode, aAppendFunc, aData)) {
mSection = eCSSSection_NameSpace;
return PR_TRUE;
}
}
if (mToken.mIdent.EqualsIgnoreCase("media")) {
if (mToken.mIdent.LowerCaseEqualsLiteral("media")) {
if (ParseMediaRule(aErrorCode, aAppendFunc, aData)) {
mSection = eCSSSection_General;
return PR_TRUE;
}
}
if (mToken.mIdent.EqualsIgnoreCase("font-face")) {
if (mToken.mIdent.LowerCaseEqualsLiteral("font-face")) {
if (ParseFontFaceRule(aErrorCode, aAppendFunc, aData)) {
mSection = eCSSSection_General;
return PR_TRUE;
}
}
if (mToken.mIdent.EqualsIgnoreCase("page")) {
if (mToken.mIdent.LowerCaseEqualsLiteral("page")) {
if (ParsePageRule(aErrorCode, aAppendFunc, aData)) {
mSection = eCSSSection_General;
return PR_TRUE;
@ -1111,7 +1111,7 @@ PRBool CSSParserImpl::ParseImportRule(nsresult& aErrorCode, RuleAppendFunc aAppe
}
}
else if ((eCSSToken_Function == mToken.mType) &&
(mToken.mIdent.EqualsIgnoreCase("url"))) {
(mToken.mIdent.LowerCaseEqualsLiteral("url"))) {
if (ExpectSymbol(aErrorCode, '(', PR_FALSE)) {
if (GetURLToken(aErrorCode, PR_TRUE)) {
if ((eCSSToken_String == mToken.mType) || (eCSSToken_URL == mToken.mType)) {
@ -1258,7 +1258,7 @@ PRBool CSSParserImpl::ParseNameSpaceRule(nsresult& aErrorCode,
}
}
else if ((eCSSToken_Function == mToken.mType) &&
(mToken.mIdent.EqualsIgnoreCase("url"))) {
(mToken.mIdent.LowerCaseEqualsLiteral("url"))) {
if (ExpectSymbol(aErrorCode, '(', PR_FALSE)) {
if (GetURLToken(aErrorCode, PR_TRUE)) {
if ((eCSSToken_String == mToken.mType) || (eCSSToken_URL == mToken.mType)) {
@ -2547,7 +2547,7 @@ PRBool CSSParserImpl::ParseColor(nsresult& aErrorCode, nsCSSValue& aValue)
}
break;
case eCSSToken_Function:
if (mToken.mIdent.EqualsIgnoreCase("rgb")) {
if (mToken.mIdent.LowerCaseEqualsLiteral("rgb")) {
// rgb ( component , component , component )
PRUint8 r, g, b;
PRInt32 type = COLOR_TYPE_UNKNOWN;
@ -2560,7 +2560,7 @@ PRBool CSSParserImpl::ParseColor(nsresult& aErrorCode, nsCSSValue& aValue)
}
return PR_FALSE; // already pushed back
}
else if (mToken.mIdent.EqualsIgnoreCase("-moz-rgba")) {
else if (mToken.mIdent.LowerCaseEqualsLiteral("-moz-rgba")) {
// rgba ( component , component , component , opacity )
PRUint8 r, g, b, a;
PRInt32 type = COLOR_TYPE_UNKNOWN;
@ -2574,7 +2574,7 @@ PRBool CSSParserImpl::ParseColor(nsresult& aErrorCode, nsCSSValue& aValue)
}
return PR_FALSE; // already pushed back
}
else if (mToken.mIdent.EqualsIgnoreCase("hsl")) {
else if (mToken.mIdent.LowerCaseEqualsLiteral("hsl")) {
// hsl ( hue , saturation , lightness )
// "hue" is a number, "saturation" and "lightness" are percentages.
if (ParseHSLColor(aErrorCode, rgba, ')')) {
@ -2583,7 +2583,7 @@ PRBool CSSParserImpl::ParseColor(nsresult& aErrorCode, nsCSSValue& aValue)
}
return PR_FALSE;
}
else if (mToken.mIdent.EqualsIgnoreCase("-moz-hsla")) {
else if (mToken.mIdent.LowerCaseEqualsLiteral("-moz-hsla")) {
// hsla ( hue , saturation , lightness , opacity )
// "hue" is a number, "saturation" and "lightness" are percentages,
// "opacity" is a number.
@ -2958,7 +2958,7 @@ CSSParserImpl::ParseDeclaration(nsresult& aErrorCode,
return PR_FALSE;
}
if ((eCSSToken_Ident != tk->mType) ||
!tk->mIdent.EqualsIgnoreCase("important")) {
!tk->mIdent.LowerCaseEqualsLiteral("important")) {
REPORT_UNEXPECTED_TOKEN(
NS_LITERAL_STRING("Expected 'important' but found"));
OUTPUT_ERROR();
@ -3424,7 +3424,7 @@ PRBool CSSParserImpl::ParseVariant(nsresult& aErrorCode, nsCSSValue& aValue,
}
if (((aVariantMask & VARIANT_URL) != 0) &&
(eCSSToken_Function == tk->mType) &&
tk->mIdent.EqualsIgnoreCase("url")) {
tk->mIdent.LowerCaseEqualsLiteral("url")) {
if (ParseURL(aErrorCode, aValue)) {
return PR_TRUE;
}
@ -3435,10 +3435,10 @@ PRBool CSSParserImpl::ParseVariant(nsresult& aErrorCode, nsCSSValue& aValue,
(eCSSToken_ID == tk->mType) ||
(eCSSToken_Ident == tk->mType) ||
((eCSSToken_Function == tk->mType) &&
(tk->mIdent.EqualsIgnoreCase("rgb") ||
tk->mIdent.EqualsIgnoreCase("hsl") ||
tk->mIdent.EqualsIgnoreCase("-moz-rgba") ||
tk->mIdent.EqualsIgnoreCase("-moz-hsla")))) {
(tk->mIdent.LowerCaseEqualsLiteral("rgb") ||
tk->mIdent.LowerCaseEqualsLiteral("hsl") ||
tk->mIdent.LowerCaseEqualsLiteral("-moz-rgba") ||
tk->mIdent.LowerCaseEqualsLiteral("-moz-hsla")))) {
// Put token back so that parse color can get it
UngetToken();
if (ParseColor(aErrorCode, aValue)) {
@ -3463,8 +3463,8 @@ PRBool CSSParserImpl::ParseVariant(nsresult& aErrorCode, nsCSSValue& aValue,
}
if (((aVariantMask & VARIANT_COUNTER) != 0) &&
(eCSSToken_Function == tk->mType) &&
(tk->mIdent.EqualsIgnoreCase("counter") ||
tk->mIdent.EqualsIgnoreCase("counters"))) {
(tk->mIdent.LowerCaseEqualsLiteral("counter") ||
tk->mIdent.LowerCaseEqualsLiteral("counters"))) {
#ifdef ENABLE_COUNTERS
if (ParseCounter(aErrorCode, aValue)) {
return PR_TRUE;
@ -3474,7 +3474,7 @@ PRBool CSSParserImpl::ParseVariant(nsresult& aErrorCode, nsCSSValue& aValue,
}
if (((aVariantMask & VARIANT_ATTR) != 0) &&
(eCSSToken_Function == tk->mType) &&
tk->mIdent.EqualsIgnoreCase("attr")) {
tk->mIdent.LowerCaseEqualsLiteral("attr")) {
if (ParseAttr(aErrorCode, aValue)) {
return PR_TRUE;
@ -3489,7 +3489,7 @@ PRBool CSSParserImpl::ParseVariant(nsresult& aErrorCode, nsCSSValue& aValue,
PRBool CSSParserImpl::ParseCounter(nsresult& aErrorCode, nsCSSValue& aValue)
{
nsCSSUnit unit = (mToken.mIdent.EqualsIgnoreCase("counter") ?
nsCSSUnit unit = (mToken.mIdent.LowerCaseEqualsLiteral("counter") ?
eCSSUnit_Counter : eCSSUnit_Counters);
if (ExpectSymbol(aErrorCode, '(', PR_FALSE)) {
@ -4900,7 +4900,7 @@ CSSParserImpl::DoParseRect(nsCSSRect& aRect, nsresult& aErrorCode)
break;
}
} else if ((eCSSToken_Function == mToken.mType) &&
mToken.mIdent.EqualsIgnoreCase("rect")) {
mToken.mIdent.LowerCaseEqualsLiteral("rect")) {
if (!ExpectSymbol(aErrorCode, '(', PR_TRUE)) {
return PR_FALSE;
}
@ -4997,21 +4997,21 @@ PRBool CSSParserImpl::ParseCounterData(nsresult& aErrorCode,
if (nsnull == ident) {
return PR_FALSE;
}
if (ident->EqualsIgnoreCase("none")) {
if (ident->LowerCaseEqualsLiteral("none")) {
if (ExpectEndProperty(aErrorCode, PR_TRUE)) {
return SetSingleCounterValue(aResult, aErrorCode, aPropID,
nsCSSValue(eCSSUnit_None));
}
return PR_FALSE;
}
else if (ident->EqualsIgnoreCase("inherit")) {
else if (ident->LowerCaseEqualsLiteral("inherit")) {
if (ExpectEndProperty(aErrorCode, PR_TRUE)) {
return SetSingleCounterValue(aResult, aErrorCode, aPropID,
nsCSSValue(eCSSUnit_Inherit));
}
return PR_FALSE;
}
else if (ident->EqualsIgnoreCase("-moz-initial")) {
else if (ident->LowerCaseEqualsLiteral("-moz-initial")) {
if (ExpectEndProperty(aErrorCode, PR_TRUE)) {
return SetSingleCounterValue(aResult, aErrorCode, aPropID,
nsCSSValue(eCSSUnit_Initial));

View File

@ -302,9 +302,9 @@ CSSCharsetRuleImpl::GetType(PRUint16* aType)
NS_IMETHODIMP
CSSCharsetRuleImpl::GetCssText(nsAString& aCssText)
{
aCssText.Assign(NS_LITERAL_STRING("@charset \""));
aCssText.AssignLiteral("@charset \"");
aCssText.Append(mEncoding);
aCssText.Append(NS_LITERAL_STRING("\";"));
aCssText.AppendLiteral("\";");
return NS_OK;
}
@ -552,18 +552,18 @@ CSSImportRuleImpl::GetType(PRUint16* aType)
NS_IMETHODIMP
CSSImportRuleImpl::GetCssText(nsAString& aCssText)
{
aCssText.Assign(NS_LITERAL_STRING("@import url("));
aCssText.AssignLiteral("@import url(");
aCssText.Append(mURLSpec);
aCssText.Append(NS_LITERAL_STRING(")"));
if (mMedia) {
nsAutoString mediaText;
mMedia->GetText(mediaText);
if (!mediaText.IsEmpty()) {
aCssText.Append(NS_LITERAL_STRING(" "));
aCssText.AppendLiteral(" ");
aCssText.Append(mediaText);
}
}
aCssText.Append(NS_LITERAL_STRING(";"));
aCssText.AppendLiteral(";");
return NS_OK;
}
@ -996,7 +996,7 @@ CSSMediaRuleImpl::GetCssText(nsAString& aCssText)
{
PRUint32 index;
PRUint32 count;
aCssText.Assign(NS_LITERAL_STRING("@media "));
aCssText.AssignLiteral("@media ");
// get all the media
if (mMedia) {
mMedia->Count(&count);
@ -1005,14 +1005,14 @@ CSSMediaRuleImpl::GetCssText(nsAString& aCssText)
if (medium) {
nsAutoString tempString;
if (index > 0)
aCssText.Append(NS_LITERAL_STRING(", "));
aCssText.AppendLiteral(", ");
medium->ToString(tempString);
aCssText.Append(tempString);
}
}
}
aCssText.Append(NS_LITERAL_STRING(" {\n"));
aCssText.AppendLiteral(" {\n");
// get all the rules
if (mRules) {
@ -1032,7 +1032,7 @@ CSSMediaRuleImpl::GetCssText(nsAString& aCssText)
}
}
aCssText.Append(NS_LITERAL_STRING("}"));
aCssText.AppendLiteral("}");
return NS_OK;
}
@ -1301,14 +1301,14 @@ CSSNameSpaceRuleImpl::GetType(PRUint16* aType)
NS_IMETHODIMP
CSSNameSpaceRuleImpl::GetCssText(nsAString& aCssText)
{
aCssText.Assign(NS_LITERAL_STRING("@namespace "));
aCssText.AssignLiteral("@namespace ");
if (mPrefix) {
nsString atomStr;
mPrefix->ToString(atomStr);
aCssText.Append(atomStr);
aCssText.Append(NS_LITERAL_STRING(" "));
aCssText.AppendLiteral(" ");
}
aCssText.Append(NS_LITERAL_STRING("url("));
aCssText.AppendLiteral("url(");
aCssText.Append(mURLSpec);
aCssText.Append(NS_LITERAL_STRING(");"));
return NS_OK;

View File

@ -153,10 +153,10 @@ nsCSSToken::AppendToString(nsString& aBuffer)
aBuffer.Append(mIdent);
break;
case eCSSToken_Includes:
aBuffer.Append(NS_LITERAL_STRING("~="));
aBuffer.AppendLiteral("~=");
break;
case eCSSToken_Dashmatch:
aBuffer.Append(NS_LITERAL_STRING("|="));
aBuffer.AppendLiteral("|=");
break;
default:
@ -507,7 +507,7 @@ PRBool nsCSSScanner::Next(nsresult& aErrorCode, nsCSSToken& aToken)
if (LookAhead(aErrorCode, '-')) {
if (LookAhead(aErrorCode, '-')) {
aToken.mType = eCSSToken_HTMLComment;
aToken.mIdent.Assign(NS_LITERAL_STRING("<!--"));
aToken.mIdent.AssignLiteral("<!--");
return PR_TRUE;
}
Pushback('-');
@ -519,7 +519,7 @@ PRBool nsCSSScanner::Next(nsresult& aErrorCode, nsCSSToken& aToken)
if (LookAhead(aErrorCode, '-')) {
if (LookAhead(aErrorCode, '>')) {
aToken.mType = eCSSToken_HTMLComment;
aToken.mIdent.Assign(NS_LITERAL_STRING("-->"));
aToken.mIdent.AssignLiteral("-->");
return PR_TRUE;
}
Pushback('-');

View File

@ -341,7 +341,7 @@ void nsCSSRect::List(FILE* out, nsCSSProperty aPropID, PRInt32 aIndent) const
if (eCSSProperty_UNKNOWN < aPropID) {
buffer.AppendWithConversion(nsCSSProps::GetStringValue(aPropID).get());
buffer.Append(NS_LITERAL_STRING(": "));
buffer.AppendLiteral(": ");
}
mTop.AppendToString(buffer);
@ -359,22 +359,22 @@ void nsCSSRect::List(FILE* out, PRInt32 aIndent, const nsCSSProperty aTRBL[]) co
if (eCSSUnit_Null != mTop.GetUnit()) {
buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[0]).get());
buffer.Append(NS_LITERAL_STRING(": "));
buffer.AppendLiteral(": ");
mTop.AppendToString(buffer);
}
if (eCSSUnit_Null != mRight.GetUnit()) {
buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[1]).get());
buffer.Append(NS_LITERAL_STRING(": "));
buffer.AppendLiteral(": ");
mRight.AppendToString(buffer);
}
if (eCSSUnit_Null != mBottom.GetUnit()) {
buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[2]).get());
buffer.Append(NS_LITERAL_STRING(": "));
buffer.AppendLiteral(": ");
mBottom.AppendToString(buffer);
}
if (eCSSUnit_Null != mLeft.GetUnit()) {
buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[3]).get());
buffer.Append(NS_LITERAL_STRING(": "));
buffer.AppendLiteral(": ");
mLeft.AppendToString(buffer);
}
@ -427,7 +427,7 @@ void nsCSSValueListRect::List(FILE* out, nsCSSProperty aPropID, PRInt32 aIndent)
if (eCSSProperty_UNKNOWN < aPropID) {
buffer.AppendWithConversion(nsCSSProps::GetStringValue(aPropID).get());
buffer.Append(NS_LITERAL_STRING(": "));
buffer.AppendLiteral(": ");
}
mTop.AppendToString(buffer);
@ -447,22 +447,22 @@ void nsCSSValueListRect::List(FILE* out, PRInt32 aIndent, const nsCSSProperty aT
if (eCSSUnit_Null != mTop.GetUnit()) {
buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[0]).get());
buffer.Append(NS_LITERAL_STRING(": "));
buffer.AppendLiteral(": ");
mTop.AppendToString(buffer);
}
if (eCSSUnit_Null != mRight.GetUnit()) {
buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[1]).get());
buffer.Append(NS_LITERAL_STRING(": "));
buffer.AppendLiteral(": ");
mRight.AppendToString(buffer);
}
if (eCSSUnit_Null != mBottom.GetUnit()) {
buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[2]).get());
buffer.Append(NS_LITERAL_STRING(": "));
buffer.AppendLiteral(": ");
mBottom.AppendToString(buffer);
}
if (eCSSUnit_Null != mLeft.GetUnit()) {
buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[3]).get());
buffer.Append(NS_LITERAL_STRING(": "));
buffer.AppendLiteral(": ");
mLeft.AppendToString(buffer);
}

View File

@ -78,7 +78,7 @@
if (nsnull != ptr) { delete ptr; ptr = nsnull; }
#define NS_IF_NEGATED_START(bool,str) \
if (bool) { str.Append(NS_LITERAL_STRING(":not(")); }
if (bool) { str.AppendLiteral(":not("); }
#define NS_IF_NEGATED_END(bool,str) \
if (bool) { str.Append(PRUnichar(')')); }
@ -525,7 +525,7 @@ static PRBool IsPseudoElement(nsIAtom* aAtom)
void nsCSSSelector::AppendNegationToString(nsAString& aString)
{
aString.Append(NS_LITERAL_STRING(":not("));
aString.AppendLiteral(":not(");
}
//
@ -780,7 +780,7 @@ nsCSSSelectorList::ToString(nsAString& aResult, nsICSSStyleSheet* aSheet)
p = p->mNext;
if (!p)
break;
aResult.Append(NS_LITERAL_STRING(", "));
aResult.AppendLiteral(", ");
}
}
@ -1480,7 +1480,7 @@ CSSStyleRuleImpl::List(FILE* out, PRInt32 aIndent) const
if (mSelector)
mSelector->ToString(buffer, mSheet);
buffer.Append(NS_LITERAL_STRING(" "));
buffer.AppendLiteral(" ");
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
if (nsnull != mDeclaration) {
mDeclaration->List(out);

View File

@ -1108,7 +1108,7 @@ DOMMediaListImpl::GetText(nsAString& aMediaText)
medium->ToString(buffer);
aMediaText.Append(buffer);
if (index < count) {
aMediaText.Append(NS_LITERAL_STRING(", "));
aMediaText.AppendLiteral(", ");
}
}
@ -1782,7 +1782,7 @@ CSSStyleSheetImpl::SetTitle(const nsAString& aTitle)
NS_IMETHODIMP
CSSStyleSheetImpl::GetType(nsString& aType) const
{
aType.Assign(NS_LITERAL_STRING("text/css"));
aType.AssignLiteral("text/css");
return NS_OK;
}
@ -2420,7 +2420,7 @@ CSSStyleSheetImpl::SetModified(PRBool aModified)
NS_IMETHODIMP
CSSStyleSheetImpl::GetType(nsAString& aType)
{
aType.Assign(NS_LITERAL_STRING("text/css"));
aType.AssignLiteral("text/css");
return NS_OK;
}

View File

@ -399,15 +399,15 @@ void nsCSSValue::AppendToString(nsAString& aBuffer,
if (-1 < aPropID) {
AppendASCIItoUTF16(nsCSSProps::GetStringValue(aPropID), aBuffer);
aBuffer.Append(NS_LITERAL_STRING(": "));
aBuffer.AppendLiteral(": ");
}
switch (mUnit) {
case eCSSUnit_Image:
case eCSSUnit_URL: aBuffer.Append(NS_LITERAL_STRING("url(")); break;
case eCSSUnit_Attr: aBuffer.Append(NS_LITERAL_STRING("attr(")); break;
case eCSSUnit_Counter: aBuffer.Append(NS_LITERAL_STRING("counter(")); break;
case eCSSUnit_Counters: aBuffer.Append(NS_LITERAL_STRING("counters(")); break;
case eCSSUnit_URL: aBuffer.AppendLiteral("url("); break;
case eCSSUnit_Attr: aBuffer.AppendLiteral("attr("); break;
case eCSSUnit_Counter: aBuffer.AppendLiteral("counter("); break;
case eCSSUnit_Counters: aBuffer.AppendLiteral("counters("); break;
default: break;
}
if ((eCSSUnit_String <= mUnit) && (mUnit <= eCSSUnit_Counters)) {
@ -417,7 +417,7 @@ void nsCSSValue::AppendToString(nsAString& aBuffer,
aBuffer.Append(PRUnichar('"'));
}
else {
aBuffer.Append(NS_LITERAL_STRING("null str"));
aBuffer.AppendLiteral("null str");
}
}
else if ((eCSSUnit_Integer <= mUnit) && (mUnit <= eCSSUnit_Enumerated)) {
@ -425,7 +425,7 @@ void nsCSSValue::AppendToString(nsAString& aBuffer,
intStr.AppendInt(mValue.mInt, 10);
aBuffer.Append(intStr);
aBuffer.Append(NS_LITERAL_STRING("[0x"));
aBuffer.AppendLiteral("[0x");
intStr.Truncate();
intStr.AppendInt(mValue.mInt, 16);
@ -434,25 +434,25 @@ void nsCSSValue::AppendToString(nsAString& aBuffer,
aBuffer.Append(PRUnichar(']'));
}
else if (eCSSUnit_Color == mUnit) {
aBuffer.Append(NS_LITERAL_STRING("(0x"));
aBuffer.AppendLiteral("(0x");
nsAutoString intStr;
intStr.AppendInt(NS_GET_R(mValue.mColor), 16);
aBuffer.Append(intStr);
aBuffer.Append(NS_LITERAL_STRING(" 0x"));
aBuffer.AppendLiteral(" 0x");
intStr.Truncate();
intStr.AppendInt(NS_GET_G(mValue.mColor), 16);
aBuffer.Append(intStr);
aBuffer.Append(NS_LITERAL_STRING(" 0x"));
aBuffer.AppendLiteral(" 0x");
intStr.Truncate();
intStr.AppendInt(NS_GET_B(mValue.mColor), 16);
aBuffer.Append(intStr);
aBuffer.Append(NS_LITERAL_STRING(" 0x"));
aBuffer.AppendLiteral(" 0x");
intStr.Truncate();
intStr.AppendInt(NS_GET_A(mValue.mColor), 16);
@ -479,49 +479,49 @@ void nsCSSValue::AppendToString(nsAString& aBuffer,
switch (mUnit) {
case eCSSUnit_Null: break;
case eCSSUnit_Auto: aBuffer.Append(NS_LITERAL_STRING("auto")); break;
case eCSSUnit_Inherit: aBuffer.Append(NS_LITERAL_STRING("inherit")); break;
case eCSSUnit_Initial: aBuffer.Append(NS_LITERAL_STRING("initial")); break;
case eCSSUnit_None: aBuffer.Append(NS_LITERAL_STRING("none")); break;
case eCSSUnit_Normal: aBuffer.Append(NS_LITERAL_STRING("normal")); break;
case eCSSUnit_Auto: aBuffer.AppendLiteral("auto"); break;
case eCSSUnit_Inherit: aBuffer.AppendLiteral("inherit"); break;
case eCSSUnit_Initial: aBuffer.AppendLiteral("initial"); break;
case eCSSUnit_None: aBuffer.AppendLiteral("none"); break;
case eCSSUnit_Normal: aBuffer.AppendLiteral("normal"); break;
case eCSSUnit_String: break;
case eCSSUnit_URL:
case eCSSUnit_Image:
case eCSSUnit_Attr:
case eCSSUnit_Counter:
case eCSSUnit_Counters: aBuffer.Append(NS_LITERAL_STRING(")")); break;
case eCSSUnit_Integer: aBuffer.Append(NS_LITERAL_STRING("int")); break;
case eCSSUnit_Enumerated: aBuffer.Append(NS_LITERAL_STRING("enum")); break;
case eCSSUnit_Color: aBuffer.Append(NS_LITERAL_STRING("rbga")); break;
case eCSSUnit_Percent: aBuffer.Append(NS_LITERAL_STRING("%")); break;
case eCSSUnit_Number: aBuffer.Append(NS_LITERAL_STRING("#")); break;
case eCSSUnit_Inch: aBuffer.Append(NS_LITERAL_STRING("in")); break;
case eCSSUnit_Foot: aBuffer.Append(NS_LITERAL_STRING("ft")); break;
case eCSSUnit_Mile: aBuffer.Append(NS_LITERAL_STRING("mi")); break;
case eCSSUnit_Millimeter: aBuffer.Append(NS_LITERAL_STRING("mm")); break;
case eCSSUnit_Centimeter: aBuffer.Append(NS_LITERAL_STRING("cm")); break;
case eCSSUnit_Meter: aBuffer.Append(NS_LITERAL_STRING("m")); break;
case eCSSUnit_Kilometer: aBuffer.Append(NS_LITERAL_STRING("km")); break;
case eCSSUnit_Point: aBuffer.Append(NS_LITERAL_STRING("pt")); break;
case eCSSUnit_Pica: aBuffer.Append(NS_LITERAL_STRING("pc")); break;
case eCSSUnit_Didot: aBuffer.Append(NS_LITERAL_STRING("dt")); break;
case eCSSUnit_Cicero: aBuffer.Append(NS_LITERAL_STRING("cc")); break;
case eCSSUnit_EM: aBuffer.Append(NS_LITERAL_STRING("em")); break;
case eCSSUnit_EN: aBuffer.Append(NS_LITERAL_STRING("en")); break;
case eCSSUnit_XHeight: aBuffer.Append(NS_LITERAL_STRING("ex")); break;
case eCSSUnit_CapHeight: aBuffer.Append(NS_LITERAL_STRING("cap")); break;
case eCSSUnit_Char: aBuffer.Append(NS_LITERAL_STRING("ch")); break;
case eCSSUnit_Pixel: aBuffer.Append(NS_LITERAL_STRING("px")); break;
case eCSSUnit_Proportional: aBuffer.Append(NS_LITERAL_STRING("*")); break;
case eCSSUnit_Degree: aBuffer.Append(NS_LITERAL_STRING("deg")); break;
case eCSSUnit_Grad: aBuffer.Append(NS_LITERAL_STRING("grad")); break;
case eCSSUnit_Radian: aBuffer.Append(NS_LITERAL_STRING("rad")); break;
case eCSSUnit_Hertz: aBuffer.Append(NS_LITERAL_STRING("Hz")); break;
case eCSSUnit_Kilohertz: aBuffer.Append(NS_LITERAL_STRING("kHz")); break;
case eCSSUnit_Seconds: aBuffer.Append(NS_LITERAL_STRING("s")); break;
case eCSSUnit_Milliseconds: aBuffer.Append(NS_LITERAL_STRING("ms")); break;
case eCSSUnit_Integer: aBuffer.AppendLiteral("int"); break;
case eCSSUnit_Enumerated: aBuffer.AppendLiteral("enum"); break;
case eCSSUnit_Color: aBuffer.AppendLiteral("rbga"); break;
case eCSSUnit_Percent: aBuffer.AppendLiteral("%"); break;
case eCSSUnit_Number: aBuffer.AppendLiteral("#"); break;
case eCSSUnit_Inch: aBuffer.AppendLiteral("in"); break;
case eCSSUnit_Foot: aBuffer.AppendLiteral("ft"); break;
case eCSSUnit_Mile: aBuffer.AppendLiteral("mi"); break;
case eCSSUnit_Millimeter: aBuffer.AppendLiteral("mm"); break;
case eCSSUnit_Centimeter: aBuffer.AppendLiteral("cm"); break;
case eCSSUnit_Meter: aBuffer.AppendLiteral("m"); break;
case eCSSUnit_Kilometer: aBuffer.AppendLiteral("km"); break;
case eCSSUnit_Point: aBuffer.AppendLiteral("pt"); break;
case eCSSUnit_Pica: aBuffer.AppendLiteral("pc"); break;
case eCSSUnit_Didot: aBuffer.AppendLiteral("dt"); break;
case eCSSUnit_Cicero: aBuffer.AppendLiteral("cc"); break;
case eCSSUnit_EM: aBuffer.AppendLiteral("em"); break;
case eCSSUnit_EN: aBuffer.AppendLiteral("en"); break;
case eCSSUnit_XHeight: aBuffer.AppendLiteral("ex"); break;
case eCSSUnit_CapHeight: aBuffer.AppendLiteral("cap"); break;
case eCSSUnit_Char: aBuffer.AppendLiteral("ch"); break;
case eCSSUnit_Pixel: aBuffer.AppendLiteral("px"); break;
case eCSSUnit_Proportional: aBuffer.AppendLiteral("*"); break;
case eCSSUnit_Degree: aBuffer.AppendLiteral("deg"); break;
case eCSSUnit_Grad: aBuffer.AppendLiteral("grad"); break;
case eCSSUnit_Radian: aBuffer.AppendLiteral("rad"); break;
case eCSSUnit_Hertz: aBuffer.AppendLiteral("Hz"); break;
case eCSSUnit_Kilohertz: aBuffer.AppendLiteral("kHz"); break;
case eCSSUnit_Seconds: aBuffer.AppendLiteral("s"); break;
case eCSSUnit_Milliseconds: aBuffer.AppendLiteral("ms"); break;
}
aBuffer.Append(NS_LITERAL_STRING(" "));
aBuffer.AppendLiteral(" ");
}
void nsCSSValue::ToString(nsAString& aBuffer,

View File

@ -184,7 +184,7 @@ nsDOMCSSDeclaration::GetPropertyPriority(const nsAString& aPropertyName,
aReturn.Truncate();
if (decl && decl->GetValueIsImportant(aPropertyName)) {
aReturn.Assign(NS_LITERAL_STRING("important"));
aReturn.AssignLiteral("important");
}
return result;

View File

@ -98,7 +98,7 @@ nsDOMCSSValueList::GetCssText(nsAString& aCssText)
nsAutoString separator;
if (mCommaDelimited) {
separator.Assign(NS_LITERAL_STRING(", "));
separator.AssignLiteral(", ");
}
else {
separator.Assign(PRUnichar(' '));

View File

@ -559,14 +559,14 @@ HTMLCSSStyleSheetImpl::GetURL(nsIURI*& aURL) const
NS_IMETHODIMP
HTMLCSSStyleSheetImpl::GetTitle(nsString& aTitle) const
{
aTitle.Assign(NS_LITERAL_STRING("Internal HTML/CSS Style Sheet"));
aTitle.AssignLiteral("Internal HTML/CSS Style Sheet");
return NS_OK;
}
NS_IMETHODIMP
HTMLCSSStyleSheetImpl::GetType(nsString& aType) const
{
aType.Assign(NS_LITERAL_STRING("text/html"));
aType.AssignLiteral("text/html");
return NS_OK;
}

View File

@ -691,7 +691,7 @@ nsHTMLStyleSheet::GetTitle(nsString& aTitle) const
NS_IMETHODIMP
nsHTMLStyleSheet::GetType(nsString& aType) const
{
aType.Assign(NS_LITERAL_STRING("text/html"));
aType.AssignLiteral("text/html");
return NS_OK;
}

View File

@ -122,35 +122,35 @@ nsROCSSPrimitiveValue::GetCssText(nsAString& aCssText)
{
float val = NSTwipsToFloatPixels(mValue.mTwips, mT2P);
tmpStr.AppendFloat(val);
tmpStr.Append(NS_LITERAL_STRING("px"));
tmpStr.AppendLiteral("px");
break;
}
case CSS_CM :
{
float val = NS_TWIPS_TO_CENTIMETERS(mValue.mTwips);
tmpStr.AppendFloat(val);
tmpStr.Append(NS_LITERAL_STRING("cm"));
tmpStr.AppendLiteral("cm");
break;
}
case CSS_MM :
{
float val = NS_TWIPS_TO_MILLIMETERS(mValue.mTwips);
tmpStr.AppendFloat(val);
tmpStr.Append(NS_LITERAL_STRING("mm"));
tmpStr.AppendLiteral("mm");
break;
}
case CSS_IN :
{
float val = NS_TWIPS_TO_INCHES(mValue.mTwips);
tmpStr.AppendFloat(val);
tmpStr.Append(NS_LITERAL_STRING("in"));
tmpStr.AppendLiteral("in");
break;
}
case CSS_PT :
{
float val = NSTwipsToFloatPoints(mValue.mTwips);
tmpStr.AppendFloat(val);
tmpStr.Append(NS_LITERAL_STRING("pt"));
tmpStr.AppendLiteral("pt");
break;
}
case CSS_IDENT :
@ -197,7 +197,7 @@ nsROCSSPrimitiveValue::GetCssText(nsAString& aCssText)
NS_NAMED_LITERAL_STRING(comma, ", ");
nsCOMPtr<nsIDOMCSSPrimitiveValue> sideCSSValue;
nsAutoString sideValue;
tmpStr = NS_LITERAL_STRING("rect(");
tmpStr.AssignLiteral("rect(");
// get the top
result = mValue.mRect->GetTop(getter_AddRefs(sideCSSValue));
if (NS_FAILED(result))
@ -238,7 +238,7 @@ nsROCSSPrimitiveValue::GetCssText(nsAString& aCssText)
NS_NAMED_LITERAL_STRING(comma, ", ");
nsCOMPtr<nsIDOMCSSPrimitiveValue> colorCSSValue;
nsAutoString colorValue;
tmpStr = NS_LITERAL_STRING("rgb(");
tmpStr.AssignLiteral("rgb(");
// get the red component
result = mValue.mColor->GetRed(getter_AddRefs(colorCSSValue));

View File

@ -199,22 +199,22 @@ void nsStyleCoord::AppendToString(nsString& aBuffer) const
(eStyleUnit_Enumerated == mUnit) ||
(eStyleUnit_Integer == mUnit)) {
aBuffer.AppendInt(mValue.mInt, 10);
aBuffer.Append(NS_LITERAL_STRING("[0x"));
aBuffer.AppendLiteral("[0x");
aBuffer.AppendInt(mValue.mInt, 16);
aBuffer.Append(PRUnichar(']'));
}
switch (mUnit) {
case eStyleUnit_Null: aBuffer.Append(NS_LITERAL_STRING("Null")); break;
case eStyleUnit_Coord: aBuffer.Append(NS_LITERAL_STRING("tw")); break;
case eStyleUnit_Percent: aBuffer.Append(NS_LITERAL_STRING("%")); break;
case eStyleUnit_Factor: aBuffer.Append(NS_LITERAL_STRING("f")); break;
case eStyleUnit_Normal: aBuffer.Append(NS_LITERAL_STRING("Normal")); break;
case eStyleUnit_Auto: aBuffer.Append(NS_LITERAL_STRING("Auto")); break;
case eStyleUnit_Proportional: aBuffer.Append(NS_LITERAL_STRING("*")); break;
case eStyleUnit_Enumerated: aBuffer.Append(NS_LITERAL_STRING("enum")); break;
case eStyleUnit_Integer: aBuffer.Append(NS_LITERAL_STRING("int")); break;
case eStyleUnit_Chars: aBuffer.Append(NS_LITERAL_STRING("chars")); break;
case eStyleUnit_Null: aBuffer.AppendLiteral("Null"); break;
case eStyleUnit_Coord: aBuffer.AppendLiteral("tw"); break;
case eStyleUnit_Percent: aBuffer.AppendLiteral("%"); break;
case eStyleUnit_Factor: aBuffer.AppendLiteral("f"); break;
case eStyleUnit_Normal: aBuffer.AppendLiteral("Normal"); break;
case eStyleUnit_Auto: aBuffer.AppendLiteral("Auto"); break;
case eStyleUnit_Proportional: aBuffer.AppendLiteral("*"); break;
case eStyleUnit_Enumerated: aBuffer.AppendLiteral("enum"); break;
case eStyleUnit_Integer: aBuffer.AppendLiteral("int"); break;
case eStyleUnit_Chars: aBuffer.AppendLiteral("chars"); break;
}
aBuffer.Append(PRUnichar(' '));
}
@ -269,19 +269,19 @@ void nsStyleSides::AppendToString(nsString& aBuffer) const
nsStyleCoord temp;
GetLeft(temp);
aBuffer.Append(NS_LITERAL_STRING("left: "));
aBuffer.AppendLiteral("left: ");
temp.AppendToString(aBuffer);
GetTop(temp);
aBuffer.Append(NS_LITERAL_STRING("top: "));
aBuffer.AppendLiteral("top: ");
temp.AppendToString(aBuffer);
GetRight(temp);
aBuffer.Append(NS_LITERAL_STRING("right: "));
aBuffer.AppendLiteral("right: ");
temp.AppendToString(aBuffer);
GetBottom(temp);
aBuffer.Append(NS_LITERAL_STRING("bottom: "));
aBuffer.AppendLiteral("bottom: ");
temp.AppendToString(aBuffer);
}

View File

@ -182,7 +182,7 @@ nsSVGLengthList::GetValueString(nsAString& aValue)
if (++i >= count) break;
aValue.Append(NS_LITERAL_STRING(" "));
aValue.AppendLiteral(" ");
}
return NS_OK;

View File

@ -56,7 +56,7 @@ NS_IMETHODIMP \
cname::GetPathSegTypeAsLetter(nsAString & aPathSegTypeAsLetter) \
{ \
aPathSegTypeAsLetter.Truncate(); \
aPathSegTypeAsLetter.Append(NS_LITERAL_STRING(letter)); \
aPathSegTypeAsLetter.AppendLiteral(letter); \
return NS_OK; \
}
@ -130,7 +130,7 @@ NS_IMETHODIMP
nsSVGPathSegClosePath::GetValueString(nsAString& aValue)
{
aValue.Truncate();
aValue.Append(NS_LITERAL_STRING("z"));
aValue.AppendLiteral("z");
return NS_OK;
}

View File

@ -180,7 +180,7 @@ nsSVGPathSegList::GetValueString(nsAString& aValue)
if (++i >= count) break;
aValue.Append(NS_LITERAL_STRING(" "));
aValue.AppendLiteral(" ");
}
return NS_OK;

View File

@ -236,7 +236,7 @@ nsSVGPointList::GetValueString(nsAString& aValue)
if (++i >= count) break;
aValue.Append(NS_LITERAL_STRING(" "));
aValue.AppendLiteral(" ");
}
return NS_OK;

View File

@ -360,7 +360,7 @@ nsSVGTransformList::GetValueString(nsAString& aValue)
if (++i >= count) break;
aValue.Append(NS_LITERAL_STRING(" "));
aValue.AppendLiteral(" ");
}
return NS_OK;

View File

@ -58,7 +58,7 @@ nsXBLProtoImplField::nsXBLProtoImplField(const PRUnichar* aName, const PRUnichar
mJSAttributes = JSPROP_ENUMERATE;
if (aReadOnly) {
nsAutoString readOnly; readOnly.Assign(*aReadOnly);
if (readOnly.EqualsIgnoreCase("true"))
if (readOnly.LowerCaseEqualsLiteral("true"))
mJSAttributes |= JSPROP_READONLY;
}
}

View File

@ -61,7 +61,7 @@ nsXBLProtoImplProperty::nsXBLProtoImplProperty(const PRUnichar* aName,
if (aReadOnly) {
nsAutoString readOnly; readOnly.Assign(*aReadOnly);
if (readOnly.EqualsIgnoreCase("true"))
if (readOnly.LowerCaseEqualsLiteral("true"))
mJSAttributes |= JSPROP_READONLY;
}

View File

@ -810,7 +810,7 @@ nsXBLPrototypeHandler::GetEventType(nsAString& aEvent)
if (aEvent.IsEmpty() && (mType & NS_HANDLER_TYPE_XUL))
// If no type is specified for a XUL <key> element, let's assume that we're "keypress".
aEvent = NS_LITERAL_STRING("keypress");
aEvent.AssignLiteral("keypress");
}
void

View File

@ -127,7 +127,7 @@ nsXMLCDATASection::IsContentOfType(PRUint32 aFlags) const
NS_IMETHODIMP
nsXMLCDATASection::GetNodeName(nsAString& aNodeName)
{
aNodeName.Assign(NS_LITERAL_STRING("#cdata-section"));
aNodeName.AssignLiteral("#cdata-section");
return NS_OK;
}

View File

@ -219,14 +219,14 @@ nsXMLStylesheetPI::GetStyleSheetInfo(nsAString& aTitle,
nsAutoString mimeType;
nsAutoString notUsed;
nsParserUtils::SplitMimeType(type, mimeType, notUsed);
if (!mimeType.IsEmpty() && !mimeType.EqualsIgnoreCase("text/css")) {
if (!mimeType.IsEmpty() && !mimeType.LowerCaseEqualsLiteral("text/css")) {
aType.Assign(type);
return;
}
// If we get here we assume that we're loading a css file, so set the
// type to 'text/css'
aType.Assign(NS_LITERAL_STRING("text/css"));
aType.AssignLiteral("text/css");
return;
}

View File

@ -1329,7 +1329,7 @@ nsXMLContentSink::HandleProcessingInstruction(const PRUnichar *aTarget,
nsParserUtils::GetQuotedAttributeValue(data, NS_LITERAL_STRING("type"), type);
if (mState == eXMLContentSinkState_InProlog &&
target.EqualsLiteral("xml-stylesheet") &&
!type.EqualsIgnoreCase("text/css")) {
!type.LowerCaseEqualsLiteral("text/css")) {
nsAutoString href, title, media, alternate;
nsParserUtils::GetQuotedAttributeValue(data, NS_LITERAL_STRING("href"), href);

View File

@ -450,40 +450,40 @@ static void ConvertPosition(nsIDOMElement* aPopupElt, nsString& aAnchor, nsStrin
return;
if (position.EqualsLiteral("before_start")) {
aAnchor.Assign(NS_LITERAL_STRING("topleft"));
aAlign.Assign(NS_LITERAL_STRING("bottomleft"));
aAnchor.AssignLiteral("topleft");
aAlign.AssignLiteral("bottomleft");
}
else if (position.EqualsLiteral("before_end")) {
aAnchor.Assign(NS_LITERAL_STRING("topright"));
aAlign.Assign(NS_LITERAL_STRING("bottomright"));
aAnchor.AssignLiteral("topright");
aAlign.AssignLiteral("bottomright");
}
else if (position.EqualsLiteral("after_start")) {
aAnchor.Assign(NS_LITERAL_STRING("bottomleft"));
aAlign.Assign(NS_LITERAL_STRING("topleft"));
aAnchor.AssignLiteral("bottomleft");
aAlign.AssignLiteral("topleft");
}
else if (position.EqualsLiteral("after_end")) {
aAnchor.Assign(NS_LITERAL_STRING("bottomright"));
aAlign.Assign(NS_LITERAL_STRING("topright"));
aAnchor.AssignLiteral("bottomright");
aAlign.AssignLiteral("topright");
}
else if (position.EqualsLiteral("start_before")) {
aAnchor.Assign(NS_LITERAL_STRING("topleft"));
aAlign.Assign(NS_LITERAL_STRING("topright"));
aAnchor.AssignLiteral("topleft");
aAlign.AssignLiteral("topright");
}
else if (position.EqualsLiteral("start_after")) {
aAnchor.Assign(NS_LITERAL_STRING("bottomleft"));
aAlign.Assign(NS_LITERAL_STRING("bottomright"));
aAnchor.AssignLiteral("bottomleft");
aAlign.AssignLiteral("bottomright");
}
else if (position.EqualsLiteral("end_before")) {
aAnchor.Assign(NS_LITERAL_STRING("topright"));
aAlign.Assign(NS_LITERAL_STRING("topleft"));
aAnchor.AssignLiteral("topright");
aAlign.AssignLiteral("topleft");
}
else if (position.EqualsLiteral("end_after")) {
aAnchor.Assign(NS_LITERAL_STRING("bottomright"));
aAlign.Assign(NS_LITERAL_STRING("bottomleft"));
aAnchor.AssignLiteral("bottomright");
aAlign.AssignLiteral("bottomleft");
}
else if (position.EqualsLiteral("overlap")) {
aAnchor.Assign(NS_LITERAL_STRING("topleft"));
aAlign.Assign(NS_LITERAL_STRING("topleft"));
aAnchor.AssignLiteral("topleft");
aAlign.AssignLiteral("topleft");
}
else if (position.EqualsLiteral("after_pointer"))
aY += 21;
@ -507,7 +507,7 @@ XULPopupListenerImpl::LaunchPopup(PRInt32 aClientX, PRInt32 aClientY)
nsAutoString type(NS_LITERAL_STRING("popup"));
if ( popupType == eXULPopupType_context ) {
type.Assign(NS_LITERAL_STRING("context"));
type.AssignLiteral("context");
// position the menu two pixels down and to the right from the current
// mouse position. This makes it easier to dismiss the menu by just

View File

@ -373,7 +373,7 @@ XULContentSinkImpl::~XULContentSinkImpl()
}
else
{
prefix.Assign(NS_LITERAL_STRING("<default>"));
prefix.AssignLiteral("<default>");
}
char* prefixStr = ToNewCString(prefix);
@ -1396,8 +1396,8 @@ XULContentSinkImpl::OpenScript(const PRUnichar** aAttributes,
nsAutoString params;
nsParserUtils::SplitMimeType(type, mimeType, params);
isJavaScript = mimeType.EqualsIgnoreCase("application/x-javascript") ||
mimeType.EqualsIgnoreCase("text/javascript");
isJavaScript = mimeType.LowerCaseEqualsLiteral("application/x-javascript") ||
mimeType.LowerCaseEqualsLiteral("text/javascript");
if (isJavaScript) {
JSVersion jsVersion = JSVERSION_DEFAULT;
if (params.Find("version=", PR_TRUE) == 0) {
@ -1527,7 +1527,7 @@ XULContentSinkImpl::AddAttributes(const PRUnichar** aAttributes,
nsAutoString extraWhiteSpace;
PRInt32 cnt = mContextStack.Depth();
while (--cnt >= 0)
extraWhiteSpace.Append(NS_LITERAL_STRING(" "));
extraWhiteSpace.AppendLiteral(" ");
nsAutoString qnameC,valueC;
qnameC.Assign(aAttributes[0]);
valueC.Assign(aAttributes[1]);

View File

@ -366,7 +366,7 @@ nsXULDocument::nsXULDocument(void)
// bother initializing members to 0.
// Override the default in nsDocument
mCharacterSet.Assign(NS_LITERAL_CSTRING("UTF-8"));
mCharacterSet.AssignLiteral("UTF-8");
}
nsXULDocument::~nsXULDocument()
@ -511,7 +511,7 @@ nsXULDocument::ResetToURI(nsIURI* aURI, nsILoadGroup* aLoadGroup)
NS_IMETHODIMP
nsXULDocument::GetContentType(nsAString& aContentType)
{
aContentType.Assign(NS_LITERAL_STRING("application/vnd.mozilla.xul+xml"));
aContentType.AssignLiteral("application/vnd.mozilla.xul+xml");
return NS_OK;
}
@ -3802,7 +3802,7 @@ nsXULDocument::BroadcasterHookup::~BroadcasterHookup()
rv = mObservesElement->GetAttr(kNameSpaceID_None, nsXULAtoms::observes, broadcasterID);
if (NS_FAILED(rv)) return;
attribute.Assign(NS_LITERAL_STRING("*"));
attribute.AssignLiteral("*");
}
nsAutoString tagStr;
@ -3925,7 +3925,7 @@ nsXULDocument::CheckBroadcasterHookup(nsXULDocument* aDocument,
listener = do_QueryInterface(aElement);
attribute.Assign(NS_LITERAL_STRING("*"));
attribute.AssignLiteral("*");
}
// Make sure we got a valid listener.

View File

@ -510,13 +510,13 @@ nsXULContentUtils::SetCommandUpdater(nsIDocument* aDocument, nsIContent* aElemen
rv = aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::events, events);
if (rv != NS_CONTENT_ATTR_HAS_VALUE)
events.Assign(NS_LITERAL_STRING("*"));
events.AssignLiteral("*");
nsAutoString targets;
rv = aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::targets, targets);
if (rv != NS_CONTENT_ATTR_HAS_VALUE)
targets.Assign(NS_LITERAL_STRING("*"));
targets.AssignLiteral("*");
nsCOMPtr<nsIDOMElement> domelement = do_QueryInterface(aElement);
NS_ASSERTION(domelement != nsnull, "not a DOM element");

View File

@ -1348,13 +1348,13 @@ XULSortServiceImpl::InsertContainerNode(nsIRDFCompositeDataSource *db, nsRDFSort
sortState->sortProperty = sortInfo.sortProperty;
nsAutoString resourceUrl = sortResource;
resourceUrl.Append(NS_LITERAL_STRING("?collation=true"));
resourceUrl.AppendLiteral("?collation=true");
rv = gRDFService->GetUnicodeResource(resourceUrl, getter_AddRefs(sortInfo.sortPropertyColl));
if (NS_FAILED(rv)) return rv;
sortState->sortPropertyColl = sortInfo.sortPropertyColl;
resourceUrl = sortResource;
resourceUrl.Append(NS_LITERAL_STRING("?sort=true"));
resourceUrl.AppendLiteral("?sort=true");
rv = gRDFService->GetUnicodeResource(resourceUrl, getter_AddRefs(sortInfo.sortPropertySort));
if (NS_FAILED(rv)) return rv;
sortState->sortPropertySort = sortInfo.sortPropertySort;
@ -1366,13 +1366,13 @@ XULSortServiceImpl::InsertContainerNode(nsIRDFCompositeDataSource *db, nsRDFSort
sortState->sortProperty2 = sortInfo.sortProperty2;
resourceUrl = sortResource2;
resourceUrl.Append(NS_LITERAL_STRING("?collation=true"));
resourceUrl.AppendLiteral("?collation=true");
rv = gRDFService->GetUnicodeResource(resourceUrl, getter_AddRefs(sortInfo.sortPropertyColl2));
if (NS_FAILED(rv)) return rv;
sortState->sortPropertyColl2 = sortInfo.sortPropertyColl2;
resourceUrl = sortResource2;
resourceUrl.Append(NS_LITERAL_STRING("?sort=true"));
resourceUrl.AppendLiteral("?sort=true");
rv = gRDFService->GetUnicodeResource(resourceUrl, getter_AddRefs(sortInfo.sortPropertySort2));
if (NS_FAILED(rv)) return rv;
sortState->sortPropertySort2 = sortInfo.sortPropertySort2;
@ -1634,12 +1634,12 @@ XULSortServiceImpl::Sort(nsIDOMNode* node, const nsAString& sortResource, const
nsAutoString resourceUrl;
resourceUrl.Assign(sortResource);
resourceUrl.Append(NS_LITERAL_STRING("?collation=true"));
resourceUrl.AppendLiteral("?collation=true");
rv = gRDFService->GetUnicodeResource(resourceUrl, getter_AddRefs(sortInfo.sortPropertyColl));
if (NS_FAILED(rv)) return rv;
resourceUrl.Assign(sortResource);
resourceUrl.Append(NS_LITERAL_STRING("?sort=true"));
resourceUrl.AppendLiteral("?sort=true");
rv = gRDFService->GetUnicodeResource(resourceUrl, getter_AddRefs(sortInfo.sortPropertySort));
if (NS_FAILED(rv)) return rv;
@ -1649,12 +1649,12 @@ XULSortServiceImpl::Sort(nsIDOMNode* node, const nsAString& sortResource, const
if (NS_FAILED(rv)) return rv;
resourceUrl = sortResource2;
resourceUrl.Append(NS_LITERAL_STRING("?collation=true"));
resourceUrl.AppendLiteral("?collation=true");
rv = gRDFService->GetUnicodeResource(resourceUrl, getter_AddRefs(sortInfo.sortPropertyColl2));
if (NS_FAILED(rv)) return rv;
resourceUrl = sortResource2;
resourceUrl.Append(NS_LITERAL_STRING("?sort=true"));
resourceUrl.AppendLiteral("?sort=true");
rv = gRDFService->GetUnicodeResource(resourceUrl, getter_AddRefs(sortInfo.sortPropertySort2));
if (NS_FAILED(rv)) return rv;
}

View File

@ -435,15 +435,15 @@ nsXULTreeBuilder::Sort(nsIDOMElement* aElement)
header->GetAttr(kNameSpaceID_None, nsXULAtoms::sortDirection, dir);
if (dir.EqualsLiteral("ascending")) {
dir = NS_LITERAL_STRING("descending");
dir.AssignLiteral("descending");
mSortDirection = eDirection_Descending;
}
else if (dir.EqualsLiteral("descending")) {
dir = NS_LITERAL_STRING("natural");
dir.AssignLiteral("natural");
mSortDirection = eDirection_Natural;
}
else {
dir = NS_LITERAL_STRING("ascending");
dir.AssignLiteral("ascending");
mSortDirection = eDirection_Ascending;
}

View File

@ -318,7 +318,7 @@ nsLDAPChannel::SetLoadFlags(nsLoadFlags aLoadFlags)
NS_IMETHODIMP
nsLDAPChannel::GetContentType(nsACString &aContentType)
{
aContentType = NS_LITERAL_CSTRING(TEXT_PLAIN);
aContentType.AssignLiteral(TEXT_PLAIN);
return NS_OK;
}

View File

@ -141,7 +141,7 @@ nsDefaultURIFixup::CreateFixupURI(const nsACString& aStringURI, PRUint32 aFixupF
// after it. The easiest way to do that is to call this method again with the
// "view-source:" lopped off and then prepend it again afterwards.
if (scheme.EqualsIgnoreCase("view-source"))
if (scheme.LowerCaseEqualsLiteral("view-source"))
{
nsCOMPtr<nsIURI> uri;
PRUint32 newFixupFlags = aFixupFlags & ~FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP;
@ -178,9 +178,9 @@ nsDefaultURIFixup::CreateFixupURI(const nsACString& aStringURI, PRUint32 aFixupF
// http:\\broken.com#odd\ref (stops at hash)
//
if (scheme.IsEmpty() ||
scheme.EqualsIgnoreCase("http") ||
scheme.EqualsIgnoreCase("https") ||
scheme.EqualsIgnoreCase("ftp"))
scheme.LowerCaseEqualsLiteral("http") ||
scheme.LowerCaseEqualsLiteral("https") ||
scheme.LowerCaseEqualsLiteral("ftp"))
{
// Walk the string replacing backslashes with forward slashes until
// the end is reached, or a question mark, or a hash, or a forward
@ -208,10 +208,10 @@ nsDefaultURIFixup::CreateFixupURI(const nsACString& aStringURI, PRUint32 aFixupF
PRBool bUseNonDefaultCharsetForURI =
!bAsciiURI &&
(scheme.IsEmpty() ||
scheme.EqualsIgnoreCase("http") ||
scheme.EqualsIgnoreCase("https") ||
scheme.EqualsIgnoreCase("ftp") ||
scheme.EqualsIgnoreCase("file"));
scheme.LowerCaseEqualsLiteral("http") ||
scheme.LowerCaseEqualsLiteral("https") ||
scheme.LowerCaseEqualsLiteral("ftp") ||
scheme.LowerCaseEqualsLiteral("file"));
// Now we need to check whether "scheme" is something we don't
// really know about.
@ -641,7 +641,7 @@ const char * nsDefaultURIFixup::GetFileSystemCharset()
rv = plat->GetCharset(kPlatformCharsetSel_FileName, charset);
if (charset.IsEmpty())
mFsCharset.Assign(NS_LITERAL_CSTRING("ISO-8859-1"));
mFsCharset.AssignLiteral("ISO-8859-1");
else
mFsCharset.Assign(charset);
}

View File

@ -1020,22 +1020,22 @@ nsresult nsDocShell::FindTarget(const PRUnichar *aWindowTarget,
*aResult = nsnull;
*aIsNewWindow = PR_FALSE;
if(!name.Length() || name.EqualsIgnoreCase("_self"))
if(!name.Length() || name.LowerCaseEqualsLiteral("_self"))
{
*aResult = this;
}
else if (name.EqualsIgnoreCase("_blank") || name.EqualsIgnoreCase("_new"))
else if (name.LowerCaseEqualsLiteral("_blank") || name.LowerCaseEqualsLiteral("_new"))
{
mustMakeNewWindow = PR_TRUE;
name.Truncate();
}
else if(name.EqualsIgnoreCase("_parent"))
else if(name.LowerCaseEqualsLiteral("_parent"))
{
GetSameTypeParent(getter_AddRefs(treeItem));
if(!treeItem)
*aResult = this;
}
else if(name.EqualsIgnoreCase("_top"))
else if(name.LowerCaseEqualsLiteral("_top"))
{
GetSameTypeRootTreeItem(getter_AddRefs(treeItem));
if(!treeItem)
@ -1043,7 +1043,7 @@ nsresult nsDocShell::FindTarget(const PRUnichar *aWindowTarget,
}
// _main is an IE target which should be case-insensitive but isn't
// see bug 217886 for details
else if(name.EqualsIgnoreCase("_content") || name.EqualsLiteral("_main"))
else if(name.LowerCaseEqualsLiteral("_content") || name.EqualsLiteral("_main"))
{
if (mTreeOwner) {
mTreeOwner->FindItemWithName(name.get(), nsnull,
@ -2573,7 +2573,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI, const PRUnichar *aUR
aURI->GetScheme(scheme);
CopyASCIItoUCS2(scheme, formatStrs[0]);
formatStrCount = 1;
error.Assign(NS_LITERAL_STRING("protocolNotFound"));
error.AssignLiteral("protocolNotFound");
}
else if (NS_ERROR_FILE_NOT_FOUND == aError) {
NS_ENSURE_ARG_POINTER(aURI);
@ -2591,7 +2591,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI, const PRUnichar *aUR
rv = NS_OK;
}
formatStrCount = 1;
error.Assign(NS_LITERAL_STRING("fileNotFound"));
error.AssignLiteral("fileNotFound");
}
else if (NS_ERROR_UNKNOWN_HOST == aError) {
NS_ENSURE_ARG_POINTER(aURI);
@ -2600,7 +2600,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI, const PRUnichar *aUR
aURI->GetHost(host);
CopyUTF8toUTF16(host, formatStrs[0]);
formatStrCount = 1;
error.Assign(NS_LITERAL_STRING("dnsNotFound"));
error.AssignLiteral("dnsNotFound");
}
else if(NS_ERROR_CONNECTION_REFUSED == aError) {
NS_ENSURE_ARG_POINTER(aURI);
@ -2609,7 +2609,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI, const PRUnichar *aUR
aURI->GetHostPort(hostport);
CopyUTF8toUTF16(hostport, formatStrs[0]);
formatStrCount = 1;
error.Assign(NS_LITERAL_STRING("connectionFailure"));
error.AssignLiteral("connectionFailure");
}
else if(NS_ERROR_NET_INTERRUPT == aError) {
NS_ENSURE_ARG_POINTER(aURI);
@ -2618,7 +2618,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI, const PRUnichar *aUR
aURI->GetHostPort(hostport);
CopyUTF8toUTF16(hostport, formatStrs[0]);
formatStrCount = 1;
error.Assign(NS_LITERAL_STRING("netInterrupt"));
error.AssignLiteral("netInterrupt");
}
else if (NS_ERROR_NET_TIMEOUT == aError) {
NS_ENSURE_ARG_POINTER(aURI);
@ -2627,48 +2627,48 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI, const PRUnichar *aUR
aURI->GetHost(host);
CopyUTF8toUTF16(host, formatStrs[0]);
formatStrCount = 1;
error.Assign(NS_LITERAL_STRING("netTimeout"));
error.AssignLiteral("netTimeout");
}
else {
// Errors requiring simple formatting
switch (aError) {
case NS_ERROR_MALFORMED_URI:
// URI is malformed
error.Assign(NS_LITERAL_STRING("malformedURI"));
error.AssignLiteral("malformedURI");
break;
case NS_ERROR_REDIRECT_LOOP:
// Doc failed to load because the server generated too many redirects
error.Assign(NS_LITERAL_STRING("redirectLoop"));
error.AssignLiteral("redirectLoop");
break;
case NS_ERROR_UNKNOWN_SOCKET_TYPE:
// Doc failed to load because PSM is not installed
error.Assign(NS_LITERAL_STRING("unknownSocketType"));
error.AssignLiteral("unknownSocketType");
break;
case NS_ERROR_NET_RESET:
// Doc failed to load because the server kept reseting the connection
// before we could read any data from it
error.Assign(NS_LITERAL_STRING("netReset"));
error.AssignLiteral("netReset");
break;
case NS_ERROR_DOCUMENT_NOT_CACHED:
// Doc falied to load because we are offline and the cache does not
// contain a copy of the document.
error.Assign(NS_LITERAL_STRING("netOffline"));
error.AssignLiteral("netOffline");
break;
case NS_ERROR_DOCUMENT_IS_PRINTMODE:
// Doc navigation attempted while Printing or Print Preview
error.Assign(NS_LITERAL_STRING("isprinting"));
error.AssignLiteral("isprinting");
break;
case NS_ERROR_PORT_ACCESS_NOT_ALLOWED:
// Port blocked for security reasons
error.Assign(NS_LITERAL_STRING("deniedPortAccess"));
error.AssignLiteral("deniedPortAccess");
break;
case NS_ERROR_UNKNOWN_PROXY_HOST:
// Proxy hostname could not be resolved.
error.Assign(NS_LITERAL_STRING("proxyResolveFailure"));
error.AssignLiteral("proxyResolveFailure");
break;
case NS_ERROR_PROXY_CONNECTION_REFUSED:
// Proxy connection was refused.
error.Assign(NS_LITERAL_STRING("proxyConnectFailure"));
error.AssignLiteral("proxyConnectFailure");
break;
}
}
@ -2747,11 +2747,11 @@ nsDocShell::LoadErrorPage(nsIURI *aURI, const PRUnichar *aURL, const PRUnichar *
nsAutoString errorType(aErrorType);
nsAutoString errorPageUrl;
errorPageUrl.Assign(NS_LITERAL_STRING("chrome://global/content/netError.xhtml?e="));
errorPageUrl.AssignLiteral("chrome://global/content/netError.xhtml?e=");
errorPageUrl.AppendWithConversion(escapedError);
errorPageUrl.Append(NS_LITERAL_STRING("&u="));
errorPageUrl.AppendLiteral("&u=");
errorPageUrl.AppendWithConversion(escapedUrl);
errorPageUrl.Append(NS_LITERAL_STRING("&d="));
errorPageUrl.AppendLiteral("&d=");
errorPageUrl.AppendWithConversion(escapedDescription);
PR_FREEIF(escapedDescription);
@ -2981,7 +2981,7 @@ nsDocShell::LoadPage(nsISupports *aPageDescriptor, PRUint32 aDisplayType)
return rv;
oldUri->GetSpec(spec);
newSpec.Append(NS_LITERAL_CSTRING("view-source:"));
newSpec.AppendLiteral("view-source:");
newSpec.Append(spec);
rv = NS_NewURI(getter_AddRefs(newUri), newSpec);
@ -5183,8 +5183,8 @@ nsDocShell::InternalLoad(nsIURI * aURI,
// _main is an IE target which should be case-insensitive but isn't
// see bug 217886 for details
if (!bIsJavascript &&
(name.EqualsIgnoreCase("_content") || name.EqualsLiteral("_main") ||
name.EqualsIgnoreCase("_blank")))
(name.LowerCaseEqualsLiteral("_content") || name.EqualsLiteral("_main") ||
name.LowerCaseEqualsLiteral("_blank")))
{
nsCOMPtr<nsIExternalProtocolService> extProtService;
nsCAutoString urlScheme;
@ -5220,15 +5220,15 @@ nsDocShell::InternalLoad(nsIURI * aURI,
}
}
if (!bIsChromeOrResource) {
if (name.EqualsIgnoreCase("_blank") ||
name.EqualsIgnoreCase("_new")) {
name.Assign(NS_LITERAL_STRING("_top"));
if (name.LowerCaseEqualsLiteral("_blank") ||
name.LowerCaseEqualsLiteral("_new")) {
name.AssignLiteral("_top");
}
// _main is an IE target which should be case-insensitive but isn't
// see bug 217886 for details
else if (!name.EqualsIgnoreCase("_parent") &&
!name.EqualsIgnoreCase("_self") &&
!name.EqualsIgnoreCase("_content") &&
else if (!name.LowerCaseEqualsLiteral("_parent") &&
!name.LowerCaseEqualsLiteral("_self") &&
!name.LowerCaseEqualsLiteral("_content") &&
!name.EqualsLiteral("_main")) {
nsCOMPtr<nsIDocShellTreeItem> targetTreeItem;
FindItemWithName(name.get(),
@ -5237,7 +5237,7 @@ nsDocShell::InternalLoad(nsIURI * aURI,
if (targetTreeItem)
targetDocShell = do_QueryInterface(targetTreeItem);
else
name.Assign(NS_LITERAL_STRING("_top"));
name.AssignLiteral("_top");
}
}
}

View File

@ -664,7 +664,7 @@ nsWebShell::OnLinkClickSyncInternal(nsIContent *aContent,
switch(aVerb) {
case eLinkVerb_New:
target.Assign(NS_LITERAL_STRING("_blank"));
target.AssignLiteral("_blank");
// Fall into replace case
case eLinkVerb_Undefined:
// Fall through, this seems like the most reasonable action

View File

@ -2247,7 +2247,7 @@ GlobalWindowImpl::MakeScriptDialogTitle(const nsAString &aInTitle, nsAString &aO
// Just in case
if (aOutTitle.IsEmpty()) {
NS_WARNING("could not get ScriptDlgTitle string from string bundle");
aOutTitle.Assign(NS_LITERAL_STRING("[Script] "));
aOutTitle.AssignLiteral("[Script] ");
aOutTitle.Append(aInTitle);
}
}
@ -3140,9 +3140,9 @@ PRBool GlobalWindowImpl::CheckOpenAllow(PRUint32 aAbuseLevel,
// _main is an IE target which should be case-insensitive but isn't
// see bug 217886 for details
if (!name.IsEmpty()) {
if (name.EqualsIgnoreCase("_top") ||
name.EqualsIgnoreCase("_self") ||
name.EqualsIgnoreCase("_content") ||
if (name.LowerCaseEqualsLiteral("_top") ||
name.LowerCaseEqualsLiteral("_self") ||
name.LowerCaseEqualsLiteral("_content") ||
name.EqualsLiteral("_main"))
allowWindow = PR_TRUE;
else {
@ -5883,14 +5883,14 @@ NavigatorImpl::GetAppVersion(nsAString& aAppVersion)
res = service->GetAppVersion(str);
CopyASCIItoUCS2(str, aAppVersion);
aAppVersion.Append(NS_LITERAL_STRING(" ("));
aAppVersion.AppendLiteral(" (");
res = service->GetPlatform(str);
if (NS_FAILED(res))
return res;
AppendASCIItoUTF16(str, aAppVersion);
aAppVersion.Append(NS_LITERAL_STRING("; "));
aAppVersion.AppendLiteral("; ");
res = service->GetLanguage(str);
if (NS_FAILED(res))
return res;
@ -5906,7 +5906,7 @@ NavigatorImpl::GetAppVersion(nsAString& aAppVersion)
NS_IMETHODIMP
NavigatorImpl::GetAppName(nsAString& aAppName)
{
aAppName.Assign(NS_LITERAL_STRING("Netscape"));
aAppName.AssignLiteral("Netscape");
return NS_OK;
}
@ -5936,13 +5936,13 @@ NavigatorImpl::GetPlatform(nsAString& aPlatform)
// likewise hardcoded and we're seeking backward compatibility
// here (bug 47080)
#if defined(WIN32)
aPlatform = NS_LITERAL_STRING("Win32");
aPlatform.AssignLiteral("Win32");
#elif defined(XP_MAC) || defined(XP_MACOSX)
// XXX not sure what to do about Mac OS X on non-PPC, but since Comm 4.x
// doesn't know about it this will actually be backward compatible
aPlatform = NS_LITERAL_STRING("MacPPC");
aPlatform.AssignLiteral("MacPPC");
#elif defined(XP_OS2)
aPlatform = NS_LITERAL_STRING("OS/2");
aPlatform.AssignLiteral("OS/2");
#else
// XXX Communicator uses compiled-in build-time string defines
// to indicate the platform it was compiled *for*, not what it is

View File

@ -73,14 +73,14 @@ nsComposeTxtSrvFilter::Skip(nsIDOMNode* aNode, PRBool *_retval)
if (mIsForMail) {
nsAutoString cite;
if (NS_SUCCEEDED(content->GetAttr(kNameSpaceID_None, mTypeAtom, cite))) {
*_retval = cite.EqualsIgnoreCase("cite");
*_retval = cite.LowerCaseEqualsLiteral("cite");
}
}
} else if (tag == mPreAtom || tag == mSpanAtom) {
if (mIsForMail) {
nsAutoString mozQuote;
if (NS_SUCCEEDED(content->GetAttr(kNameSpaceID_None, mMozQuoteAtom, mozQuote))) {
*_retval = mozQuote.EqualsIgnoreCase("true");
*_retval = mozQuote.LowerCaseEqualsLiteral("true");
}
}
} else if (tag == mScriptAtom ||

View File

@ -283,12 +283,12 @@ nsStyleUpdatingCommand::ToggleState(nsIEditor *aEditor, const char* aTagName)
if (tagName.EqualsLiteral("sub"))
{
removeName.AssignWithConversion("sup");
removeName.AssignLiteral("sup");
rv = RemoveTextProperty(aEditor,tagName.get(), nsnull);
}
else if (tagName.EqualsLiteral("sup"))
{
removeName.AssignWithConversion("sub");
removeName.AssignLiteral("sub");
rv = RemoveTextProperty(aEditor, tagName.get(), nsnull);
}
if (NS_SUCCEEDED(rv))
@ -1052,19 +1052,19 @@ nsAlignCommand::GetCurrentState(nsIEditor *aEditor, nsICommandParams *aParams)
{
default:
case nsIHTMLEditor::eLeft:
outStateString.Assign(NS_LITERAL_STRING("left"));
outStateString.AssignLiteral("left");
break;
case nsIHTMLEditor::eCenter:
outStateString.Assign(NS_LITERAL_STRING("center"));
outStateString.AssignLiteral("center");
break;
case nsIHTMLEditor::eRight:
outStateString.Assign(NS_LITERAL_STRING("right"));
outStateString.AssignLiteral("right");
break;
case nsIHTMLEditor::eJustify:
outStateString.Assign(NS_LITERAL_STRING("justify"));
outStateString.AssignLiteral("justify");
break;
}
nsCAutoString tOutStateString;
@ -1133,7 +1133,7 @@ nsAbsolutePositioningCommand::GetCurrentState(nsIEditor *aEditor, const char* aT
nsAutoString outStateString;
if (elt)
outStateString.Assign(NS_LITERAL_STRING("absolute"));
outStateString.AssignLiteral("absolute");
aParams->SetBooleanValue(STATE_MIXED,PR_FALSE);
aParams->SetCStringValue(STATE_ATTRIBUTE, NS_ConvertUCS2toUTF8(outStateString).get());
@ -1567,9 +1567,9 @@ nsInsertTagCommand::DoCommandParams(const char *aCommandName,
// filter out tags we don't know how to insert
nsAutoString attributeType;
if (0 == nsCRT::strcmp(mTagName, "a")) {
attributeType = NS_LITERAL_STRING("href");
attributeType.AssignLiteral("href");
} else if (0 == nsCRT::strcmp(mTagName, "img")) {
attributeType = NS_LITERAL_STRING("src");
attributeType.AssignLiteral("src");
} else {
return NS_ERROR_NOT_IMPLEMENTED;
}
@ -1632,11 +1632,11 @@ GetListState(nsIEditor *aEditor, PRBool *aMixed, PRUnichar **_retval)
{
nsAutoString tagStr;
if (bOL)
tagStr.AssignWithConversion("ol");
tagStr.AssignLiteral("ol");
else if (bUL)
tagStr.AssignWithConversion("ul");
tagStr.AssignLiteral("ul");
else if (bDL)
tagStr.AssignWithConversion("dl");
tagStr.AssignLiteral("dl");
*_retval = ToNewUnicode(tagStr);
}
}

View File

@ -316,7 +316,7 @@ nsEditingSession::SetupEditorOnWindow(nsIDOMWindow *aWindow)
if (IsSupportedTextType(mimeCType.get()))
{
mEditorType = NS_LITERAL_CSTRING("text");
mEditorType.AssignLiteral("text");
mimeCType = "text/plain";
}
else if (!mimeCType.EqualsLiteral("text/html"))
@ -325,8 +325,8 @@ nsEditingSession::SetupEditorOnWindow(nsIDOMWindow *aWindow)
mEditorStatus = eEditorErrorCantEditMimeType;
// Turn editor into HTML -- we will load blank page later
mEditorType = NS_LITERAL_CSTRING("html");
mimeCType = NS_LITERAL_CSTRING("text/html");
mEditorType.AssignLiteral("html");
mimeCType.AssignLiteral("text/html");
}
}
}

View File

@ -124,12 +124,12 @@ NS_IMETHODIMP ChangeAttributeTxn::Merge(nsITransaction *aTransaction, PRBool *aD
NS_IMETHODIMP ChangeAttributeTxn::GetTxnDescription(nsAString& aString)
{
aString.Assign(NS_LITERAL_STRING("ChangeAttributeTxn: [mRemoveAttribute == "));
aString.AssignLiteral("ChangeAttributeTxn: [mRemoveAttribute == ");
if (!mRemoveAttribute)
aString += NS_LITERAL_STRING("false] ");
aString.AppendLiteral("false] ");
else
aString += NS_LITERAL_STRING("true] ");
aString.AppendLiteral("true] ");
aString += mAttribute;
return NS_OK;
}

View File

@ -316,12 +316,12 @@ NS_IMETHODIMP ChangeCSSInlineStyleTxn::Merge(nsITransaction *aTransaction, PRBoo
NS_IMETHODIMP ChangeCSSInlineStyleTxn::GetTxnDescription(nsAString& aString)
{
aString.Assign(NS_LITERAL_STRING("ChangeCSSInlineStyleTxn: [mRemoveProperty == "));
aString.AssignLiteral("ChangeCSSInlineStyleTxn: [mRemoveProperty == ");
if (!mRemoveProperty)
aString += NS_LITERAL_STRING("false] ");
aString.AppendLiteral("false] ");
else
aString += NS_LITERAL_STRING("true] ");
aString.AppendLiteral("true] ");
nsAutoString tempString;
mProperty->ToString(tempString);
aString += tempString;
@ -343,8 +343,7 @@ NS_IMETHODIMP
ChangeCSSInlineStyleTxn::AddValueToMultivalueProperty(nsAString & aValues, const nsAString & aNewValue)
{
if (aValues.IsEmpty()
|| aValues.Equals(NS_LITERAL_STRING("none"),
nsCaseInsensitiveStringComparator())) {
|| aValues.LowerCaseEqualsLiteral("none")) {
// the list of values is empty of the value is 'none'
aValues.Assign(aNewValue);
}

View File

@ -230,7 +230,7 @@ NS_IMETHODIMP CreateElementTxn::Merge(nsITransaction *aTransaction, PRBool *aDid
NS_IMETHODIMP CreateElementTxn::GetTxnDescription(nsAString& aString)
{
aString.Assign(NS_LITERAL_STRING("CreateElementTxn: "));
aString.AssignLiteral("CreateElementTxn: ");
aString += mTag;
return NS_OK;
}

View File

@ -183,6 +183,6 @@ NS_IMETHODIMP DeleteElementTxn::Merge(nsITransaction *aTransaction, PRBool *aDid
NS_IMETHODIMP DeleteElementTxn::GetTxnDescription(nsAString& aString)
{
aString.Assign(NS_LITERAL_STRING("DeleteElementTxn"));
aString.AssignLiteral("DeleteElementTxn");
return NS_OK;
}

View File

@ -223,7 +223,7 @@ NS_IMETHODIMP DeleteRangeTxn::Merge(nsITransaction *aTransaction, PRBool *aDidMe
NS_IMETHODIMP DeleteRangeTxn::GetTxnDescription(nsAString& aString)
{
aString.Assign(NS_LITERAL_STRING("DeleteRangeTxn"));
aString.AssignLiteral("DeleteRangeTxn");
return NS_OK;
}

View File

@ -140,7 +140,7 @@ NS_IMETHODIMP DeleteTextTxn::Merge(nsITransaction *aTransaction, PRBool *aDidMer
NS_IMETHODIMP DeleteTextTxn::GetTxnDescription(nsAString& aString)
{
aString.Assign(NS_LITERAL_STRING("DeleteTextTxn: "));
aString.AssignLiteral("DeleteTextTxn: ");
aString += mDeletedText;
return NS_OK;
}

View File

@ -141,7 +141,7 @@ NS_IMETHODIMP EditAggregateTxn::Merge(nsITransaction *aTransaction, PRBool *aDid
NS_IMETHODIMP EditAggregateTxn::GetTxnDescription(nsAString& aString)
{
aString.Assign(NS_LITERAL_STRING("EditAggregateTxn: "));
aString.AssignLiteral("EditAggregateTxn: ");
if (mName)
{

View File

@ -77,7 +77,7 @@ NS_IMETHODIMP EditTxn::Merge(nsITransaction *aTransaction, PRBool *aDidMerge)
NS_IMETHODIMP EditTxn::GetTxnDescription(nsAString& aString)
{
aString.Assign(NS_LITERAL_STRING("EditTxn"));
aString.AssignLiteral("EditTxn");
return NS_OK;
}

View File

@ -191,7 +191,7 @@ NS_IMETHODIMP IMETextTxn::MarkFixed(void)
NS_IMETHODIMP IMETextTxn::GetTxnDescription(nsAString& aString)
{
aString.Assign(NS_LITERAL_STRING("IMETextTxn: "));
aString.AssignLiteral("IMETextTxn: ");
aString += mStringToInsert;
return NS_OK;
}

View File

@ -157,6 +157,6 @@ NS_IMETHODIMP InsertElementTxn::Merge(nsITransaction *aTransaction, PRBool *aDid
NS_IMETHODIMP InsertElementTxn::GetTxnDescription(nsAString& aString)
{
aString.Assign(NS_LITERAL_STRING("InsertElementTxn"));
aString.AssignLiteral("InsertElementTxn");
return NS_OK;
}

View File

@ -210,7 +210,7 @@ NS_IMETHODIMP InsertTextTxn::Merge(nsITransaction *aTransaction, PRBool *aDidMer
NS_IMETHODIMP InsertTextTxn::GetTxnDescription(nsAString& aString)
{
aString.Assign(NS_LITERAL_STRING("InsertTextTxn: "));
aString.AssignLiteral("InsertTextTxn: ");
aString += mStringToInsert;
return NS_OK;
}

View File

@ -178,6 +178,6 @@ nsresult JoinElementTxn::Merge(nsITransaction *aTransaction, PRBool *aDidMerge)
NS_IMETHODIMP JoinElementTxn::GetTxnDescription(nsAString& aString)
{
aString.Assign(NS_LITERAL_STRING("JoinElementTxn"));
aString.AssignLiteral("JoinElementTxn");
return NS_OK;
}

Some files were not shown because too many files have changed in this diff Show More