summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/js/JSStyleSheetCustom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/js/JSStyleSheetCustom.cpp')
-rw-r--r--WebCore/bindings/js/JSStyleSheetCustom.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/WebCore/bindings/js/JSStyleSheetCustom.cpp b/WebCore/bindings/js/JSStyleSheetCustom.cpp
index 43249dc..d711b6f 100644
--- a/WebCore/bindings/js/JSStyleSheetCustom.cpp
+++ b/WebCore/bindings/js/JSStyleSheetCustom.cpp
@@ -56,12 +56,19 @@ void JSStyleSheet::markChildren(MarkStack& markStack)
{
Base::markChildren(markStack);
+ StyleSheet* sheet = impl();
+ JSGlobalData& globalData = *Heap::heap(this)->globalData();
+
+ unsigned length = sheet->length();
+ for (unsigned i = 0; i < length; ++i)
+ markDOMObjectWrapper(markStack, globalData, sheet->item(i));
+
// This prevents us from having a style sheet with a dangling ownerNode pointer.
// A better solution would be to handle this on the DOM side -- if the style sheet
// is kept around, then we want the node to stay around too. One possibility would
// be to make ref/deref on the style sheet ref/deref the node instead, but there's
// a lot of disentangling of the CSS DOM objects that would need to happen first.
- if (Node* ownerNode = impl()->ownerNode()) {
+ if (Node* ownerNode = sheet->ownerNode()) {
if (JSNode* ownerNodeWrapper = getCachedDOMNodeWrapper(ownerNode->document(), ownerNode))
markStack.append(ownerNodeWrapper);
}