Fix init of HTML documents to set the right case-sensitivity on the CSS parser

even for XSLT.  Bug 322461, r+sr=jst
This commit is contained in:
bzbarsky%mit.edu 2006-01-06 02:53:10 +00:00
Родитель e01f8de8d2
Коммит a60c40ba69
2 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -321,7 +321,8 @@ IdAndNameHashInitEntry(PLDHashTable *table, PLDHashEntryHdr *entry,
// bother initializing members to 0. // bother initializing members to 0.
nsHTMLDocument::nsHTMLDocument() nsHTMLDocument::nsHTMLDocument()
: mCompatMode(eCompatibility_NavQuirks) : mCompatMode(eCompatibility_NavQuirks),
mDefaultNamespaceID(kNameSpaceID_None)
{ {
// NOTE! nsDocument::operator new() zeroes out all members, so don't // NOTE! nsDocument::operator new() zeroes out all members, so don't
@ -356,6 +357,12 @@ nsHTMLDocument::Init()
nsresult rv = nsDocument::Init(); nsresult rv = nsDocument::Init();
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
// Now reset the case-sensitivity of the CSSLoader, since we default
// to being HTML, not XHTML. Also, reset the compatibility mode to
// match our compat mode.
CSSLoader()->SetCaseSensitive(IsXHTML());
CSSLoader()->SetCompatibilityMode(mCompatMode);
static PLDHashTableOps hash_table_ops = static PLDHashTableOps hash_table_ops =
{ {
PL_DHashAllocTable, PL_DHashAllocTable,

Просмотреть файл

@ -347,6 +347,8 @@ protected:
// kNameSpaceID_None for good ol' HTML documents, and // kNameSpaceID_None for good ol' HTML documents, and
// kNameSpaceID_XHTML for spiffy new XHTML documents. // kNameSpaceID_XHTML for spiffy new XHTML documents.
// XXXbz should this be reset if someone manually calls
// SetContentType() on this document?
PRInt32 mDefaultNamespaceID; PRInt32 mDefaultNamespaceID;
}; };