[Webkit-unassigned] [Bug 97504] Don't use StyleSheetList internally

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 24 20:23:12 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=97504





--- Comment #2 from Ryosuke Niwa <rniwa at webkit.org>  2012-09-24 20:23:39 PST ---
(From update of attachment 165484)
View in context: https://bugs.webkit.org/attachment.cgi?id=165484&action=review

> Source/WebCore/ChangeLog:10
> +        Also hot rid of the StyleSheetVector typedef as Vector<RefPtr<StyleSheet> > is less opaque and not much longer.

Typo: hot rid of

> Source/WebCore/dom/Document.cpp:3201
> +    if (!m_authorStyleSheetList)
> +        m_authorStyleSheetList = StyleSheetList::create(this);
> +    return m_authorStyleSheetList.get();

So now we wouldn't create StyleSheetList until it's used by scripts? I think that should be explained in the change log.
Doesn't this imply that if the author did
document.styleSheets.foo = 'bar';
gc(); // Force GC here.
alert(document.styleSheets.foo); // would give us "undefined"?

> Source/WebCore/dom/Document.h:1322
>      OwnPtr<DocumentStyleSheetCollection> m_styleSheetCollection;
> +    RefPtr<StyleSheetList> m_authorStyleSheetList;

This change of ownership of m_authorStyleSheetList should be explained in the change log.

> Source/WebCore/dom/DocumentStyleSheetCollection.cpp:461
> -    m_authorStyleSheets->swap(newStylesheets);
> +    m_authorStyleSheets = newStylesheets;

Why do we not want to swap?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list