From 4c5df9a52daf01f532df00953d17751b0dda3fab Mon Sep 17 00:00:00 2001 From: "pierre%netscape.com" Date: Wed, 29 Aug 2001 08:00:12 +0000 Subject: [PATCH] Bug 95336 "position CSS not recognized without units when element not in document". Set the parser in quirks mode when necessary in nsDOMCSSAttributeDeclaration::ParseDeclaration(). r=ianh/sr=jst/a=dbaron. --- content/html/content/src/nsGenericHTMLElement.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index 467cea971f61..f7a629a0065e 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -332,6 +332,21 @@ nsDOMCSSAttributeDeclaration::ParseDeclaration(const nsAReadableString& aDecl, decl->RemoveProperty(prop, val); } } + + nsCOMPtr nodeInfo; + mContent->GetNodeInfo(*getter_AddRefs(nodeInfo)); + if (nodeInfo) { + nsCOMPtr doc; + nodeInfo->GetDocument(*getter_AddRefs(doc)); + if (doc) { + nsCOMPtr htmlDoc(do_QueryInterface(doc)); + if (htmlDoc) { + nsDTDMode mode; + htmlDoc->GetDTDMode(mode); + cssParser->SetQuirkMode(eDTDMode_strict != mode); + } + } + } result = cssParser->ParseAndAppendDeclaration(aDecl, baseURI, decl, aParseOnlyOneDecl, &hint);