Changeset 74260 in webkit


Ignore:
Timestamp:
Dec 17, 2010 6:39:13 AM (13 years ago)
Author:
antonm@chromium.org
Message:

2010-12-17 Anton Muhin <antonm@chromium.org>

Reviewed by Yury Semikhatsky.

[v8] The last portion of CSS GC work: fixing fast/dom/StyleSheet/gc-stylesheet-wrapper.html
https://bugs.webkit.org/show_bug.cgi?id=51121

Properly group style elements of HTML links, style elements and processing instructions.

  • bindings/v8/V8GCController.cpp: (WebCore::NodeGrouperVisitor::visitDOMWrapper): (WebCore::NodeGrouperVisitor::addDOMObjectToGroup):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r74259 r74260  
     12010-12-17  Anton Muhin  <antonm@chromium.org>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        [v8] The last portion of CSS GC work: fixing fast/dom/StyleSheet/gc-stylesheet-wrapper.html
     6        https://bugs.webkit.org/show_bug.cgi?id=51121
     7
     8        Properly group style elements of HTML links, style elements and processing instructions.
     9
     10        * bindings/v8/V8GCController.cpp:
     11        (WebCore::NodeGrouperVisitor::visitDOMWrapper):
     12        (WebCore::NodeGrouperVisitor::addDOMObjectToGroup):
     13
    1142010-12-17  Pavel Podivilov  <podivilov@chromium.org>
    215
  • trunk/WebCore/bindings/v8/V8GCController.cpp

    r74106 r74260  
    5151#include "V8CSSStyleSheet.h"
    5252#include "V8DOMMap.h"
     53#include "V8HTMLLinkElement.h"
     54#include "V8HTMLStyleElement.h"
    5355#include "V8MessagePort.h"
     56#include "V8ProcessingInstruction.h"
    5457#include "V8Proxy.h"
    5558#include "V8StyleSheetList.h"
     
    330333        if (node->isStyledElement()) {
    331334            StyledElement* element = reinterpret_cast<StyledElement*>(node);
    332             CSSStyleDeclaration* style = element->inlineStyleDecl();
    333             if (style) {
    334                 wrapper = store->domObjectMap().get(style);
    335                 if (!wrapper.IsEmpty())
    336                     m_grouper.append(GrouperItem(groupId, wrapper));
    337             }
     335            addDOMObjectToGroup(store, groupId, element->inlineStyleDecl());
    338336        }
    339337
    340338        if (node->isDocumentNode()) {
    341339            Document* document = reinterpret_cast<Document*>(node);
    342             wrapper = store->domObjectMap().get(document->styleSheets());
    343             if (!wrapper.IsEmpty())
    344                 m_grouper.append(GrouperItem(groupId, wrapper));
     340            addDOMObjectToGroup(store, groupId, document->styleSheets());
     341        }
     342
     343        WrapperTypeInfo* typeInfo = V8DOMWrapper::domWrapperType(wrapper);
     344
     345        if (V8HTMLLinkElement::info.equals(typeInfo)) {
     346            HTMLLinkElement* htmlLinkElement = static_cast<HTMLLinkElement*>(node);
     347            addDOMObjectToGroup(store, groupId, htmlLinkElement->sheet());
     348        }
     349
     350        if (V8HTMLStyleElement::info.equals(typeInfo)) {
     351            HTMLStyleElement* htmlStyleElement = static_cast<HTMLStyleElement*>(node);
     352            addDOMObjectToGroup(store, groupId, htmlStyleElement->sheet());
     353        }
     354
     355        if (V8ProcessingInstruction::info.equals(typeInfo)) {
     356            ProcessingInstruction* processingInstruction = static_cast<ProcessingInstruction*>(node);
     357            addDOMObjectToGroup(store, groupId, processingInstruction->sheet());
    345358        }
    346359    }
     
    353366private:
    354367    GrouperList m_grouper;
     368
     369    void addDOMObjectToGroup(DOMDataStore* store, uintptr_t groupId, void* object)
     370    {
     371        if (!object)
     372            return;
     373        v8::Persistent<v8::Object> wrapper = store->domObjectMap().get(object);
     374        if (!wrapper.IsEmpty())
     375            m_grouper.append(GrouperItem(groupId, wrapper));
     376    }
    355377};
    356378
Note: See TracChangeset for help on using the changeset viewer.