Bug 729044 - Avoid nsIParserService in nsFind. r=bzbarsky.

This commit is contained in:
Henri Sivonen 2012-03-28 12:11:56 +03:00
parent 32145c2ed9
commit 5090eda0f2
2 changed files with 2 additions and 12 deletions

View File

@ -55,13 +55,13 @@
#include "nsTextFragment.h"
#include "nsString.h"
#include "nsIAtom.h"
#include "nsParserCIID.h"
#include "nsServiceManagerUtils.h"
#include "nsUnicharUtils.h"
#include "nsIDOMElement.h"
#include "nsIWordBreaker.h"
#include "nsCRT.h"
#include "nsRange.h"
#include "nsContentUtils.h"
// Yikes! Casting a char to unichar can fill with ones!
#define CHAR_TO_UNICHAR(c) ((PRUnichar)(const unsigned char)c)
@ -786,15 +786,7 @@ bool nsFind::IsBlockNode(nsIContent* aContent)
atom == sTdAtom)
return true;
if (!mParserService) {
mParserService = do_GetService(NS_PARSERSERVICE_CONTRACTID);
if (!mParserService)
return false;
}
bool isBlock = false;
mParserService->IsBlock(mParserService->HTMLAtomTagToId(atom), isBlock);
return isBlock;
return nsContentUtils::IsHTMLBlock(atom);
}
bool nsFind::IsTextNode(nsIDOMNode* aNode)

View File

@ -45,7 +45,6 @@
#include "nsIDOMNode.h"
#include "nsIDOMRange.h"
#include "nsIContentIterator.h"
#include "nsIParserService.h"
#include "nsIWordBreaker.h"
class nsIAtom;
@ -89,7 +88,6 @@ protected:
bool mCaseSensitive;
nsCOMPtr<nsIWordBreaker> mWordBreaker;
nsCOMPtr<nsIParserService> mParserService;
PRInt32 mIterOffset;
nsCOMPtr<nsIDOMNode> mIterNode;