Checking in Fabian's <hidday@geocities.com> patch for bug 105640. Add support for IE's document.compatMode property. r=sicking@bigfoot.com, sr=jst@netscape.com

This commit is contained in:
jst%netscape.com 2001-11-10 07:36:19 +00:00
Родитель 467e4478b4
Коммит 1ab806d0b3
2 изменённых файлов: 22 добавлений и 0 удалений

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

@ -3051,6 +3051,26 @@ nsHTMLDocument::RouteEvent(nsIDOMEvent* aEvt)
return NS_OK;
}
// readonly attribute DOMString compatMode;
// Returns "BackCompat" if we are in quirks mode,
// "CSS1Compat" if we are in strict mode. See bug 105640.
// This was implemented to match MSIE's compatMode property
NS_IMETHODIMP
nsHTMLDocument::GetCompatMode(nsAWritableString& aCompatMode)
{
aCompatMode.Truncate();
NS_ASSERTION((mDTDMode == eDTDMode_quirks) || (mDTDMode == eDTDMode_strict),
"mDTDMode is neither quirks nor strict for this document");
if (mDTDMode == eDTDMode_quirks) {
aCompatMode.Assign(NS_LITERAL_STRING("BackCompat"));
} else {
aCompatMode.Assign(NS_LITERAL_STRING("CSS1Compat"));
}
return NS_OK;
}
static PRBool PR_CALLBACK
NameHashCleanupEnumeratorCallback(nsHashKey *aKey, void *aData, void* closure)
{

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

@ -64,4 +64,6 @@ interface nsIDOMNSHTMLDocument : nsISupports
void captureEvents(in long eventFlags);
void releaseEvents(in long eventFlags);
void routeEvent(in nsIDOMEvent evt);
readonly attribute DOMString compatMode;
};