Rename "forced style recalc" to "full style rebuild"
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Dec 2018 23:56:31 +0000 (23:56 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Dec 2018 23:56:31 +0000 (23:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192572

Reviewed by Zalan Bujtas.

Source/WebCore:

The old name is confusing.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::hasValidStyleForProperty):
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRebuild):
(WebCore::Document::scheduleStyleRecalc):
(WebCore::Document::unscheduleStyleRecalc):
(WebCore::Document::hasPendingStyleRebuild const):
(WebCore::Document::resolveStyle):
(WebCore::Document::needsStyleRecalc const):
(WebCore::Document::updateLayoutIgnorePendingStylesheets):
(WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc):
(WebCore::Document::setDesignMode):
(WebCore::Document::webkitDidExitFullScreenForElement):
(WebCore::Document::setAnimatingFullScreen):
(WebCore::Document::setFullscreenControlsHidden):
(WebCore::Document::scheduleForcedStyleRecalc): Deleted.
(WebCore::Document::hasPendingForcedStyleRecalc const): Deleted.
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::needsStyleInvalidation const):
* page/Page.cpp:
(WebCore::Page::updateStyleAfterChangeInEnvironment):
* style/StyleScope.cpp:
(WebCore::Style::Scope::updateActiveStyleSheets):

Source/WebKitLegacy/mac:

* WebView/WebHTMLView.mm:
(-[WebHTMLView setNeedsToApplyStyles:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239057 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Element.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/style/StyleScope.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebHTMLView.mm

index b70e349..477c69d 100644 (file)
@@ -1,3 +1,37 @@
+2018-12-10  Antti Koivisto  <antti@apple.com>
+
+        Rename "forced style recalc" to "full style rebuild"
+        https://bugs.webkit.org/show_bug.cgi?id=192572
+
+        Reviewed by Zalan Bujtas.
+
+        The old name is confusing.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::hasValidStyleForProperty):
+        * dom/Document.cpp:
+        (WebCore::Document::scheduleStyleRebuild):
+        (WebCore::Document::scheduleStyleRecalc):
+        (WebCore::Document::unscheduleStyleRecalc):
+        (WebCore::Document::hasPendingStyleRebuild const):
+        (WebCore::Document::resolveStyle):
+        (WebCore::Document::needsStyleRecalc const):
+        (WebCore::Document::updateLayoutIgnorePendingStylesheets):
+        (WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc):
+        (WebCore::Document::setDesignMode):
+        (WebCore::Document::webkitDidExitFullScreenForElement):
+        (WebCore::Document::setAnimatingFullScreen):
+        (WebCore::Document::setFullscreenControlsHidden):
+        (WebCore::Document::scheduleForcedStyleRecalc): Deleted.
+        (WebCore::Document::hasPendingForcedStyleRecalc const): Deleted.
+        * dom/Document.h:
+        * dom/Element.cpp:
+        (WebCore::Element::needsStyleInvalidation const):
+        * page/Page.cpp:
+        (WebCore::Page::updateStyleAfterChangeInEnvironment):
+        * style/StyleScope.cpp:
+        (WebCore::Style::Scope::updateActiveStyleSheets):
+
 2018-12-10  Alexey Proskuryakov  <ap@apple.com>
 
         Include CoreGraphics.h from WebCorePrefix.h
index 58f73fb..36f0394 100644 (file)
@@ -2434,7 +2434,7 @@ static inline bool hasValidStyleForProperty(Element& element, CSSPropertyID prop
 {
     if (element.styleValidity() != Style::Validity::Valid)
         return false;
-    if (element.document().hasPendingForcedStyleRecalc())
+    if (element.document().hasPendingFullStyleRebuild())
         return false;
     if (!element.document().childNeedsStyleRecalc())
         return true;
index 6e3fc19..b1a3e68 100644 (file)
@@ -1780,9 +1780,9 @@ Ref<TreeWalker> Document::createTreeWalker(Node& root, unsigned long whatToShow,
     return TreeWalker::create(root, whatToShow, WTFMove(filter));
 }
 
-void Document::scheduleForcedStyleRecalc()
+void Document::scheduleFullStyleRebuild()
 {
-    m_pendingStyleRecalcShouldForce = true;
+    m_needsFullStyleRebuild = true;
     scheduleStyleRecalc();
 }
 
@@ -1793,7 +1793,7 @@ void Document::scheduleStyleRecalc()
     if (m_styleRecalcTimer.isActive() || pageCacheState() != NotInPageCache)
         return;
 
-    ASSERT(childNeedsStyleRecalc() || m_pendingStyleRecalcShouldForce);
+    ASSERT(childNeedsStyleRecalc() || m_needsFullStyleRebuild);
 
 #if PLATFORM(IOS_FAMILY)
     if (WKIsObservingStyleRecalcScheduling()) {
@@ -1826,7 +1826,7 @@ void Document::unscheduleStyleRecalc()
     ASSERT(!childNeedsStyleRecalc());
 
     m_styleRecalcTimer.stop();
-    m_pendingStyleRecalcShouldForce = false;
+    m_needsFullStyleRebuild = false;
 }
 
 bool Document::hasPendingStyleRecalc() const
@@ -1834,9 +1834,9 @@ bool Document::hasPendingStyleRecalc() const
     return needsStyleRecalc() && !m_inStyleRecalc;
 }
 
-bool Document::hasPendingForcedStyleRecalc() const
+bool Document::hasPendingFullStyleRebuild() const
 {
-    return hasPendingStyleRecalc() && m_pendingStyleRecalcShouldForce;
+    return hasPendingStyleRecalc() && m_needsFullStyleRebuild;
 }
 
 void Document::resolveStyle(ResolveStyleType type)
@@ -1892,7 +1892,7 @@ void Document::resolveStyle(ResolveStyleType type)
 
         m_inStyleRecalc = true;
 
-        if (m_pendingStyleRecalcShouldForce)
+        if (m_needsFullStyleRebuild)
             type = ResolveStyleType::Rebuild;
 
         if (type == ResolveStyleType::Rebuild) {
@@ -1992,7 +1992,7 @@ bool Document::needsStyleRecalc() const
     if (pageCacheState() != NotInPageCache)
         return false;
 
-    if (m_pendingStyleRecalcShouldForce)
+    if (m_needsFullStyleRebuild)
         return true;
 
     if (childNeedsStyleRecalc())
@@ -2099,7 +2099,7 @@ void Document::updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasks
         m_ignorePendingStylesheets = true;
         // FIXME: This should just invalidate elements with missing styles.
         if (m_hasNodesWithMissingStyle)
-            scheduleForcedStyleRecalc();
+            scheduleFullStyleRebuild();
     }
 
     updateLayout();
@@ -2300,7 +2300,7 @@ void Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc()
         resolver->invalidateMatchedPropertiesCache();
     if (pageCacheState() != NotInPageCache || !renderView())
         return;
-    scheduleForcedStyleRecalc();
+    scheduleFullStyleRebuild();
 }
 
 void Document::didClearStyleResolver()
@@ -5464,7 +5464,7 @@ void Document::setDesignMode(InheritedBool value)
 {
     m_designMode = value;
     for (Frame* frame = m_frame; frame && frame->document(); frame = frame->tree().traverseNext(m_frame))
-        frame->document()->scheduleForcedStyleRecalc();
+        frame->document()->scheduleFullStyleRebuild();
 }
 
 String Document::designMode() const
@@ -6587,7 +6587,7 @@ void Document::webkitDidExitFullScreenForElement(Element*)
     unwrapFullScreenRenderer(m_fullScreenRenderer.get(), m_fullScreenElement.get());
 
     m_fullScreenElement = nullptr;
-    scheduleForcedStyleRecalc();
+    scheduleFullStyleRebuild();
 
     // When webkitCancelFullScreen is called, we call webkitExitFullScreen on the topDocument(). That
     // means that the events will be queued there. So if we have no events here, start the timer on
@@ -6690,7 +6690,7 @@ void Document::setAnimatingFullScreen(bool flag)
 
     if (m_fullScreenElement && m_fullScreenElement->isDescendantOf(*this)) {
         m_fullScreenElement->invalidateStyleForSubtree();
-        scheduleForcedStyleRecalc();
+        scheduleFullStyleRebuild();
     }
 }
 
@@ -6707,7 +6707,7 @@ void Document::setFullscreenControlsHidden(bool flag)
 
     if (m_fullScreenElement && m_fullScreenElement->isDescendantOf(*this)) {
         m_fullScreenElement->invalidateStyleForSubtree();
-        scheduleForcedStyleRecalc();
+        scheduleFullStyleRebuild();
     }
 }
 
index 5b5ff49..b29f362 100644 (file)
@@ -782,11 +782,11 @@ public:
     Element* cssTarget() const { return m_cssTarget; }
     static ptrdiff_t cssTargetMemoryOffset() { return OBJECT_OFFSETOF(Document, m_cssTarget); }
 
-    WEBCORE_EXPORT void scheduleForcedStyleRecalc();
+    WEBCORE_EXPORT void scheduleFullStyleRebuild();
     void scheduleStyleRecalc();
     void unscheduleStyleRecalc();
     bool hasPendingStyleRecalc() const;
-    bool hasPendingForcedStyleRecalc() const;
+    bool hasPendingFullStyleRebuild() const;
 
     void registerNodeListForInvalidation(LiveNodeList&);
     void unregisterNodeListForInvalidation(LiveNodeList&);
@@ -1993,7 +1993,7 @@ private:
     bool m_visuallyOrdered { false };
     bool m_bParsing { false }; // FIXME: rename
 
-    bool m_pendingStyleRecalcShouldForce { false };
+    bool m_needsFullStyleRebuild { false };
     bool m_inStyleRecalc { false };
     bool m_closeAfterStyleRecalc { false };
     bool m_inRenderTreeUpdate { false };
index efd1cf1..93be7bb 100644 (file)
@@ -2999,7 +2999,7 @@ bool Element::needsStyleInvalidation() const
         return false;
     if (styleValidity() >= Style::Validity::SubtreeInvalid)
         return false;
-    if (document().hasPendingForcedStyleRecalc())
+    if (document().hasPendingFullStyleRebuild())
         return false;
 
     return true;
index fb0fc38..e5665b1 100644 (file)
@@ -548,7 +548,7 @@ void Page::updateStyleAfterChangeInEnvironment()
 
         if (StyleResolver* styleResolver = document->styleScope().resolverIfExists())
             styleResolver->invalidateMatchedPropertiesCache();
-        document->scheduleForcedStyleRecalc();
+        document->scheduleFullStyleRebuild();
         document->styleScope().didChangeStyleSheetEnvironment();
     }
 }
index f0c159b..6b4f10a 100644 (file)
@@ -478,7 +478,7 @@ void Scope::updateActiveStyleSheets(UpdateType updateType)
         // Crash stacks indicate we can get here when a resource load fails synchronously (for example due to content blocking).
         // FIXME: These kind of cases should be eliminated and this path replaced by an assert.
         m_pendingUpdate = UpdateType::ContentsOrInterpretation;
-        m_document.scheduleForcedStyleRecalc();
+        m_document.scheduleFullStyleRebuild();
         return;
     }
 
@@ -515,7 +515,7 @@ void Scope::updateActiveStyleSheets(UpdateType updateType)
                 shadowChild.invalidateStyleForSubtree();
             invalidateHostAndSlottedStyleIfNeeded(*m_shadowRoot, resolver());
         } else
-            m_document.scheduleForcedStyleRecalc();
+            m_document.scheduleFullStyleRebuild();
     }
 }
 
index fb80256..c07fedd 100644 (file)
@@ -1,3 +1,13 @@
+2018-12-10  Antti Koivisto  <antti@apple.com>
+
+        Rename "forced style recalc" to "full style rebuild"
+        https://bugs.webkit.org/show_bug.cgi?id=192572
+
+        Reviewed by Zalan Bujtas.
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView setNeedsToApplyStyles:]):
+
 2018-12-10  Darin Adler  <darin@apple.com>
 
         [macOS] MSHCreateMIGServerSource invocation does not handle send/receive rights correctly
index 237f1a0..887d8fb 100644 (file)
@@ -3881,7 +3881,7 @@ static BOOL currentScrollIsBlit(NSView *clipView)
     if (Frame* frame = core([self _frame])) {
         if (frame->document() && frame->document()->pageCacheState() != Document::NotInPageCache)
             return;
-        frame->document()->scheduleForcedStyleRecalc();
+        frame->document()->scheduleFullStyleRebuild();
     }
 }