[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

hyatt at apple.com hyatt at apple.com
Wed Dec 22 12:39:04 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 8dd0d93e3b5608e6fc42f8bdfa989d1826af5e5f
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Aug 26 18:17:59 2010 +0000

    <rdar://problem/8302217> recalcStyles called immediately on each change when updating document-level stylesheets
    https://bugs.webkit.org/show_bug.cgi?id=36303
    
    Reviewed by Simon Fraser.
    
    Parameterize updateStyleSelector to optionally defer the forced style recalc following the rebuilding of the
    sheets used by the CSSStyleSelector.  Rename the method to styleSelectorChanged().  Add the capability to do
    a forced style recalc to the style recalc timer.
    
    * css/CSSMutableStyleDeclaration.cpp:
    (WebCore::CSSMutableStyleDeclaration::setNeedsStyleRecalc):
    * css/CSSStyleSheet.cpp:
    (WebCore::CSSStyleSheet::styleSheetChanged):
    * css/CSSVariablesDeclaration.cpp:
    (WebCore::CSSVariablesDeclaration::setNeedsStyleRecalc):
    * dom/Document.cpp:
    (WebCore::Document::Document):
    (WebCore::Document::scheduleStyleRecalc):
    (WebCore::Document::updateStyleIfNeeded):
    (WebCore::Document::updateLayoutIgnorePendingStylesheets):
    (WebCore::Document::clearPageUserSheet):
    (WebCore::Document::clearPageGroupUserSheets):
    (WebCore::Document::processHttpEquiv):
    (WebCore::Document::setSelectedStylesheetSet):
    (WebCore::Document::removePendingSheet):
    (WebCore::Document::styleSelectorChanged):
    (WebCore::Document::setInPageCache):
    * dom/Document.h:
    (WebCore::):
    * dom/ProcessingInstruction.cpp:
    (WebCore::ProcessingInstruction::removedFromDocument):
    * dom/StyleElement.cpp:
    (WebCore::StyleElement::removedFromDocument):
    * dom/XMLDocumentParser.cpp:
    (WebCore::XMLDocumentParser::end):
    * dom/XMLDocumentParserLibxml2.cpp:
    (WebCore::XMLDocumentParser::doEnd):
    * html/HTMLDocument.cpp:
    (WebCore::HTMLDocument::determineParseMode):
    * html/HTMLLinkElement.cpp:
    (WebCore::HTMLLinkElement::setDisabledState):
    (WebCore::HTMLLinkElement::process):
    (WebCore::HTMLLinkElement::removedFromDocument):
    * page/Frame.cpp:
    (WebCore::Frame::setPrinting):
    (WebCore::Frame::reapplyStyles):
    * page/FrameView.cpp:
    (WebCore::FrameView::layout):
    * page/Page.cpp:
    (WebCore::Page::setViewMode):
    * rendering/RenderBlock.cpp:
    (WebCore::RenderBlock::setDesiredColumnCountAndWidth):
    * svg/SVGFontFaceElement.cpp:
    (WebCore::SVGFontFaceElement::rebuildFontFace):
    (WebCore::SVGFontFaceElement::removeFromMappedElementSheet):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66115 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 6978aab..be6f489 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,61 @@
+2010-08-25  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        <rdar://problem/8302217> recalcStyles called immediately on each change when updating document-level stylesheets
+        https://bugs.webkit.org/show_bug.cgi?id=36303
+
+        Parameterize updateStyleSelector to optionally defer the forced style recalc following the rebuilding of the
+        sheets used by the CSSStyleSelector.  Rename the method to styleSelectorChanged().  Add the capability to do 
+        a forced style recalc to the style recalc timer.
+
+        * css/CSSMutableStyleDeclaration.cpp:
+        (WebCore::CSSMutableStyleDeclaration::setNeedsStyleRecalc):
+        * css/CSSStyleSheet.cpp:
+        (WebCore::CSSStyleSheet::styleSheetChanged):
+        * css/CSSVariablesDeclaration.cpp:
+        (WebCore::CSSVariablesDeclaration::setNeedsStyleRecalc):
+        * dom/Document.cpp:
+        (WebCore::Document::Document):
+        (WebCore::Document::scheduleStyleRecalc):
+        (WebCore::Document::updateStyleIfNeeded):
+        (WebCore::Document::updateLayoutIgnorePendingStylesheets):
+        (WebCore::Document::clearPageUserSheet):
+        (WebCore::Document::clearPageGroupUserSheets):
+        (WebCore::Document::processHttpEquiv):
+        (WebCore::Document::setSelectedStylesheetSet):
+        (WebCore::Document::removePendingSheet):
+        (WebCore::Document::styleSelectorChanged):
+        (WebCore::Document::setInPageCache):
+        * dom/Document.h:
+        (WebCore::):
+        * dom/ProcessingInstruction.cpp:
+        (WebCore::ProcessingInstruction::removedFromDocument):
+        * dom/StyleElement.cpp:
+        (WebCore::StyleElement::removedFromDocument):
+        * dom/XMLDocumentParser.cpp:
+        (WebCore::XMLDocumentParser::end):
+        * dom/XMLDocumentParserLibxml2.cpp:
+        (WebCore::XMLDocumentParser::doEnd):
+        * html/HTMLDocument.cpp:
+        (WebCore::HTMLDocument::determineParseMode):
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::setDisabledState):
+        (WebCore::HTMLLinkElement::process):
+        (WebCore::HTMLLinkElement::removedFromDocument):
+        * page/Frame.cpp:
+        (WebCore::Frame::setPrinting):
+        (WebCore::Frame::reapplyStyles):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::layout):
+        * page/Page.cpp:
+        (WebCore::Page::setViewMode):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::setDesiredColumnCountAndWidth):
+        * svg/SVGFontFaceElement.cpp:
+        (WebCore::SVGFontFaceElement::rebuildFontFace):
+        (WebCore::SVGFontFaceElement::removeFromMappedElementSheet):
+
 2010-08-24  Vangelis Kokkevis  <vangelis at chromium.org>
 
         Reviewed by Kenneth Russell.
diff --git a/WebCore/css/CSSMutableStyleDeclaration.cpp b/WebCore/css/CSSMutableStyleDeclaration.cpp
index 8d37a2e..6b85d8b 100644
--- a/WebCore/css/CSSMutableStyleDeclaration.cpp
+++ b/WebCore/css/CSSMutableStyleDeclaration.cpp
@@ -485,13 +485,12 @@ void CSSMutableStyleDeclaration::setNeedsStyleRecalc()
         return;
     }
 
-    // FIXME: quick&dirty hack for KDE 3.0... make this MUCH better! (Dirk)
     StyleBase* root = this;
     while (StyleBase* parent = root->parent())
         root = parent;
     if (root->isCSSStyleSheet())
         if (Document* doc = static_cast<CSSStyleSheet*>(root)->doc())
-            doc->updateStyleSelector();
+            doc->styleSelectorChanged(DeferRecalcStyle);
 }
 
 bool CSSMutableStyleDeclaration::getPropertyPriority(int propertyID) const
diff --git a/WebCore/css/CSSStyleSheet.cpp b/WebCore/css/CSSStyleSheet.cpp
index 1ef1c2b..69c769a 100644
--- a/WebCore/css/CSSStyleSheet.cpp
+++ b/WebCore/css/CSSStyleSheet.cpp
@@ -231,7 +231,7 @@ void CSSStyleSheet::styleSheetChanged()
      * already existing style sheets.
      */
     if (documentToUpdate)
-        documentToUpdate->updateStyleSelector();
+        documentToUpdate->styleSelectorChanged(DeferRecalcStyle);
 }
 
 KURL CSSStyleSheet::completeURL(const String& url) const
diff --git a/WebCore/css/CSSVariablesDeclaration.cpp b/WebCore/css/CSSVariablesDeclaration.cpp
index cb852cb..23d7f83 100644
--- a/WebCore/css/CSSVariablesDeclaration.cpp
+++ b/WebCore/css/CSSVariablesDeclaration.cpp
@@ -169,7 +169,7 @@ void CSSVariablesDeclaration::setNeedsStyleRecalc()
     while (StyleBase* parent = root->parent())
         root = parent;
     if (root->isCSSStyleSheet())
-        static_cast<CSSStyleSheet*>(root)->doc()->updateStyleSelector();
+        static_cast<CSSStyleSheet*>(root)->doc()->styleSelectorChanged(DeferRecalcStyle);
 }
 
 }
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index a29b6b1..17ce98f 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -356,6 +356,7 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML)
     , m_domTreeVersion(0)
     , m_styleSheets(StyleSheetList::create(this))
     , m_styleRecalcTimer(this, &Document::styleRecalcTimerFired)
+    , m_pendingStyleRecalcShouldForce(false)
     , m_frameElementsShouldIgnoreScrolling(false)
     , m_containsValidityStyleRules(false)
     , m_updateFocusAppearanceRestoresSelection(false)
@@ -1364,7 +1365,7 @@ void Document::scheduleStyleRecalc()
     if (m_styleRecalcTimer.isActive() || inPageCache())
         return;
 
-    ASSERT(childNeedsStyleRecalc());
+    ASSERT(childNeedsStyleRecalc() || m_pendingStyleRecalcShouldForce);
 
     if (!documentsThatNeedStyleRecalc)
         documentsThatNeedStyleRecalc = new HashSet<Document*>;
@@ -1475,14 +1476,16 @@ void Document::updateStyleIfNeeded()
 {
     ASSERT(!view() || (!view()->isInLayout() && !view()->isPainting()));
     
-    if (!childNeedsStyleRecalc() || inPageCache())
+    if ((!m_pendingStyleRecalcShouldForce && !childNeedsStyleRecalc()) || inPageCache())
         return;
-        
+
     if (m_frame)
         m_frame->animation()->beginAnimationUpdate();
         
-    recalcStyle(NoChange);
+    recalcStyle(m_pendingStyleRecalcShouldForce ? Force : NoChange);
     
+    m_pendingStyleRecalcShouldForce = false;
+
     // Tell the animation controller that updateStyleIfNeeded is finished and it can do any post-processing
     if (m_frame)
         m_frame->animation()->endAnimationUpdate();
@@ -1497,7 +1500,6 @@ void Document::updateStyleForAllDocuments()
         HashSet<Document*>::iterator it = documentsThatNeedStyleRecalc->begin();
         Document* doc = *it;
         documentsThatNeedStyleRecalc->remove(doc);
-        ASSERT(doc->childNeedsStyleRecalc() && !doc->inPageCache());
         doc->updateStyleIfNeeded();
     }
 }
@@ -1535,7 +1537,7 @@ void Document::updateLayoutIgnorePendingStylesheets()
         // suspend JS instead of doing a layout with inaccurate information.
         if (body() && !body()->renderer() && m_pendingSheetLayout == NoLayoutWithPendingSheets) {
             m_pendingSheetLayout = DidLayoutWithPendingSheets;
-            updateStyleSelector();
+            styleSelectorChanged(RecalcStyleImmediately);
         } else if (m_hasNodesWithPlaceholderStyle)
             // If new nodes have been added or style recalc has been done with style sheets still pending, some nodes 
             // may not have had their real style calculated yet. Normally this gets cleaned when style sheets arrive 
@@ -2221,7 +2223,7 @@ CSSStyleSheet* Document::pageUserSheet()
 void Document::clearPageUserSheet()
 {
     m_pageUserSheet = 0;
-    updateStyleSelector();
+    styleSelectorChanged(DeferRecalcStyle);
 }
 
 const Vector<RefPtr<CSSStyleSheet> >* Document::pageGroupUserSheets() const
@@ -2265,7 +2267,7 @@ void Document::clearPageGroupUserSheets()
 {
     m_pageGroupUserSheets.clear();
     m_pageGroupUserSheetCacheValid = false;
-    updateStyleSelector();
+    styleSelectorChanged(DeferRecalcStyle);
 }
 
 CSSStyleSheet* Document::elementSheet()
@@ -2427,7 +2429,7 @@ void Document::processHttpEquiv(const String& equiv, const String& content)
         // -dwh
         m_selectedStylesheetSet = content;
         m_preferredStylesheetSet = content;
-        updateStyleSelector();
+        styleSelectorChanged(DeferRecalcStyle);
     } else if (equalIgnoringCase(equiv, "refresh")) {
         double delay;
         String url;
@@ -2688,9 +2690,7 @@ String Document::selectedStylesheetSet() const
 void Document::setSelectedStylesheetSet(const String& aString)
 {
     m_selectedStylesheetSet = aString;
-    updateStyleSelector();
-    if (renderer())
-        renderer()->repaint();
+    styleSelectorChanged(DeferRecalcStyle);
 }
 
 // This method is called whenever a top-level stylesheet has finished loading.
@@ -2706,35 +2706,45 @@ void Document::removePendingSheet()
         printf("Stylesheet loaded at time %d. %d stylesheets still remain.\n", elapsedTime(), m_pendingStylesheets);
 #endif
 
-    updateStyleSelector();
+    styleSelectorChanged(RecalcStyleImmediately);
+
+    if (m_pendingStylesheets)
+        return;
 
     ScriptableDocumentParser* parser = scriptableDocumentParser();
-    if (!m_pendingStylesheets && parser)
+    if (parser)
         parser->executeScriptsWaitingForStylesheets();
 
-    if (!m_pendingStylesheets && m_gotoAnchorNeededAfterStylesheetsLoad && view())
+    if (m_gotoAnchorNeededAfterStylesheetsLoad && view())
         view()->scrollToFragment(m_frame->loader()->url());
 }
 
-void Document::updateStyleSelector()
+void Document::styleSelectorChanged(StyleSelectorUpdateFlag updateFlag)
 {
     // Don't bother updating, since we haven't loaded all our style info yet
     // and haven't calculated the style selector for the first time.
-    if (!m_didCalculateStyleSelector && !haveStylesheetsLoaded())
+    if (!attached() || (!m_didCalculateStyleSelector && !haveStylesheetsLoaded()))
         return;
 
-    if (didLayoutWithPendingStylesheets() && m_pendingStylesheets <= 0) {
-        m_pendingSheetLayout = IgnoreLayoutWithPendingSheets;
-        if (renderer())
-            renderer()->repaint();
-    }
-
 #ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (!ownerElement())
         printf("Beginning update of style selector at time %d.\n", elapsedTime());
 #endif
 
     recalcStyleSelector();
+    
+    if (updateFlag == DeferRecalcStyle) {
+        m_pendingStyleRecalcShouldForce = true;
+        scheduleStyleRecalc();
+        return;
+    }
+    
+    if (didLayoutWithPendingStylesheets() && m_pendingStylesheets <= 0) {
+        m_pendingSheetLayout = IgnoreLayoutWithPendingSheets;
+        if (renderer())
+            renderer()->repaint();
+    }
+
     // This recalcStyle initiates a new recalc cycle. We need to bracket it to
     // make sure animations get the correct update time
     if (m_frame)
@@ -3709,7 +3719,7 @@ void Document::setInPageCache(bool flag)
         m_savedRenderer = renderer();
         if (FrameView* v = view())
             v->resetScrollbars();
-        unscheduleStyleRecalc();
+        m_styleRecalcTimer.stop();
     } else {
         ASSERT(!renderer() || renderer() == m_savedRenderer);
         ASSERT(m_renderArena);
diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h
index 18244a1..9941c2d 100644
--- a/WebCore/dom/Document.h
+++ b/WebCore/dom/Document.h
@@ -182,7 +182,9 @@ enum PageshowEventPersistence {
     PageshowEventNotPersisted = 0,
     PageshowEventPersisted = 1
 };
-    
+
+enum StyleSelectorUpdateFlag { RecalcStyleImmediately, DeferRecalcStyle };
+
 class Document : public ContainerNode, public ScriptExecutionContext {
 public:
     static PassRefPtr<Document> create(Frame* frame, const KURL& url)
@@ -440,8 +442,7 @@ public:
      * constructed from these which is used to create the a new style selector which collates all of the stylesheets
      * found and is used to calculate the derived styles for all rendering objects.
      */
-    void updateStyleSelector();
-
+    void styleSelectorChanged(StyleSelectorUpdateFlag);
     void recalcStyleSelector();
 
     bool usesDescendantRules() const { return m_usesDescendantRules; }
@@ -1138,9 +1139,12 @@ private:
     bool m_loadingSheet;
     bool m_visuallyOrdered;
     bool m_bParsing;
+    
     Timer<Document> m_styleRecalcTimer;
+    bool m_pendingStyleRecalcShouldForce;
     bool m_inStyleRecalc;
     bool m_closeAfterStyleRecalc;
+
     bool m_usesDescendantRules;
     bool m_usesSiblingRules;
     bool m_usesFirstLineRules;
diff --git a/WebCore/dom/ProcessingInstruction.cpp b/WebCore/dom/ProcessingInstruction.cpp
index f8aef1f..0e673d4 100644
--- a/WebCore/dom/ProcessingInstruction.cpp
+++ b/WebCore/dom/ProcessingInstruction.cpp
@@ -274,9 +274,8 @@ void ProcessingInstruction::removedFromDocument()
 
     document()->removeStyleSheetCandidateNode(this);
 
-    // FIXME: It's terrible to do a synchronous update of the style selector just because a <style> or <link> element got removed.
     if (m_cachedSheet)
-        document()->updateStyleSelector();
+        document()->styleSelectorChanged(DeferRecalcStyle);
 }
 
 void ProcessingInstruction::finishParsingChildren()
diff --git a/WebCore/dom/StyleElement.cpp b/WebCore/dom/StyleElement.cpp
index 4c0e56f..8dc2489 100644
--- a/WebCore/dom/StyleElement.cpp
+++ b/WebCore/dom/StyleElement.cpp
@@ -67,9 +67,8 @@ void StyleElement::removedFromDocument(Document* document, Element* element)
     if (!document->renderer())
         return;
 
-    // FIXME: It's terrible to do a synchronous update of the style selector just because a <style> or <link> element got removed.
     if (m_sheet)
-        document->updateStyleSelector();
+        document->styleSelectorChanged(DeferRecalcStyle);
 }
 
 void StyleElement::childrenChanged(Element* element)
diff --git a/WebCore/dom/XMLDocumentParser.cpp b/WebCore/dom/XMLDocumentParser.cpp
index c6d9f89..4b76472 100644
--- a/WebCore/dom/XMLDocumentParser.cpp
+++ b/WebCore/dom/XMLDocumentParser.cpp
@@ -231,7 +231,7 @@ void XMLDocumentParser::end()
         insertErrorMessageBlock();
     else {
         exitText();
-        document()->updateStyleSelector();
+        document()->styleSelectorChanged(RecalcStyleImmediately);
     }
 
     clearCurrentNodeStack();
diff --git a/WebCore/dom/XMLDocumentParserLibxml2.cpp b/WebCore/dom/XMLDocumentParserLibxml2.cpp
index 37da83c..320d37b 100644
--- a/WebCore/dom/XMLDocumentParserLibxml2.cpp
+++ b/WebCore/dom/XMLDocumentParserLibxml2.cpp
@@ -1313,7 +1313,7 @@ void XMLDocumentParser::doEnd()
         document()->setTransformSource(new TransformSource(doc));
 
         document()->setParsing(false); // Make the doc think it's done, so it will apply xsl sheets.
-        document()->updateStyleSelector();
+        document()->styleSelectorChanged(RecalcStyleImmediately);
         document()->setParsing(true);
         m_parserStopped = true;
     }
diff --git a/WebCore/dom/XMLDocumentParserQt.cpp b/WebCore/dom/XMLDocumentParserQt.cpp
index 606770f..dfd6fb1 100644
--- a/WebCore/dom/XMLDocumentParserQt.cpp
+++ b/WebCore/dom/XMLDocumentParserQt.cpp
@@ -211,7 +211,7 @@ void XMLDocumentParser::doEnd()
     if (m_sawXSLTransform) {
         document()->setTransformSource(new TransformSource(m_originalSourceForTransform));
         document()->setParsing(false); // Make the doc think it's done, so it will apply xsl sheets.
-        document()->updateStyleSelector();
+        document()->styleSelectorChanged(RecalcStyleImmediately);
         document()->setParsing(true);
         m_parserStopped = true;
     }
diff --git a/WebCore/html/HTMLDocument.cpp b/WebCore/html/HTMLDocument.cpp
index 7ceea3e..01538df 100644
--- a/WebCore/html/HTMLDocument.cpp
+++ b/WebCore/html/HTMLDocument.cpp
@@ -400,7 +400,7 @@ void HTMLDocument::determineParseMode()
     if (inCompatMode() != wasInCompatMode) {
         clearPageUserSheet();
         clearPageGroupUserSheets();
-        updateStyleSelector();
+        styleSelectorChanged(RecalcStyleImmediately);
     }
 }
 
diff --git a/WebCore/html/HTMLLinkElement.cpp b/WebCore/html/HTMLLinkElement.cpp
index b9fb8f0..87054d1 100644
--- a/WebCore/html/HTMLLinkElement.cpp
+++ b/WebCore/html/HTMLLinkElement.cpp
@@ -103,7 +103,7 @@ void HTMLLinkElement::setDisabledState(bool _disabled)
         if (!m_sheet && m_disabledState == EnabledViaScript)
             process();
         else
-            document()->updateStyleSelector(); // Update the style selector.
+            document()->styleSelectorChanged(DeferRecalcStyle); // Update the style selector.
     }
 }
 
@@ -238,7 +238,7 @@ void HTMLLinkElement::process()
     } else if (m_sheet) {
         // we no longer contain a stylesheet, e.g. perhaps rel or type was changed
         m_sheet = 0;
-        document()->updateStyleSelector();
+        document()->styleSelectorChanged(DeferRecalcStyle);
     }
 }
 
@@ -256,9 +256,8 @@ void HTMLLinkElement::removedFromDocument()
 
     document()->removeStyleSheetCandidateNode(this);
 
-    // FIXME: It's terrible to do a synchronous update of the style selector just because a <style> or <link> element got removed.
     if (document()->renderer())
-        document()->updateStyleSelector();
+        document()->styleSelectorChanged(DeferRecalcStyle);
 }
 
 void HTMLLinkElement::finishParsingChildren()
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
index 3c07106..521eac1 100644
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -623,7 +623,7 @@ void Frame::setPrinting(bool printing, const FloatSize& pageSize, float maximumS
     m_doc->setPrinting(printing);
     view()->adjustMediaTypeForPrinting(printing);
 
-    m_doc->updateStyleSelector();
+    m_doc->styleSelectorChanged(RecalcStyleImmediately);
     view()->forceLayoutForPagination(pageSize, maximumShrinkRatio, shouldAdjustViewSize);
 
     for (Frame* child = tree()->firstChild(); child; child = child->tree()->nextSibling())
@@ -661,7 +661,7 @@ void Frame::reapplyStyles()
     // The document automatically does this as required when you set the style sheet.
     // But we had problems when this code was removed. Details are in
     // <http://bugs.webkit.org/show_bug.cgi?id=8079>.
-    m_doc->updateStyleSelector();
+    m_doc->styleSelectorChanged(RecalcStyleImmediately);
 }
 
 void Frame::injectUserScripts(UserScriptInjectionTime injectionTime)
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp
index 1f87984..5d2c715 100644
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@ -648,14 +648,14 @@ void FrameView::layout(bool allowSubtree)
     // Viewport-dependent media queries may cause us to need completely different style information.
     // Check that here.
     if (document->styleSelector()->affectedByViewportChange())
-        document->updateStyleSelector();
+        document->styleSelectorChanged(RecalcStyleImmediately);
 
     // Always ensure our style info is up-to-date.  This can happen in situations where
     // the layout beats any sort of style recalc update that needs to occur.
     if (m_frame->needsReapplyStyles())
         m_frame->reapplyStyles();
-    else if (document->childNeedsStyleRecalc())
-        document->recalcStyle();
+    else
+        document->updateStyleIfNeeded();
     
     bool subtree = m_layoutRoot;
 
diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp
index f80ab7d..3c95a35 100644
--- a/WebCore/page/Page.cpp
+++ b/WebCore/page/Page.cpp
@@ -259,7 +259,7 @@ void Page::setViewMode(ViewMode viewMode)
         m_mainFrame->view()->forceLayout();
 
     if (m_mainFrame->document())
-        m_mainFrame->document()->updateStyleSelector();
+        m_mainFrame->document()->styleSelectorChanged(RecalcStyleImmediately);
 }
 
 void Page::setMainFrame(PassRefPtr<Frame> mainFrame)
diff --git a/WebCore/svg/SVGFontFaceElement.cpp b/WebCore/svg/SVGFontFaceElement.cpp
index 42c1c75..bf03aac 100644
--- a/WebCore/svg/SVGFontFaceElement.cpp
+++ b/WebCore/svg/SVGFontFaceElement.cpp
@@ -307,7 +307,7 @@ void SVGFontFaceElement::rebuildFontFace()
         }
     }
 
-    document()->updateStyleSelector();
+    document()->styleSelectorChanged(DeferRecalcStyle);
 }
 
 void SVGFontFaceElement::insertedIntoDocument()
@@ -342,7 +342,7 @@ void SVGFontFaceElement::removeFromMappedElementSheet()
             break;
         }
     }
-    document()->updateStyleSelector();
+    document()->styleSelectorChanged(DeferRecalcStyle);
 }
 
 } // namespace WebCore

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list