зеркало из https://github.com/mozilla/pjs.git
deCOMtaminate nsIDocument by changing methods to use return value instead of out-params, eliminating unused nsresult return values, moving some members to nsIDocument and inlining the getters/setters. Bug 222134, r=bzbarsky, sr=jst.
This commit is contained in:
Родитель
2d063297b7
Коммит
47d0b5b667
|
@ -106,13 +106,10 @@ inCSSValueSearch::SearchSync()
|
||||||
|
|
||||||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(mDocument);
|
nsCOMPtr<nsIDocument> doc = do_QueryInterface(mDocument);
|
||||||
if (doc) {
|
if (doc) {
|
||||||
PRInt32 count = 0;
|
|
||||||
// we want all the sheets, including inline style and such
|
// we want all the sheets, including inline style and such
|
||||||
doc->GetNumberOfStyleSheets(PR_TRUE, &count);
|
PRInt32 count = doc->GetNumberOfStyleSheets(PR_TRUE);
|
||||||
for (PRInt32 i = 0; i < count; i++) {
|
for (PRInt32 i = 0; i < count; i++) {
|
||||||
nsCOMPtr<nsIStyleSheet> sheet;
|
SearchStyleSheet(doc->GetStyleSheetAt(i, PR_TRUE));
|
||||||
doc->GetStyleSheetAt(i, PR_TRUE, getter_AddRefs(sheet));
|
|
||||||
SearchStyleSheet(sheet);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -219,8 +219,7 @@ inDOMUtils::GetBindingURLs(nsIDOMElement *aElement, nsISimpleEnumerator **_retva
|
||||||
if (!doc1) return NS_OK;
|
if (!doc1) return NS_OK;
|
||||||
|
|
||||||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(doc1);
|
nsCOMPtr<nsIDocument> doc = do_QueryInterface(doc1);
|
||||||
nsCOMPtr<nsIBindingManager> bindingManager;
|
nsIBindingManager *bindingManager = doc->GetBindingManager();
|
||||||
doc->GetBindingManager(getter_AddRefs(bindingManager));
|
|
||||||
if (!bindingManager) return NS_OK;
|
if (!bindingManager) return NS_OK;
|
||||||
|
|
||||||
nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
|
nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
|
||||||
|
|
|
@ -236,10 +236,7 @@ inLayoutUtils::GetBindingManagerFor(nsIDOMNode* aNode)
|
||||||
aNode->GetOwnerDocument(getter_AddRefs(domdoc));
|
aNode->GetOwnerDocument(getter_AddRefs(domdoc));
|
||||||
if (domdoc) {
|
if (domdoc) {
|
||||||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(domdoc);
|
nsCOMPtr<nsIDocument> doc = do_QueryInterface(domdoc);
|
||||||
nsCOMPtr<nsIBindingManager> bindingManager = do_QueryInterface(domdoc);
|
return doc->GetBindingManager();
|
||||||
doc->GetBindingManager(getter_AddRefs(bindingManager));
|
|
||||||
|
|
||||||
return bindingManager;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsnull;
|
return nsnull;
|
||||||
|
@ -252,10 +249,7 @@ inLayoutUtils::GetSubDocumentFor(nsIDOMNode* aNode)
|
||||||
if (content) {
|
if (content) {
|
||||||
nsCOMPtr<nsIDocument> doc = content->GetDocument();
|
nsCOMPtr<nsIDocument> doc = content->GetDocument();
|
||||||
if (doc) {
|
if (doc) {
|
||||||
nsCOMPtr<nsIDocument> sub_doc;
|
nsCOMPtr<nsIDOMDocument> domdoc(do_QueryInterface(doc->GetSubDocumentFor(content)));
|
||||||
doc->GetSubDocumentFor(content, getter_AddRefs(sub_doc));
|
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMDocument> domdoc(do_QueryInterface(sub_doc));
|
|
||||||
|
|
||||||
return domdoc;
|
return domdoc;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче