void JSCSSRule::markChildren(MarkStack& markStack)
{
    Base::markChildren(markStack);

    if (CSSStyleSheet* parentStyleSheet = impl()->parentStyleSheet())
        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), parentStyleSheet);

    if (CSSRule* parentRule = impl()->parentRule())
        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), parentRule);
}
void JSMessageChannel::markChildren(MarkStack& markStack)
{
    Base::markChildren(markStack);

    if (MessagePort* port = m_impl->port1())
        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), port);

    if (MessagePort* port = m_impl->port2())
        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), port);
}
void JSDocument::markChildren(MarkStack& markStack)
{
    JSNode::markChildren(markStack);

    Document* document = impl();
    JSGlobalData& globalData = *Heap::heap(this)->globalData();

    markDOMNodesForDocument(markStack, document);
    markActiveObjectsForContext(markStack, globalData, document);
    markDOMObjectWrapper(markStack, globalData, document->implementation());
    markDOMObjectWrapper(markStack, globalData, document->styleSheets());
}
Beispiel #4
0
void JSWorkerContext::markChildren(MarkStack& markStack)
{
    Base::markChildren(markStack);

    JSGlobalData& globalData = *this->globalData();

    markActiveObjectsForContext(markStack, globalData, scriptExecutionContext());

    markDOMObjectWrapper(markStack, globalData, impl()->optionalLocation());
    markDOMObjectWrapper(markStack, globalData, impl()->optionalNavigator());

    impl()->markJSEventListeners(markStack);
}
void JSHTMLStyleElement::markChildren(MarkStack& markStack)
{
    Base::markChildren(markStack);

    if (StyleSheet* sheet = static_cast<HTMLStyleElement*>(impl())->sheet())
        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), sheet);
}
void JSSharedWorker::markChildren(MarkStack& markStack)
{
    Base::markChildren(markStack);

    if (MessagePort* port = impl()->port())
        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), port);
}
void JSCSSStyleDeclaration::markChildren(MarkStack& markStack)
{
    Base::markChildren(markStack);

    CSSStyleDeclaration* declaration = impl();
    JSGlobalData& globalData = *Heap::heap(this)->globalData();

    if (CSSRule* parentRule = declaration->parentRule())
        markDOMObjectWrapper(markStack, globalData, parentRule);

    if (declaration->isMutableStyleDeclaration()) {
        CSSMutableStyleDeclaration* mutableDeclaration = static_cast<CSSMutableStyleDeclaration*>(declaration);
        CSSMutableStyleDeclaration::const_iterator end = mutableDeclaration->end();
        for (CSSMutableStyleDeclaration::const_iterator it = mutableDeclaration->begin(); it != end; ++it)
            markDOMObjectWrapper(markStack, globalData, it->value());
    }
}
void JSXMLHttpRequest::markChildren(MarkStack& markStack)
{
    Base::markChildren(markStack);

    if (XMLHttpRequestUpload* upload = m_impl->optionalUpload())
        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), upload);

    m_impl->markJSEventListeners(markStack);
}
void JSXMLHttpRequestUpload::markChildren(MarkStack& markStack)
{
    Base::markChildren(markStack);

    if (XMLHttpRequest* xmlHttpRequest = m_impl->associatedXMLHttpRequest())
        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), xmlHttpRequest);

    m_impl->markEventListeners(markStack);
}
void JSHTMLCanvasElement::markChildren(MarkStack& markStack)
{
    Base::markChildren(markStack);

    HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(impl());
    JSGlobalData& globalData = *Heap::heap(this)->globalData();

    markDOMObjectWrapper(markStack, globalData, canvas->renderingContext());
}
void JSMessagePort::markChildren(MarkStack& markStack)
{
    Base::markChildren(markStack);

    // If we have a locally entangled port, we can directly mark it as reachable. Ports that are remotely entangled are marked in-use by markActiveObjectsForContext().
    if (MessagePort* entangledPort = m_impl->locallyEntangledPort())
        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), entangledPort);

    m_impl->markJSEventListeners(markStack);
}
void JSStyleSheetList::markChildren(MarkStack& markStack)
{
    Base::markChildren(markStack);

    StyleSheetList* list = impl();
    JSGlobalData& globalData = *Heap::heap(this)->globalData();

    unsigned length = list->length();
    for (unsigned i = 0; i < length; ++i)
        markDOMObjectWrapper(markStack, globalData, list->item(i));
}
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 = sheet->ownerNode())
        markDOMNodeWrapper(markStack, ownerNode->document(), ownerNode);
}
void JSDOMWindow::markChildren(MarkStack& markStack)
{
    Base::markChildren(markStack);

    impl()->markJSEventListeners(markStack);

    JSGlobalData& globalData = *Heap::heap(this)->globalData();

    markDOMObjectWrapper(markStack, globalData, impl()->optionalConsole());
    markDOMObjectWrapper(markStack, globalData, impl()->optionalHistory());
    markDOMObjectWrapper(markStack, globalData, impl()->optionalLocationbar());
    markDOMObjectWrapper(markStack, globalData, impl()->optionalMenubar());
    markDOMObjectWrapper(markStack, globalData, impl()->optionalNavigator());
    markDOMObjectWrapper(markStack, globalData, impl()->optionalPersonalbar());
    markDOMObjectWrapper(markStack, globalData, impl()->optionalScreen());
    markDOMObjectWrapper(markStack, globalData, impl()->optionalScrollbars());
    markDOMObjectWrapper(markStack, globalData, impl()->optionalSelection());
    markDOMObjectWrapper(markStack, globalData, impl()->optionalStatusbar());
    markDOMObjectWrapper(markStack, globalData, impl()->optionalToolbar());
    markDOMObjectWrapper(markStack, globalData, impl()->optionalLocation());
    markDOMObjectWrapper(markStack, globalData, impl()->optionalMedia());
#if ENABLE(DOM_STORAGE)
    markDOMObjectWrapper(markStack, globalData, impl()->optionalSessionStorage());
    markDOMObjectWrapper(markStack, globalData, impl()->optionalLocalStorage());
#endif
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
    markDOMObjectWrapper(markStack, globalData, impl()->optionalApplicationCache());
#endif
}