Title: [206230] trunk/Source/WebCore
Revision
206230
Author
an...@apple.com
Date
2016-09-21 12:59:47 -0700 (Wed, 21 Sep 2016)

Log Message

Document::styleResolverChanged simplification
https://bugs.webkit.org/show_bug.cgi?id=162347

Reviewed by Anders Carlsson.

* dom/Document.cpp:
(WebCore::Document::implicitClose):
(WebCore::Document::setParsing):
(WebCore::Document::write):
(WebCore::Document::styleResolverChanged):

    - Remove unncessary AnimationUpdateBlock, it is created by recalcStyle.
    - Remove explicit setNeedsLayoutAndPrefWidthsRecalc/scheduleRelayout calls, style resolution
      invalidates those as needed.
    - Remove evaluateMediaQueryList call, that is done on layout as needed.
    - Remove the ancient INSTRUMENT_LAYOUT_SCHEDULING and the related printfs.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (206229 => 206230)


--- trunk/Source/WebCore/ChangeLog	2016-09-21 19:42:49 UTC (rev 206229)
+++ trunk/Source/WebCore/ChangeLog	2016-09-21 19:59:47 UTC (rev 206230)
@@ -1,3 +1,22 @@
+2016-09-21  Antti Koivisto  <an...@apple.com>
+
+        Document::styleResolverChanged simplification
+        https://bugs.webkit.org/show_bug.cgi?id=162347
+
+        Reviewed by Anders Carlsson.
+
+        * dom/Document.cpp:
+        (WebCore::Document::implicitClose):
+        (WebCore::Document::setParsing):
+        (WebCore::Document::write):
+        (WebCore::Document::styleResolverChanged):
+
+            - Remove unncessary AnimationUpdateBlock, it is created by recalcStyle.
+            - Remove explicit setNeedsLayoutAndPrefWidthsRecalc/scheduleRelayout calls, style resolution
+              invalidates those as needed.
+            - Remove evaluateMediaQueryList call, that is done on layout as needed.
+            - Remove the ancient INSTRUMENT_LAYOUT_SCHEDULING and the related printfs.
+
 2016-09-21  Keith Miller  <keith_mil...@apple.com>
 
         Attempt to fix windows build after r206222.

Modified: trunk/Source/WebCore/dom/Document.cpp (206229 => 206230)


--- trunk/Source/WebCore/dom/Document.cpp	2016-09-21 19:42:49 UTC (rev 206229)
+++ trunk/Source/WebCore/dom/Document.cpp	2016-09-21 19:59:47 UTC (rev 206230)
@@ -274,8 +274,6 @@
 
 using namespace HTMLNames;
 
-// #define INSTRUMENT_LAYOUT_SCHEDULING 1
-
 static const unsigned cMaxWriteRecursionDepth = 21;
 
 // DOM Level 2 says (letters added):
@@ -2751,10 +2749,6 @@
 
     if (f)
         f->loader().dispatchOnloadEvents();
-#ifdef INSTRUMENT_LAYOUT_SCHEDULING
-    if (!ownerElement())
-        printf("onload fired at %lld\n", elapsedTime().count());
-#endif
 
     // An event handler may have removed the frame
     if (!frame()) {
@@ -2824,11 +2818,6 @@
 
     if (!m_bParsing && view() && !view()->needsLayout())
         view()->fireLayoutRelatedMilestonesIfNeeded();
-
-#ifdef INSTRUMENT_LAYOUT_SCHEDULING
-    if (!ownerElement() && !m_bParsing)
-        printf("Parsing finished at %lld\n", elapsedTime().count());
-#endif
 }
 
 bool Document::shouldScheduleLayout()
@@ -2877,11 +2866,6 @@
     if (m_writeRecursionIsTooDeep)
        return;
 
-#ifdef INSTRUMENT_LAYOUT_SCHEDULING
-    if (!ownerElement())
-        printf("Beginning a document.write at %lld\n", elapsedTime().count());
-#endif
-
     bool hasInsertionPoint = m_parser && m_parser->hasInsertionPoint();
     if (!hasInsertionPoint && (m_ignoreOpensDuringUnloadCount || m_ignoreDestructiveWriteCount))
         return;
@@ -2891,11 +2875,6 @@
 
     ASSERT(m_parser);
     m_parser->insert(text);
-
-#ifdef INSTRUMENT_LAYOUT_SCHEDULING
-    if (!ownerElement())
-        printf("Ending a document.write at %lld\n", elapsedTime().count());
-#endif    
 }
 
 void Document::write(const String& text, Document* ownerDocument)
@@ -3658,11 +3637,6 @@
     }
     m_didCalculateStyleResolver = true;
 
-#ifdef INSTRUMENT_LAYOUT_SCHEDULING
-    if (!ownerElement())
-        printf("Beginning update of style selector at time %lld.\n", elapsedTime().count());
-#endif
-
     auto styleSheetUpdate = (updateFlag == RecalcStyleIfNeeded || updateFlag == DeferRecalcStyleIfNeeded)
         ? AuthorStyleSheets::OptimizedUpdate
         : AuthorStyleSheets::FullUpdate;
@@ -3679,28 +3653,8 @@
         return;
     }
 
-    if (!stylesheetChangeRequiresStyleRecalc)
-        return;
-
-    // This recalcStyle initiates a new recalc cycle. We need to bracket it to
-    // make sure animations get the correct update time
-    {
-        AnimationUpdateBlock animationUpdateBlock(m_frame ? &m_frame->animation() : nullptr);
+    if (stylesheetChangeRequiresStyleRecalc)
         recalcStyle(Style::Force);
-    }
-
-#ifdef INSTRUMENT_LAYOUT_SCHEDULING
-    if (!ownerElement())
-        printf("Finished update of style selector at time %lld\n", elapsedTime().count());
-#endif
-
-    if (renderView()) {
-        renderView()->setNeedsLayoutAndPrefWidthsRecalc();
-        if (view())
-            view()->scheduleRelayout();
-    }
-
-    evaluateMediaQueryList();
 }
 
 static bool isNodeInSubtree(Node* node, Node* container, bool amongChildrenOnly)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to