Ignore:
Timestamp:
Sep 25, 2013, 2:13:38 PM (12 years ago)
Author:
[email protected]
Message:

Tie the life of DocumentStyleSheetCollection and Document together
https://bugs.webkit.org/show_bug.cgi?id=121892

Reviewed by Andreas Kling.

DocumentStyleSheetCollection had an odd destruction pattern for no apparent reason.

The two objects strictly depend on eachother, this patch make that explicit by making
DocumentStyleSheetCollection a plain object in Document's memory space.

  • css/CSSStyleSheet.cpp:

(WebCore::CSSStyleSheet::didMutateRules):

  • css/DocumentRuleSets.cpp:

(WebCore::DocumentRuleSets::initUserStyle):

  • css/DocumentRuleSets.h:
  • css/InspectorCSSOMWrappers.cpp:

(WebCore::InspectorCSSOMWrappers::collectFromDocumentStyleSheetCollection):
(WebCore::InspectorCSSOMWrappers::getWrapperForRuleInSheets):

  • css/InspectorCSSOMWrappers.h:
  • css/SelectorChecker.cpp:

(WebCore::SelectorChecker::matchRecursively):
(WebCore::SelectorChecker::checkOne):

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::StyleResolver):

  • css/StyleSheetList.cpp:

(WebCore::StyleSheetList::styleSheets):
(WebCore::StyleSheetList::detachFromDocument):

  • dom/Document.cpp:

(WebCore::Document::Document):
(WebCore::Document::~Document):
(WebCore::Document::setCompatibilityMode):
(WebCore::Document::recalcStyle):
(WebCore::Document::createStyleResolver):
(WebCore::Document::processHttpEquiv):
(WebCore::Document::preferredStylesheetSet):
(WebCore::Document::selectedStylesheetSet):
(WebCore::Document::setSelectedStylesheetSet):
(WebCore::Document::scheduleOptimizedStyleSheetUpdate):
(WebCore::Document::styleResolverChanged):
(WebCore::Document::haveStylesheetsLoaded):

  • dom/Document.h:

(WebCore::Document::styleSheetCollection):

  • dom/DocumentStyleSheetCollection.cpp:

(WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
(WebCore::DocumentStyleSheetCollection::combineCSSFeatureFlags):
(WebCore::DocumentStyleSheetCollection::resetCSSFeatureFlags):
(WebCore::DocumentStyleSheetCollection::pageUserSheet):
(WebCore::DocumentStyleSheetCollection::clearPageUserSheet):
(WebCore::DocumentStyleSheetCollection::updatePageUserSheet):
(WebCore::DocumentStyleSheetCollection::updateInjectedStyleSheetCache):
(WebCore::DocumentStyleSheetCollection::invalidateInjectedStyleSheetCache):
(WebCore::DocumentStyleSheetCollection::addAuthorSheet):
(WebCore::DocumentStyleSheetCollection::addUserSheet):
(WebCore::DocumentStyleSheetCollection::removePendingSheet):
(WebCore::DocumentStyleSheetCollection::addStyleSheetCandidateNode):
(WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
(WebCore::DocumentStyleSheetCollection::analyzeStyleSheetChange):
(WebCore::collectActiveCSSStyleSheetsFromSeamlessParents):
(WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):

  • dom/DocumentStyleSheetCollection.h:
  • dom/Element.cpp:

(WebCore::Element::createPseudoElementIfNeeded):

  • dom/InlineStyleSheetOwner.cpp:

(WebCore::InlineStyleSheetOwner::insertedIntoDocument):
(WebCore::InlineStyleSheetOwner::removedFromDocument):
(WebCore::InlineStyleSheetOwner::clearDocumentData):
(WebCore::InlineStyleSheetOwner::createSheet):
(WebCore::InlineStyleSheetOwner::sheetLoaded):
(WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):

  • dom/ProcessingInstruction.cpp:

(WebCore::ProcessingInstruction::~ProcessingInstruction):
(WebCore::ProcessingInstruction::checkStyleSheet):
(WebCore::ProcessingInstruction::sheetLoaded):
(WebCore::ProcessingInstruction::insertedInto):
(WebCore::ProcessingInstruction::removedFrom):

  • 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):

  • inspector/InspectorCSSAgent.cpp:

(WebCore::InspectorCSSAgent::willMatchRule):

  • inspector/InspectorCSSAgent.h:
  • inspector/InspectorInstrumentation.cpp:

(WebCore::InspectorInstrumentation::willMatchRuleImpl):

  • inspector/InspectorInstrumentation.h:

(WebCore::InspectorInstrumentation::willMatchRule):

  • mathml/MathMLMathElement.cpp:

(WebCore::MathMLMathElement::insertedInto):

  • page/Page.cpp:

(WebCore::Page::userStyleSheetLocationChanged):

  • page/PageGroup.cpp:

(WebCore::PageGroup::invalidateInjectedStyleSheetCacheInAllFrames):

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::lineHeight):
(WebCore::RenderBlock::updateFirstLetter):

  • rendering/RenderInline.cpp:

(WebCore::RenderInline::updateAlwaysCreateLineBoxes):
(WebCore::RenderInline::lineHeight):

  • rendering/RenderLineBreak.cpp:

(WebCore::RenderLineBreak::lineHeight):

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::uncachedFirstLineStyle):
(WebCore::RenderObject::cachedFirstLineStyle):

  • rendering/RenderObject.h:

(WebCore::RenderObject::firstLineStyle):

  • rendering/RootInlineBox.cpp:

(WebCore::RootInlineBox::verticalPositionForBox):

  • style/StyleResolveTree.cpp:

(WebCore::Style::resolveLocal):

  • testing/Internals.cpp:

(WebCore::Internals::insertAuthorCSS):
(WebCore::Internals::insertUserCSS):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r156334 r156422  
    223223        || (flowThread && flowThread->hasRegionsWithStyling());
    224224
    225     if (!alwaysCreateLineBoxes && checkFonts && document().styleSheetCollection()->usesFirstLineRules()) {
     225    if (!alwaysCreateLineBoxes && checkFonts && document().styleSheetCollection().usesFirstLineRules()) {
    226226        // Have to check the first line style as well.
    227227        parentStyle = parent()->style(true);
     
    13521352LayoutUnit RenderInline::lineHeight(bool firstLine, LineDirectionMode /*direction*/, LinePositionMode /*linePositionMode*/) const
    13531353{
    1354     if (firstLine && document().styleSheetCollection()->usesFirstLineRules()) {
     1354    if (firstLine && document().styleSheetCollection().usesFirstLineRules()) {
    13551355        RenderStyle* s = style(firstLine);
    13561356        if (s != style())
Note: See TracChangeset for help on using the changeset viewer.