Don't use StyleSheetList internally.
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Sep 2012 04:25:35 +0000 (04:25 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Sep 2012 04:25:35 +0000 (04:25 +0000)
commitad58d8bef0e534c1684f3c29afeb281556fc2b05
tree3809c7b6d8906958fc9f8eb2c19ae5f65fb082c1
parenta7880094f5e7c9284cded344f427bbe31bf699e4
Don't use StyleSheetList internally.
https://bugs.webkit.org/show_bug.cgi?id=97504

Reviewed by Ryosuke Niwa.

StyleSheetList is a DOM type and should not be used internally. Use plain Vector instead and construct StyleSheetList on DOM access only.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):
(WebCore::StyleResolver::addStylesheetsFromSeamlessParents):
(WebCore::StyleResolver::collectMatchingRulesForList):
* css/StyleSheetList.cpp:
(WebCore::StyleSheetList::StyleSheetList):
(WebCore::StyleSheetList::styleSheets):
(WebCore):
(WebCore::StyleSheetList::detachFromDocument):

    Use live stylesheet vector of the documents stylesheet collection as long as we are attached to a document.
    When detached copy the stylesheet vector to a member field and use that instead.

(WebCore::StyleSheetList::length):
(WebCore::StyleSheetList::item):
(WebCore::StyleSheetList::getNamedItem):
* css/StyleSheetList.h:

    Removed StyleSheetVector typedef as Vector<RefPtr<StyleSheet> > is less opaque and not much longer.

(WebCore):
(WebCore::StyleSheetList::create):
(StyleSheetList):
(WebCore::StyleSheetList::document):
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::setCompatibilityMode):
(WebCore::Document::styleSheets):
* dom/Document.h:
(Document):
* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
(WebCore::DocumentStyleSheetCollection::~DocumentStyleSheetCollection):
(WebCore::DocumentStyleSheetCollection::analyzeStyleSheetChange):
(WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
* dom/DocumentStyleSheetCollection.h:
(WebCore::DocumentStyleSheetCollec

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129452 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleSheetList.cpp
Source/WebCore/css/StyleSheetList.h
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/DocumentStyleSheetCollection.cpp
Source/WebCore/dom/DocumentStyleSheetCollection.h