зеркало из https://github.com/mozilla/pjs.git
Squish a warning or two
This commit is contained in:
Родитель
767a166bd7
Коммит
ef095efd3a
|
@ -37,9 +37,7 @@ nsGenericDOMNodeList::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID);
|
||||
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
|
||||
if (aIID.Equals(kIDOMNodeListIID)) {
|
||||
*aInstancePtr = (void*)(nsIDOMNodeList*)this;
|
||||
AddRef();
|
||||
|
|
|
@ -1642,15 +1642,15 @@ nsGenericContainerElement::ReplaceChild(nsIDOMNode* aNewChild,
|
|||
}
|
||||
nsIContent* content = nsnull;
|
||||
nsresult res = aOldChild->QueryInterface(kIContentIID, (void**)&content);
|
||||
NS_ASSERTION(NS_OK == res, "Must be an nsIContent");
|
||||
if (NS_OK == res) {
|
||||
NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent");
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
PRInt32 pos;
|
||||
IndexOf(content, pos);
|
||||
if (pos >= 0) {
|
||||
nsIContent* newContent = nsnull;
|
||||
nsresult res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent);
|
||||
NS_ASSERTION(NS_OK == res, "Must be an nsIContent");
|
||||
if (NS_OK == res) {
|
||||
res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent);
|
||||
NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent");
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
// Check if this is a document fragment. If it is, we need
|
||||
// to remove the children of the document fragment and add them
|
||||
// individually (i.e. we don't add the actual document fragment).
|
||||
|
@ -1660,7 +1660,7 @@ nsGenericContainerElement::ReplaceChild(nsIDOMNode* aNewChild,
|
|||
|
||||
nsIContent* docFragContent;
|
||||
res = aNewChild->QueryInterface(kIContentIID, (void **)&docFragContent);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
PRInt32 count;
|
||||
|
||||
docFragContent->ChildCount(count);
|
||||
|
@ -1670,9 +1670,9 @@ nsGenericContainerElement::ReplaceChild(nsIDOMNode* aNewChild,
|
|||
// Remove the last child of the document fragment
|
||||
// and do a replace with it
|
||||
res = docFragContent->ChildAt(count-1, childContent);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
res = docFragContent->RemoveChildAt(count-1, PR_FALSE);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
SetDocumentInChildrenOf(childContent, mDocument);
|
||||
res = ReplaceChildAt(childContent, pos, PR_TRUE);
|
||||
// If there are more children, then insert them before
|
||||
|
@ -1682,11 +1682,11 @@ nsGenericContainerElement::ReplaceChild(nsIDOMNode* aNewChild,
|
|||
|
||||
res = childContent->QueryInterface(kIDOMNodeIID,
|
||||
(void **)&childNode);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
nsIDOMNode* rv;
|
||||
|
||||
res = InsertBefore(aNewChild, childNode, &rv);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
NS_IF_RELEASE(rv);
|
||||
}
|
||||
NS_RELEASE(childNode);
|
||||
|
|
|
@ -2529,25 +2529,25 @@ nsGenericHTMLContainerElement::ReplaceChild(nsIDOMNode* aNewChild,
|
|||
}
|
||||
nsIContent* content = nsnull;
|
||||
nsresult res = aOldChild->QueryInterface(kIContentIID, (void**)&content);
|
||||
NS_ASSERTION(NS_OK == res, "Must be an nsIContent");
|
||||
if (NS_OK == res) {
|
||||
NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent");
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
PRInt32 pos;
|
||||
IndexOf(content, pos);
|
||||
if (pos >= 0) {
|
||||
nsIContent* newContent = nsnull;
|
||||
nsresult res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent);
|
||||
NS_ASSERTION(NS_OK == res, "Must be an nsIContent");
|
||||
if (NS_OK == res) {
|
||||
res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent);
|
||||
NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent");
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
// Check if this is a document fragment. If it is, we need
|
||||
// to remove the children of the document fragment and add them
|
||||
// individually (i.e. we don't add the actual document fragment).
|
||||
nsIDOMDocumentFragment* docFrag = nsnull;
|
||||
if (NS_OK == aNewChild->QueryInterface(kIDOMDocumentFragmentIID,
|
||||
(void **)&docFrag)) {
|
||||
if (NS_SUCCEEDED(aNewChild->QueryInterface(kIDOMDocumentFragmentIID,
|
||||
(void **)&docFrag))) {
|
||||
|
||||
nsIContent* docFragContent;
|
||||
res = aNewChild->QueryInterface(kIContentIID, (void **)&docFragContent);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
PRInt32 count;
|
||||
|
||||
docFragContent->ChildCount(count);
|
||||
|
@ -2557,23 +2557,23 @@ nsGenericHTMLContainerElement::ReplaceChild(nsIDOMNode* aNewChild,
|
|||
// Remove the last child of the document fragment
|
||||
// and do a replace with it
|
||||
res = docFragContent->ChildAt(count-1, childContent);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
res = docFragContent->RemoveChildAt(count-1, PR_FALSE);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
SetDocumentInChildrenOf(childContent, mDocument);
|
||||
res = ReplaceChildAt(childContent, pos, PR_TRUE);
|
||||
// If there are more children, then insert them before
|
||||
// the newly replaced child
|
||||
if ((NS_OK == res) && (count > 1)) {
|
||||
if ((NS_SUCCEEDED(res)) && (count > 1)) {
|
||||
nsIDOMNode* childNode = nsnull;
|
||||
|
||||
res = childContent->QueryInterface(kIDOMNodeIID,
|
||||
(void **)&childNode);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
nsIDOMNode* rv;
|
||||
|
||||
res = InsertBefore(aNewChild, childNode, &rv);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
NS_IF_RELEASE(rv);
|
||||
}
|
||||
NS_RELEASE(childNode);
|
||||
|
@ -2593,7 +2593,7 @@ nsGenericHTMLContainerElement::ReplaceChild(nsIDOMNode* aNewChild,
|
|||
else {
|
||||
nsIContent* oldParent;
|
||||
res = newContent->GetParent(oldParent);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
// Remove the element from the old parent if one exists
|
||||
if (nsnull != oldParent) {
|
||||
PRInt32 index;
|
||||
|
@ -2639,8 +2639,8 @@ nsGenericHTMLContainerElement::RemoveChild(nsIDOMNode* aOldChild,
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsresult res = aOldChild->QueryInterface(kIContentIID, (void**)&content);
|
||||
NS_ASSERTION(NS_OK == res, "Must be an nsIContent");
|
||||
if (NS_OK == res) {
|
||||
NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent");
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
PRInt32 pos;
|
||||
IndexOf(content, pos);
|
||||
if (pos >= 0) {
|
||||
|
|
|
@ -1073,8 +1073,8 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes,
|
|||
|
||||
if (nsnull!=aAttributes)
|
||||
{
|
||||
float p2t;
|
||||
aPresContext->GetScaledPixelsToTwips(&p2t);
|
||||
float sp2t;
|
||||
aPresContext->GetScaledPixelsToTwips(&sp2t);
|
||||
nsHTMLValue value;
|
||||
|
||||
const nsStyleDisplay* readDisplay = (nsStyleDisplay*)
|
||||
|
@ -1116,7 +1116,7 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes,
|
|||
break;
|
||||
|
||||
case eHTMLUnit_Pixel:
|
||||
position->mWidth.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t));
|
||||
position->mWidth.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -1134,14 +1134,15 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes,
|
|||
break;
|
||||
|
||||
case eHTMLUnit_Pixel:
|
||||
position->mHeight.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t));
|
||||
position->mHeight.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
nsStyleSpacing* spacing = (nsStyleSpacing*)aContext->GetMutableStyleData(eStyleStruct_Spacing);
|
||||
nsStyleSpacing* spacing = (nsStyleSpacing*)
|
||||
aContext->GetMutableStyleData(eStyleStruct_Spacing);
|
||||
|
||||
// default border style is the quirks outset
|
||||
PRUint8 borderStyle = NS_STYLE_BORDER_STYLE_BG_OUTSET;
|
||||
|
@ -1165,8 +1166,6 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes,
|
|||
aAttributes->GetAttribute(nsHTMLAtoms::align, value);
|
||||
if (value.GetUnit() == eHTMLUnit_Enumerated) {
|
||||
if (NS_STYLE_TEXT_ALIGN_CENTER == value.GetIntValue()) {
|
||||
nsStyleSpacing* spacing = (nsStyleSpacing*)
|
||||
aContext->GetMutableStyleData(eStyleStruct_Spacing);
|
||||
nsStyleCoord otto(eStyleUnit_Auto);
|
||||
spacing->mMargin.SetLeft(otto);
|
||||
spacing->mMargin.SetRight(otto);
|
||||
|
@ -1199,7 +1198,7 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes,
|
|||
if (value.GetUnit() == eHTMLUnit_Pixel) {
|
||||
if (nsnull==tableStyle)
|
||||
tableStyle = (nsStyleTable*)aContext->GetMutableStyleData(eStyleStruct_Table);
|
||||
tableStyle->mCellPadding.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t));
|
||||
tableStyle->mCellPadding.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t));
|
||||
}
|
||||
|
||||
// cellspacing (reuses tableStyle if already resolved)
|
||||
|
@ -1208,8 +1207,8 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes,
|
|||
if (value.GetUnit() == eHTMLUnit_Pixel) {
|
||||
if (nsnull==tableStyle)
|
||||
tableStyle = (nsStyleTable*)aContext->GetMutableStyleData(eStyleStruct_Table);
|
||||
tableStyle->mBorderSpacingX.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t));
|
||||
tableStyle->mBorderSpacingY.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t));
|
||||
tableStyle->mBorderSpacingX.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t));
|
||||
tableStyle->mBorderSpacingY.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t));
|
||||
}
|
||||
|
||||
// cols
|
||||
|
|
|
@ -75,7 +75,6 @@
|
|||
static char kNameSpaceSeparator = ':';
|
||||
static char kNameSpaceDef[] = "xmlns";
|
||||
static char kStyleSheetPI[] = "xml-stylesheet";
|
||||
static char kCSSType[] = "text/css";
|
||||
|
||||
#ifdef XSL
|
||||
static char kXSLType[] = "text/xsl";
|
||||
|
@ -457,14 +456,14 @@ GetAttributeValueAt(const nsIParserNode& aNode,
|
|||
PRBool ok = PR_FALSE;
|
||||
PRInt32 slen = aResult.Length();
|
||||
while ((index < slen) && (cp < limit)) {
|
||||
PRUnichar e = aResult.CharAt(index);
|
||||
if (e == ';') {
|
||||
PRUnichar ch = aResult.CharAt(index);
|
||||
if (ch == ';') {
|
||||
index++;
|
||||
ok = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
if ((e >= '0') && (e <= '9')) {
|
||||
*cp++ = char(e);
|
||||
if ((ch >= '0') && (ch <= '9')) {
|
||||
*cp++ = char(ch);
|
||||
index++;
|
||||
continue;
|
||||
}
|
||||
|
@ -498,16 +497,16 @@ GetAttributeValueAt(const nsIParserNode& aNode,
|
|||
PRBool ok = PR_FALSE;
|
||||
PRInt32 slen = aResult.Length();
|
||||
while ((index < slen) && (cp < limit)) {
|
||||
PRUnichar e = aResult.CharAt(index);
|
||||
if (e == ';') {
|
||||
PRUnichar ch = aResult.CharAt(index);
|
||||
if (ch == ';') {
|
||||
index++;
|
||||
ok = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
if (((e >= '0') && (e <= '9')) ||
|
||||
((e >= 'A') && (e <= 'Z')) ||
|
||||
((e >= 'a') && (e <= 'z'))) {
|
||||
*cp++ = char(e);
|
||||
if (((ch >= '0') && (ch <= '9')) ||
|
||||
((ch >= 'A') && (ch <= 'Z')) ||
|
||||
((ch >= 'a') && (ch <= 'z'))) {
|
||||
*cp++ = char(ch);
|
||||
index++;
|
||||
continue;
|
||||
}
|
||||
|
@ -1607,7 +1606,7 @@ nsXMLContentSink::StartLayout()
|
|||
|
||||
// Get initial scroll preference and save it away; disable the
|
||||
// scroll bars.
|
||||
PRInt32 i, ns = mDocument->GetNumberOfShells();
|
||||
ns = mDocument->GetNumberOfShells();
|
||||
for (i = 0; i < ns; i++) {
|
||||
nsIPresShell* shell = mDocument->GetShellAt(i);
|
||||
if (nsnull != shell) {
|
||||
|
@ -1679,8 +1678,8 @@ nsXMLContentSink::EvaluateScript(nsString& aScript, PRUint32 aLineNo)
|
|||
nsAutoString val;
|
||||
PRBool isUndefined;
|
||||
|
||||
nsresult result = context->EvaluateString(aScript, url, aLineNo,
|
||||
val, &isUndefined);
|
||||
(void) context->EvaluateString(aScript, url, aLineNo,
|
||||
val, &isUndefined);
|
||||
|
||||
NS_IF_RELEASE(docURL);
|
||||
|
||||
|
|
|
@ -448,15 +448,15 @@ nsXMLDocument::CreateElementWithNameSpace(const nsString& aTagName,
|
|||
const nsString& aNameSpace,
|
||||
nsIDOMElement** aReturn)
|
||||
{
|
||||
PRInt32 nsID = kNameSpaceID_None;
|
||||
PRInt32 namespaceID = kNameSpaceID_None;
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
if ((0 < aNameSpace.Length() && (nsnull != mNameSpaceManager))) {
|
||||
mNameSpaceManager->GetNameSpaceID(aNameSpace, nsID);
|
||||
mNameSpaceManager->GetNameSpaceID(aNameSpace, namespaceID);
|
||||
}
|
||||
|
||||
nsIContent* content;
|
||||
if (nsID == kNameSpaceID_HTML) {
|
||||
if (namespaceID == kNameSpaceID_HTML) {
|
||||
nsIHTMLContent* htmlContent;
|
||||
|
||||
rv = NS_CreateHTMLElement(&htmlContent, aTagName);
|
||||
|
@ -470,7 +470,7 @@ nsXMLDocument::CreateElementWithNameSpace(const nsString& aTagName,
|
|||
rv = NS_NewXMLElement(&xmlContent, tag);
|
||||
NS_RELEASE(tag);
|
||||
if (NS_OK == rv) {
|
||||
xmlContent->SetNameSpaceID(nsID);
|
||||
xmlContent->SetNameSpaceID(namespaceID);
|
||||
}
|
||||
content = (nsIXMLContent*)xmlContent;
|
||||
}
|
||||
|
|
|
@ -37,9 +37,7 @@ nsGenericDOMNodeList::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID);
|
||||
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
|
||||
if (aIID.Equals(kIDOMNodeListIID)) {
|
||||
*aInstancePtr = (void*)(nsIDOMNodeList*)this;
|
||||
AddRef();
|
||||
|
|
|
@ -1642,15 +1642,15 @@ nsGenericContainerElement::ReplaceChild(nsIDOMNode* aNewChild,
|
|||
}
|
||||
nsIContent* content = nsnull;
|
||||
nsresult res = aOldChild->QueryInterface(kIContentIID, (void**)&content);
|
||||
NS_ASSERTION(NS_OK == res, "Must be an nsIContent");
|
||||
if (NS_OK == res) {
|
||||
NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent");
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
PRInt32 pos;
|
||||
IndexOf(content, pos);
|
||||
if (pos >= 0) {
|
||||
nsIContent* newContent = nsnull;
|
||||
nsresult res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent);
|
||||
NS_ASSERTION(NS_OK == res, "Must be an nsIContent");
|
||||
if (NS_OK == res) {
|
||||
res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent);
|
||||
NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent");
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
// Check if this is a document fragment. If it is, we need
|
||||
// to remove the children of the document fragment and add them
|
||||
// individually (i.e. we don't add the actual document fragment).
|
||||
|
@ -1660,7 +1660,7 @@ nsGenericContainerElement::ReplaceChild(nsIDOMNode* aNewChild,
|
|||
|
||||
nsIContent* docFragContent;
|
||||
res = aNewChild->QueryInterface(kIContentIID, (void **)&docFragContent);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
PRInt32 count;
|
||||
|
||||
docFragContent->ChildCount(count);
|
||||
|
@ -1670,9 +1670,9 @@ nsGenericContainerElement::ReplaceChild(nsIDOMNode* aNewChild,
|
|||
// Remove the last child of the document fragment
|
||||
// and do a replace with it
|
||||
res = docFragContent->ChildAt(count-1, childContent);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
res = docFragContent->RemoveChildAt(count-1, PR_FALSE);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
SetDocumentInChildrenOf(childContent, mDocument);
|
||||
res = ReplaceChildAt(childContent, pos, PR_TRUE);
|
||||
// If there are more children, then insert them before
|
||||
|
@ -1682,11 +1682,11 @@ nsGenericContainerElement::ReplaceChild(nsIDOMNode* aNewChild,
|
|||
|
||||
res = childContent->QueryInterface(kIDOMNodeIID,
|
||||
(void **)&childNode);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
nsIDOMNode* rv;
|
||||
|
||||
res = InsertBefore(aNewChild, childNode, &rv);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
NS_IF_RELEASE(rv);
|
||||
}
|
||||
NS_RELEASE(childNode);
|
||||
|
|
|
@ -2529,25 +2529,25 @@ nsGenericHTMLContainerElement::ReplaceChild(nsIDOMNode* aNewChild,
|
|||
}
|
||||
nsIContent* content = nsnull;
|
||||
nsresult res = aOldChild->QueryInterface(kIContentIID, (void**)&content);
|
||||
NS_ASSERTION(NS_OK == res, "Must be an nsIContent");
|
||||
if (NS_OK == res) {
|
||||
NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent");
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
PRInt32 pos;
|
||||
IndexOf(content, pos);
|
||||
if (pos >= 0) {
|
||||
nsIContent* newContent = nsnull;
|
||||
nsresult res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent);
|
||||
NS_ASSERTION(NS_OK == res, "Must be an nsIContent");
|
||||
if (NS_OK == res) {
|
||||
res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent);
|
||||
NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent");
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
// Check if this is a document fragment. If it is, we need
|
||||
// to remove the children of the document fragment and add them
|
||||
// individually (i.e. we don't add the actual document fragment).
|
||||
nsIDOMDocumentFragment* docFrag = nsnull;
|
||||
if (NS_OK == aNewChild->QueryInterface(kIDOMDocumentFragmentIID,
|
||||
(void **)&docFrag)) {
|
||||
if (NS_SUCCEEDED(aNewChild->QueryInterface(kIDOMDocumentFragmentIID,
|
||||
(void **)&docFrag))) {
|
||||
|
||||
nsIContent* docFragContent;
|
||||
res = aNewChild->QueryInterface(kIContentIID, (void **)&docFragContent);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
PRInt32 count;
|
||||
|
||||
docFragContent->ChildCount(count);
|
||||
|
@ -2557,23 +2557,23 @@ nsGenericHTMLContainerElement::ReplaceChild(nsIDOMNode* aNewChild,
|
|||
// Remove the last child of the document fragment
|
||||
// and do a replace with it
|
||||
res = docFragContent->ChildAt(count-1, childContent);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
res = docFragContent->RemoveChildAt(count-1, PR_FALSE);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
SetDocumentInChildrenOf(childContent, mDocument);
|
||||
res = ReplaceChildAt(childContent, pos, PR_TRUE);
|
||||
// If there are more children, then insert them before
|
||||
// the newly replaced child
|
||||
if ((NS_OK == res) && (count > 1)) {
|
||||
if ((NS_SUCCEEDED(res)) && (count > 1)) {
|
||||
nsIDOMNode* childNode = nsnull;
|
||||
|
||||
res = childContent->QueryInterface(kIDOMNodeIID,
|
||||
(void **)&childNode);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
nsIDOMNode* rv;
|
||||
|
||||
res = InsertBefore(aNewChild, childNode, &rv);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
NS_IF_RELEASE(rv);
|
||||
}
|
||||
NS_RELEASE(childNode);
|
||||
|
@ -2593,7 +2593,7 @@ nsGenericHTMLContainerElement::ReplaceChild(nsIDOMNode* aNewChild,
|
|||
else {
|
||||
nsIContent* oldParent;
|
||||
res = newContent->GetParent(oldParent);
|
||||
if (NS_OK == res) {
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
// Remove the element from the old parent if one exists
|
||||
if (nsnull != oldParent) {
|
||||
PRInt32 index;
|
||||
|
@ -2639,8 +2639,8 @@ nsGenericHTMLContainerElement::RemoveChild(nsIDOMNode* aOldChild,
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsresult res = aOldChild->QueryInterface(kIContentIID, (void**)&content);
|
||||
NS_ASSERTION(NS_OK == res, "Must be an nsIContent");
|
||||
if (NS_OK == res) {
|
||||
NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent");
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
PRInt32 pos;
|
||||
IndexOf(content, pos);
|
||||
if (pos >= 0) {
|
||||
|
|
|
@ -1073,8 +1073,8 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes,
|
|||
|
||||
if (nsnull!=aAttributes)
|
||||
{
|
||||
float p2t;
|
||||
aPresContext->GetScaledPixelsToTwips(&p2t);
|
||||
float sp2t;
|
||||
aPresContext->GetScaledPixelsToTwips(&sp2t);
|
||||
nsHTMLValue value;
|
||||
|
||||
const nsStyleDisplay* readDisplay = (nsStyleDisplay*)
|
||||
|
@ -1116,7 +1116,7 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes,
|
|||
break;
|
||||
|
||||
case eHTMLUnit_Pixel:
|
||||
position->mWidth.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t));
|
||||
position->mWidth.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -1134,14 +1134,15 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes,
|
|||
break;
|
||||
|
||||
case eHTMLUnit_Pixel:
|
||||
position->mHeight.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t));
|
||||
position->mHeight.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
nsStyleSpacing* spacing = (nsStyleSpacing*)aContext->GetMutableStyleData(eStyleStruct_Spacing);
|
||||
nsStyleSpacing* spacing = (nsStyleSpacing*)
|
||||
aContext->GetMutableStyleData(eStyleStruct_Spacing);
|
||||
|
||||
// default border style is the quirks outset
|
||||
PRUint8 borderStyle = NS_STYLE_BORDER_STYLE_BG_OUTSET;
|
||||
|
@ -1165,8 +1166,6 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes,
|
|||
aAttributes->GetAttribute(nsHTMLAtoms::align, value);
|
||||
if (value.GetUnit() == eHTMLUnit_Enumerated) {
|
||||
if (NS_STYLE_TEXT_ALIGN_CENTER == value.GetIntValue()) {
|
||||
nsStyleSpacing* spacing = (nsStyleSpacing*)
|
||||
aContext->GetMutableStyleData(eStyleStruct_Spacing);
|
||||
nsStyleCoord otto(eStyleUnit_Auto);
|
||||
spacing->mMargin.SetLeft(otto);
|
||||
spacing->mMargin.SetRight(otto);
|
||||
|
@ -1199,7 +1198,7 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes,
|
|||
if (value.GetUnit() == eHTMLUnit_Pixel) {
|
||||
if (nsnull==tableStyle)
|
||||
tableStyle = (nsStyleTable*)aContext->GetMutableStyleData(eStyleStruct_Table);
|
||||
tableStyle->mCellPadding.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t));
|
||||
tableStyle->mCellPadding.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t));
|
||||
}
|
||||
|
||||
// cellspacing (reuses tableStyle if already resolved)
|
||||
|
@ -1208,8 +1207,8 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes,
|
|||
if (value.GetUnit() == eHTMLUnit_Pixel) {
|
||||
if (nsnull==tableStyle)
|
||||
tableStyle = (nsStyleTable*)aContext->GetMutableStyleData(eStyleStruct_Table);
|
||||
tableStyle->mBorderSpacingX.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t));
|
||||
tableStyle->mBorderSpacingY.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t));
|
||||
tableStyle->mBorderSpacingX.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t));
|
||||
tableStyle->mBorderSpacingY.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t));
|
||||
}
|
||||
|
||||
// cols
|
||||
|
|
|
@ -1469,8 +1469,8 @@ void BasicTableLayoutStrategy::Dump(PRInt32 aIndent)
|
|||
}
|
||||
indent[aIndent] = 0;
|
||||
|
||||
printf("%s**START BASIC STRATEGY DUMP** table=%X cols=%X numCols=%d",
|
||||
indent, mTableFrame, mCols, mNumCols);
|
||||
printf("%s**START BASIC STRATEGY DUMP** table=%p cols=%X numCols=%d",
|
||||
indent, mTableFrame, mCols, mNumCols);
|
||||
printf("\n%s minConWidth=%d maxConWidth=%d cellSpacing=%d propRatio=%.2f navQuirks=%d",
|
||||
indent, mMinTableContentWidth, mMaxTableContentWidth, mCellSpacingTotal, mMinToDesProportionRatio, mIsNavQuirksMode);
|
||||
printf(" **END BASIC STRATEGY DUMP** \n");
|
||||
|
|
|
@ -658,8 +658,6 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
|
|||
kidSize.width = kidReflowState.availableWidth;
|
||||
}
|
||||
if (0 == kidSize.height) {
|
||||
const nsStylePosition* pos;
|
||||
GetStyleData(eStyleStruct_Position, ((const nsStyleStruct *&)pos));
|
||||
if ((pos->mHeight.GetUnit() != eStyleUnit_Coord) &&
|
||||
(pos->mHeight.GetUnit() != eStyleUnit_Percent)) {
|
||||
// Standard mode should probably be 0 pixels high instead of 1
|
||||
|
|
|
@ -625,7 +625,6 @@ PRBool nsTableFrame::HasGroupRules() const
|
|||
// this won't work until bug 12948 is resolved and col groups are considered
|
||||
void nsTableFrame::ProcessGroupRules(nsIPresContext& aPresContext)
|
||||
{
|
||||
PRInt32 numRows = GetRowCount();
|
||||
PRInt32 numCols = GetColCount();
|
||||
|
||||
// process row groups
|
||||
|
|
|
@ -1469,8 +1469,8 @@ void BasicTableLayoutStrategy::Dump(PRInt32 aIndent)
|
|||
}
|
||||
indent[aIndent] = 0;
|
||||
|
||||
printf("%s**START BASIC STRATEGY DUMP** table=%X cols=%X numCols=%d",
|
||||
indent, mTableFrame, mCols, mNumCols);
|
||||
printf("%s**START BASIC STRATEGY DUMP** table=%p cols=%X numCols=%d",
|
||||
indent, mTableFrame, mCols, mNumCols);
|
||||
printf("\n%s minConWidth=%d maxConWidth=%d cellSpacing=%d propRatio=%.2f navQuirks=%d",
|
||||
indent, mMinTableContentWidth, mMaxTableContentWidth, mCellSpacingTotal, mMinToDesProportionRatio, mIsNavQuirksMode);
|
||||
printf(" **END BASIC STRATEGY DUMP** \n");
|
||||
|
|
|
@ -658,8 +658,6 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
|
|||
kidSize.width = kidReflowState.availableWidth;
|
||||
}
|
||||
if (0 == kidSize.height) {
|
||||
const nsStylePosition* pos;
|
||||
GetStyleData(eStyleStruct_Position, ((const nsStyleStruct *&)pos));
|
||||
if ((pos->mHeight.GetUnit() != eStyleUnit_Coord) &&
|
||||
(pos->mHeight.GetUnit() != eStyleUnit_Percent)) {
|
||||
// Standard mode should probably be 0 pixels high instead of 1
|
||||
|
|
|
@ -625,7 +625,6 @@ PRBool nsTableFrame::HasGroupRules() const
|
|||
// this won't work until bug 12948 is resolved and col groups are considered
|
||||
void nsTableFrame::ProcessGroupRules(nsIPresContext& aPresContext)
|
||||
{
|
||||
PRInt32 numRows = GetRowCount();
|
||||
PRInt32 numCols = GetColCount();
|
||||
|
||||
// process row groups
|
||||
|
|
|
@ -75,7 +75,6 @@
|
|||
static char kNameSpaceSeparator = ':';
|
||||
static char kNameSpaceDef[] = "xmlns";
|
||||
static char kStyleSheetPI[] = "xml-stylesheet";
|
||||
static char kCSSType[] = "text/css";
|
||||
|
||||
#ifdef XSL
|
||||
static char kXSLType[] = "text/xsl";
|
||||
|
@ -457,14 +456,14 @@ GetAttributeValueAt(const nsIParserNode& aNode,
|
|||
PRBool ok = PR_FALSE;
|
||||
PRInt32 slen = aResult.Length();
|
||||
while ((index < slen) && (cp < limit)) {
|
||||
PRUnichar e = aResult.CharAt(index);
|
||||
if (e == ';') {
|
||||
PRUnichar ch = aResult.CharAt(index);
|
||||
if (ch == ';') {
|
||||
index++;
|
||||
ok = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
if ((e >= '0') && (e <= '9')) {
|
||||
*cp++ = char(e);
|
||||
if ((ch >= '0') && (ch <= '9')) {
|
||||
*cp++ = char(ch);
|
||||
index++;
|
||||
continue;
|
||||
}
|
||||
|
@ -498,16 +497,16 @@ GetAttributeValueAt(const nsIParserNode& aNode,
|
|||
PRBool ok = PR_FALSE;
|
||||
PRInt32 slen = aResult.Length();
|
||||
while ((index < slen) && (cp < limit)) {
|
||||
PRUnichar e = aResult.CharAt(index);
|
||||
if (e == ';') {
|
||||
PRUnichar ch = aResult.CharAt(index);
|
||||
if (ch == ';') {
|
||||
index++;
|
||||
ok = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
if (((e >= '0') && (e <= '9')) ||
|
||||
((e >= 'A') && (e <= 'Z')) ||
|
||||
((e >= 'a') && (e <= 'z'))) {
|
||||
*cp++ = char(e);
|
||||
if (((ch >= '0') && (ch <= '9')) ||
|
||||
((ch >= 'A') && (ch <= 'Z')) ||
|
||||
((ch >= 'a') && (ch <= 'z'))) {
|
||||
*cp++ = char(ch);
|
||||
index++;
|
||||
continue;
|
||||
}
|
||||
|
@ -1607,7 +1606,7 @@ nsXMLContentSink::StartLayout()
|
|||
|
||||
// Get initial scroll preference and save it away; disable the
|
||||
// scroll bars.
|
||||
PRInt32 i, ns = mDocument->GetNumberOfShells();
|
||||
ns = mDocument->GetNumberOfShells();
|
||||
for (i = 0; i < ns; i++) {
|
||||
nsIPresShell* shell = mDocument->GetShellAt(i);
|
||||
if (nsnull != shell) {
|
||||
|
@ -1679,8 +1678,8 @@ nsXMLContentSink::EvaluateScript(nsString& aScript, PRUint32 aLineNo)
|
|||
nsAutoString val;
|
||||
PRBool isUndefined;
|
||||
|
||||
nsresult result = context->EvaluateString(aScript, url, aLineNo,
|
||||
val, &isUndefined);
|
||||
(void) context->EvaluateString(aScript, url, aLineNo,
|
||||
val, &isUndefined);
|
||||
|
||||
NS_IF_RELEASE(docURL);
|
||||
|
||||
|
|
|
@ -448,15 +448,15 @@ nsXMLDocument::CreateElementWithNameSpace(const nsString& aTagName,
|
|||
const nsString& aNameSpace,
|
||||
nsIDOMElement** aReturn)
|
||||
{
|
||||
PRInt32 nsID = kNameSpaceID_None;
|
||||
PRInt32 namespaceID = kNameSpaceID_None;
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
if ((0 < aNameSpace.Length() && (nsnull != mNameSpaceManager))) {
|
||||
mNameSpaceManager->GetNameSpaceID(aNameSpace, nsID);
|
||||
mNameSpaceManager->GetNameSpaceID(aNameSpace, namespaceID);
|
||||
}
|
||||
|
||||
nsIContent* content;
|
||||
if (nsID == kNameSpaceID_HTML) {
|
||||
if (namespaceID == kNameSpaceID_HTML) {
|
||||
nsIHTMLContent* htmlContent;
|
||||
|
||||
rv = NS_CreateHTMLElement(&htmlContent, aTagName);
|
||||
|
@ -470,7 +470,7 @@ nsXMLDocument::CreateElementWithNameSpace(const nsString& aTagName,
|
|||
rv = NS_NewXMLElement(&xmlContent, tag);
|
||||
NS_RELEASE(tag);
|
||||
if (NS_OK == rv) {
|
||||
xmlContent->SetNameSpaceID(nsID);
|
||||
xmlContent->SetNameSpaceID(namespaceID);
|
||||
}
|
||||
content = (nsIXMLContent*)xmlContent;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче