Split stylesheet related code out from Document
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2012 22:14:47 +0000 (22:14 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2012 22:14:47 +0000 (22:14 +0000)
commit017bb5973ab4e608a9e5dfa71736f17df323bc03
tree1ef2dc3fbe3908415e3795562a13d59321aad5a7
parentea48782256b3f08d7f630ba655c4cac5a1fd152d
Split stylesheet related code out from Document
https://bugs.webkit.org/show_bug.cgi?id=97353

Reviewed by Andreas Kling.

Document is big and unwieldy. The code related to tracking active stylesheets can be factored out.

The patch moves stylesheet upkeep, collection and invalidation code from Document to a separate
DocumentStyleSheetCollection class. There are no functional changes.

The usesLinkRules stylesheet feature bit and the related code is removed as no one was using it.

* WebCore.xcodeproj/project.pbxproj:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOneSelector):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):
(WebCore::StyleResolver::Features::Features):
(WebCore::StyleResolver::Features::add):
(WebCore::StyleResolver::Features::clear):
(WebCore::StyleResolver::collectMatchingRulesForList):
* css/StyleResolver.h:
(WebCore::StyleResolver::usesBeforeAfterRules):
(Features):
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::~Document):
(WebCore::Document::setCompatibilityMode):
(WebCore::Document::recalcStyle):
(WebCore):
(WebCore::Document::createStyleResolver):
(WebCore::Document::seamlessParentUpdatedStylesheets):
(WebCore::Document::didRemoveAllPendingStylesheet):
(WebCore::Document::processHttpEquiv):
(WebCore::Document::styleSheets):
(WebCore::Document::preferredStylesheetSet):
(WebCore::Document::selectedStylesheetSet):
(WebCore::Document::setSelectedStylesheetSet):
(WebCore::Document::styleResolverChanged):
(WebCore::Document::reportMemoryUsage):
(WebCore::Document::haveStylesheetsLoaded):
* dom/Document.h:
(WebCore):
(Document):
(WebCore::Document::styleSheetCollection):
(WebCore::Document::hasNodesWithPlaceholderStyle):
(WebCore::Document::setNeedsNotifyRemoveAllPendingStylesheet):
(WebCore::Document::inStyleRecalc):
* dom/DocumentStyleSheetCollection.cpp: Added.
(WebCore):
(WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
(WebCore::DocumentStyleSheetCollection::~DocumentStyleSheetCollection):
(WebCore::DocumentStyleSheetCollection::pageUserSheet):
(WebCore::DocumentStyleSheetCollection::clearPageUserSheet):
(WebCore::DocumentStyleSheetCollection::updatePageUserSheet):
(WebCore::DocumentStyleSheetCollection::pageGroupUserSheets):
(WebCore::DocumentStyleSheetCollection::clearPageGroupUserSheets):
(WebCore::DocumentStyleSheetCollection::updatePageGroupUserSheets):
(WebCore::DocumentStyleSheetCollection::addUserSheet):
(WebCore::DocumentStyleSheetCollection::removePendingSheet):
(WebCore::DocumentStyleSheetCollection::addStyleSheetCandidateNode):
(WebCore::DocumentStyleSheetCollection::removeStyleSheetCandidateNode):
(WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
(WebCore::DocumentStyleSheetCollection::testAddedStyleSheetRequiresStyleRecalc):
(WebCore::DocumentStyleSheetCollection::analyzeStyleSheetChange):
(WebCore::styleSheetsUseRemUnits):
(WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
(WebCore::DocumentStyleSheetCollection::combineCSSFeatureFlags):
(WebCore::DocumentStyleSheetCollection::resetCSSFeatureFlags):
(WebCore::DocumentStyleSheetCollection::reportMemoryUsage):
* dom/DocumentStyleSheetCollection.h: Added.
(WebCore):
(DocumentStyleSheetCollection):
(WebCore::DocumentStyleSheetCollection::authorStyleSheets):
(WebCore::DocumentStyleSheetCollection::documentUserSheets):
(WebCore::DocumentStyleSheetCollection::needsUpdateActiveStylesheetsOnStyleRecalc):
(WebCore::DocumentStyleSheetCollection::preferredStylesheetSetName):
(WebCore::DocumentStyleSheetCollection::selectedStylesheetSetName):
(WebCore::DocumentStyleSheetCollection::setPreferredStylesheetSetName):
(WebCore::DocumentStyleSheetCollection::setSelectedStylesheetSetName):
(WebCore::DocumentStyleSheetCollection::addPendingSheet):
(WebCore::DocumentStyleSheetCollection::hasPendingSheets):
(WebCore::DocumentStyleSheetCollection::usesSiblingRules):
(WebCore::DocumentStyleSheetCollection::setUsesSiblingRulesOverride):
(WebCore::DocumentStyleSheetCollection::usesFirstLineRules):
(WebCore::DocumentStyleSheetCollection::usesFirstLetterRules):
(WebCore::DocumentStyleSheetCollection::setUsesFirstLetterRules):
(WebCore::DocumentStyleSheetCollection::usesBeforeAfterRules):
(WebCore::DocumentStyleSheetCollection::setUsesBeforeAfterRulesOverride):
(WebCore::DocumentStyleSheetCollection::usesRemUnits):
(WebCore::DocumentStyleSheetCollection::setUsesRemUnit):
* dom/Element.cpp:
(WebCore::Element::recalcStyle):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::~ProcessingInstruction):
(WebCore::ProcessingInstruction::checkStyleSheet):
(WebCore::ProcessingInstruction::sheetLoaded):
(WebCore::ProcessingInstruction::insertedInto):
(WebCore::ProcessingInstruction::removedFrom):
* dom/StyleElement.cpp:
(WebCore::StyleElement::insertedIntoDocument):
(WebCore::StyleElement::removedFromDocument):
(WebCore::StyleElement::clearDocumentData):
(WebCore::StyleElement::createSheet):
(WebCore::StyleElement::sheetLoaded):
(WebCore::StyleElement::startLoadingDynamicSheet):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::~HTMLLinkElement):
(WebCore::HTMLLinkElement::insertedInto):
(WebCore::HTMLLinkElement::removedFrom):
(WebCore::HTMLLinkElement::addPendingSheet):
(WebCore::HTMLLinkElement::removePendingSheet):
* html/HTMLQuoteElement.cpp:
(WebCore::HTMLQuoteElement::insertedInto):
* html/HTMLViewSourceDocument.cpp:
(WebCore::HTMLViewSourceDocument::HTMLViewSourceDocument):
* mathml/MathMLMathElement.cpp:
(WebCore::MathMLMathElement::insertedInto):
* page/Page.cpp:
(WebCore::Page::userStyleSheetLocationChanged):
* page/PageGroup.cpp:
(WebCore::PageGroup::resetUserStyleCacheInAllFrames):
* rendering/RenderBR.cpp:
(WebCore::RenderBR::lineHeight):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::styleDidChange):
(WebCore::RenderBlock::splitBlocks):
(WebCore::RenderBlock::addChildIgnoringAnonymousColumnBlocks):
(WebCore::RenderBlock::lineHeight):
(WebCore::RenderBlock::updateFirstLetter):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::styleDidChange):
(WebCore::RenderInline::updateAlwaysCreateLineBoxes):
(WebCore::RenderInline::addChildIgnoringContinuation):
(WebCore::RenderInline::splitInlines):
(WebCore::RenderInline::lineHeight):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::uncachedFirstLineStyle):
(WebCore::RenderObject::firstLineStyleSlowCase):
* rendering/RenderObject.h:
(WebCore::RenderObject::firstLineStyle):
* rendering/RenderObjectChildList.cpp:
(WebCore::RenderObjectChildList::updateBeforeAfterContent):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::updateBeforeAndAfterContent):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::verticalPositionForBox):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129423 268f45cc-cd09-0410-ab3c-d52691b4dbfc
32 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/SelectorChecker.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleResolver.h
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/DocumentStyleSheetCollection.cpp [new file with mode: 0644]
Source/WebCore/dom/DocumentStyleSheetCollection.h [new file with mode: 0644]
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/ProcessingInstruction.cpp
Source/WebCore/dom/StyleElement.cpp
Source/WebCore/html/HTMLLinkElement.cpp
Source/WebCore/html/HTMLQuoteElement.cpp
Source/WebCore/html/HTMLViewSourceDocument.cpp
Source/WebCore/mathml/MathMLMathElement.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/PageGroup.cpp
Source/WebCore/rendering/RenderBR.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RenderObjectChildList.cpp
Source/WebCore/rendering/RenderTableRow.cpp
Source/WebCore/rendering/RootInlineBox.cpp
Source/WebKit/chromium/src/WebDocument.cpp