зеркало из https://github.com/mozilla/gecko-dev.git
69826 - Flush conten model to access named items
Fixed an assertion. Added a few more properties for getComputedStyle and did some clean up. r=heikki, sr=jst
This commit is contained in:
Родитель
a3d777a1b7
Коммит
f32dd60ff9
|
@ -3116,6 +3116,11 @@ nsHTMLDocument::NamedItem(JSContext* cx, jsval* argv, PRUint32 argc,
|
|||
// a depth-first search rather than build up a table.
|
||||
// Obviously, this may be inefficient for large documents.
|
||||
if (nsnull != mParser) {
|
||||
|
||||
// Bug 69826 - Make sure to flush the content model if
|
||||
// the document is still loading.
|
||||
FlushPendingNotifications(PR_FALSE);
|
||||
|
||||
content = FindNamedItem(mRootContent, name, PR_FALSE);
|
||||
}
|
||||
else {
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -580,7 +580,7 @@ nsresult nsHTMLTokenizer::ConsumeAttributes(PRUnichar aChar,CStartToken* aToken,
|
|||
const nsAReadableString& key=theToken->GetKey();
|
||||
const nsAReadableString& text=theToken->GetValue();
|
||||
// support XML like syntax to fix bugs like 44186
|
||||
if((kForwardSlash==key.First()) && (0==text.Length())){
|
||||
if(!key.IsEmpty() && kForwardSlash==key.CharAt(0) && text.IsEmpty()) {
|
||||
aToken->SetEmpty(PR_TRUE);
|
||||
isUsableAttr=!mDoXMLEmptyTags;
|
||||
}
|
||||
|
|
|
@ -35,6 +35,8 @@ class nsIParserService : public nsISupports {
|
|||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPARSERSERVICE_IID)
|
||||
|
||||
NS_IMETHOD HTMLAtomTagToId(nsIAtom* aAtom, PRInt32* aId) const=0;
|
||||
|
||||
NS_IMETHOD HTMLStringTagToId(const nsString &aTag, PRInt32* aId) const =0;
|
||||
|
||||
NS_IMETHOD HTMLIdToStringTag(PRInt32 aId, nsString& aTag) const =0;
|
||||
|
|
|
@ -52,6 +52,8 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD HTMLAtomTagToId(nsIAtom* aAtom, PRInt32* aId) const;
|
||||
|
||||
NS_IMETHOD HTMLStringTagToId(const nsString &aTag, PRInt32* aId) const;
|
||||
|
||||
NS_IMETHOD HTMLIdToStringTag(PRInt32 aId, nsString& aTag) const;
|
||||
|
@ -75,6 +77,19 @@ nsParserService::~nsParserService()
|
|||
|
||||
NS_IMPL_ISUPPORTS(nsParserService, kIParserServiceIID)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsParserService::HTMLAtomTagToId(nsIAtom* aAtom, PRInt32* aId) const
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aAtom);
|
||||
|
||||
nsAutoString tagName;
|
||||
aAtom->ToString(tagName);
|
||||
*aId = nsHTMLTags::LookupTag(tagName);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsParserService::HTMLStringTagToId(const nsString &aTag, PRInt32* aId) const
|
||||
{
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -580,7 +580,7 @@ nsresult nsHTMLTokenizer::ConsumeAttributes(PRUnichar aChar,CStartToken* aToken,
|
|||
const nsAReadableString& key=theToken->GetKey();
|
||||
const nsAReadableString& text=theToken->GetValue();
|
||||
// support XML like syntax to fix bugs like 44186
|
||||
if((kForwardSlash==key.First()) && (0==text.Length())){
|
||||
if(!key.IsEmpty() && kForwardSlash==key.CharAt(0) && text.IsEmpty()) {
|
||||
aToken->SetEmpty(PR_TRUE);
|
||||
isUsableAttr=!mDoXMLEmptyTags;
|
||||
}
|
||||
|
|
|
@ -35,6 +35,8 @@ class nsIParserService : public nsISupports {
|
|||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPARSERSERVICE_IID)
|
||||
|
||||
NS_IMETHOD HTMLAtomTagToId(nsIAtom* aAtom, PRInt32* aId) const=0;
|
||||
|
||||
NS_IMETHOD HTMLStringTagToId(const nsString &aTag, PRInt32* aId) const =0;
|
||||
|
||||
NS_IMETHOD HTMLIdToStringTag(PRInt32 aId, nsString& aTag) const =0;
|
||||
|
|
|
@ -52,6 +52,8 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD HTMLAtomTagToId(nsIAtom* aAtom, PRInt32* aId) const;
|
||||
|
||||
NS_IMETHOD HTMLStringTagToId(const nsString &aTag, PRInt32* aId) const;
|
||||
|
||||
NS_IMETHOD HTMLIdToStringTag(PRInt32 aId, nsString& aTag) const;
|
||||
|
@ -75,6 +77,19 @@ nsParserService::~nsParserService()
|
|||
|
||||
NS_IMPL_ISUPPORTS(nsParserService, kIParserServiceIID)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsParserService::HTMLAtomTagToId(nsIAtom* aAtom, PRInt32* aId) const
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aAtom);
|
||||
|
||||
nsAutoString tagName;
|
||||
aAtom->ToString(tagName);
|
||||
*aId = nsHTMLTags::LookupTag(tagName);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsParserService::HTMLStringTagToId(const nsString &aTag, PRInt32* aId) const
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче