Bug 795221 part 6. Hook up xml-stylesheet PIs to cycle collect their stylesheet. r=smaug

This commit is contained in:
Boris Zbarsky 2012-10-07 22:39:09 -04:00
parent b9ca5298cb
commit 5dcae470be
3 changed files with 22 additions and 1 deletions

View File

@ -0,0 +1,6 @@
<?xml-stylesheet href="data:text/css,div {}"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<script>
document.styleSheets[0].cssRules[0].style.foo = document;
</script>
</html>

View File

@ -40,3 +40,4 @@ load 795221-1.html
load 795221-2.html
load 795221-3.html
load 795221-4.html
load 795221-5.xml

View File

@ -26,6 +26,10 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// CC
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXMLStylesheetPI,
nsXMLProcessingInstruction)
// nsIDOMNode
NS_IMETHOD SetNodeValue(const nsAString& aData);
@ -59,7 +63,7 @@ protected:
DOMCI_NODE_DATA(XMLStylesheetProcessingInstruction, nsXMLStylesheetPI)
NS_INTERFACE_TABLE_HEAD(nsXMLStylesheetPI)
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsXMLStylesheetPI)
NS_NODE_INTERFACE_TABLE4(nsXMLStylesheetPI, nsIDOMNode,
nsIDOMProcessingInstruction, nsIDOMLinkStyle,
nsIStyleSheetLinkingElement)
@ -69,6 +73,16 @@ NS_INTERFACE_MAP_END_INHERITING(nsXMLProcessingInstruction)
NS_IMPL_ADDREF_INHERITED(nsXMLStylesheetPI, nsXMLProcessingInstruction)
NS_IMPL_RELEASE_INHERITED(nsXMLStylesheetPI, nsXMLProcessingInstruction)
NS_IMPL_CYCLE_COLLECTION_CLASS(nsXMLStylesheetPI)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXMLStylesheetPI,
nsXMLProcessingInstruction)
tmp->nsStyleLinkElement::Traverse(cb);
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXMLStylesheetPI,
nsXMLProcessingInstruction)
tmp->nsStyleLinkElement::Unlink();
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
nsXMLStylesheetPI::nsXMLStylesheetPI(already_AddRefed<nsINodeInfo> aNodeInfo,
const nsAString& aData)