From bde08ec16b2724751c3773ddacc8c1a151f5c672 Mon Sep 17 00:00:00 2001 From: "asqueella@gmail.com" Date: Sat, 24 Mar 2007 22:20:29 -0700 Subject: [PATCH] fix bug 369828 - html/svg:style sheets don't work in XUL documents(the fix is to special-case these elements in nsXULDocument::ResumeWalkand manually call UpdateStylesheet on them after the element and its subtreeis fully constructed and inserted into the document)r=bz, sr=peterv --- content/xul/document/src/nsXULDocument.cpp | 13 +++++++++++++ layout/reftests/xul-document-load/readme.txt | 2 ++ layout/reftests/xul-document-load/reftest.list | 1 + layout/reftests/xul-document-load/test022.xul | 14 ++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 layout/reftests/xul-document-load/test022.xul diff --git a/content/xul/document/src/nsXULDocument.cpp b/content/xul/document/src/nsXULDocument.cpp index b1da8e6f796..f4e7cd3d3c5 100644 --- a/content/xul/document/src/nsXULDocument.cpp +++ b/content/xul/document/src/nsXULDocument.cpp @@ -2868,6 +2868,19 @@ nsXULDocument::ResumeWalk() // resolved.) if (mState == eState_Master) { AddElementToDocumentPost(element); + + if (element->NodeInfo()->Equals(nsGkAtoms::style, + kNameSpaceID_XHTML) || + element->NodeInfo()->Equals(nsGkAtoms::style, + kNameSpaceID_SVG)) { + // XXX sucks that we have to do this - + // see bug 370111 + nsCOMPtr ssle = + do_QueryInterface(element); + NS_ASSERTION(ssle, " doesn't implement " + "nsIStyleSheetLinkingElement?"); + ssle->UpdateStyleSheet(nsnull, nsnull); + } } #ifdef MOZ_XTF diff --git a/layout/reftests/xul-document-load/readme.txt b/layout/reftests/xul-document-load/readme.txt index e01a3c7cceb..638a2bc242a 100644 --- a/layout/reftests/xul-document-load/readme.txt +++ b/layout/reftests/xul-document-load/readme.txt @@ -59,3 +59,5 @@ test020: Same as #018 for test021: (bug 363419) Non-XUL elements directly underneath should be merged correctly into the base document. + +test022: (bug 369828) works in XUL documents diff --git a/layout/reftests/xul-document-load/reftest.list b/layout/reftests/xul-document-load/reftest.list index 3ac4707e7e7..a20fae6787c 100644 --- a/layout/reftests/xul-document-load/reftest.list +++ b/layout/reftests/xul-document-load/reftest.list @@ -19,3 +19,4 @@ == test019.xul reference-green-window.xul == test020.xul reference-green-window.xul == test021.xul reference-green-window.xul +== test022.xul reference-green-window.xul diff --git a/layout/reftests/xul-document-load/test022.xul b/layout/reftests/xul-document-load/test022.xul new file mode 100644 index 00000000000..b440ed49490 --- /dev/null +++ b/layout/reftests/xul-document-load/test022.xul @@ -0,0 +1,14 @@ + + + + + + window { + background-color: green !important; + } + + +