diff options
Diffstat (limited to 'WebCore/bindings/js/JSStyleSheetCustom.cpp')
-rw-r--r-- | WebCore/bindings/js/JSStyleSheetCustom.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/WebCore/bindings/js/JSStyleSheetCustom.cpp b/WebCore/bindings/js/JSStyleSheetCustom.cpp index f8146bd..43249dc 100644 --- a/WebCore/bindings/js/JSStyleSheetCustom.cpp +++ b/WebCore/bindings/js/JSStyleSheetCustom.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -35,7 +35,7 @@ using namespace JSC; namespace WebCore { -JSValue toJS(ExecState* exec, StyleSheet* styleSheet) +JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, StyleSheet* styleSheet) { if (!styleSheet) return jsNull(); @@ -45,16 +45,16 @@ JSValue toJS(ExecState* exec, StyleSheet* styleSheet) return wrapper; if (styleSheet->isCSSStyleSheet()) - wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, CSSStyleSheet, styleSheet); + wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, CSSStyleSheet, styleSheet); else - wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, StyleSheet, styleSheet); + wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, StyleSheet, styleSheet); return wrapper; } -void JSStyleSheet::mark() +void JSStyleSheet::markChildren(MarkStack& markStack) { - Base::mark(); + Base::markChildren(markStack); // 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 @@ -62,10 +62,8 @@ void JSStyleSheet::mark() // 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 (JSNode* ownerNodeWrapper = getCachedDOMNodeWrapper(ownerNode->document(), ownerNode)) { - if (!ownerNodeWrapper->marked()) - ownerNodeWrapper->mark(); - } + if (JSNode* ownerNodeWrapper = getCachedDOMNodeWrapper(ownerNode->document(), ownerNode)) + markStack.append(ownerNodeWrapper); } } |