Changeset 206230 in webkit


Ignore:
Timestamp:
Sep 21, 2016 12:59:47 PM (8 years ago)
Author:
Antti Koivisto
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.
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r206227 r206230  
     12016-09-21  Antti Koivisto  <antti@apple.com>
     2
     3        Document::styleResolverChanged simplification
     4        https://bugs.webkit.org/show_bug.cgi?id=162347
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * dom/Document.cpp:
     9        (WebCore::Document::implicitClose):
     10        (WebCore::Document::setParsing):
     11        (WebCore::Document::write):
     12        (WebCore::Document::styleResolverChanged):
     13
     14            - Remove unncessary AnimationUpdateBlock, it is created by recalcStyle.
     15            - Remove explicit setNeedsLayoutAndPrefWidthsRecalc/scheduleRelayout calls, style resolution
     16              invalidates those as needed.
     17            - Remove evaluateMediaQueryList call, that is done on layout as needed.
     18            - Remove the ancient INSTRUMENT_LAYOUT_SCHEDULING and the related printfs.
     19
    1202016-09-21  Keith Miller  <keith_miller@apple.com>
    221
  • trunk/Source/WebCore/dom/Document.cpp

    r206196 r206230  
    275275using namespace HTMLNames;
    276276
    277 // #define INSTRUMENT_LAYOUT_SCHEDULING 1
    278 
    279277static const unsigned cMaxWriteRecursionDepth = 21;
    280278
     
    27522750    if (f)
    27532751        f->loader().dispatchOnloadEvents();
    2754 #ifdef INSTRUMENT_LAYOUT_SCHEDULING
    2755     if (!ownerElement())
    2756         printf("onload fired at %lld\n", elapsedTime().count());
    2757 #endif
    27582752
    27592753    // An event handler may have removed the frame
     
    28252819    if (!m_bParsing && view() && !view()->needsLayout())
    28262820        view()->fireLayoutRelatedMilestonesIfNeeded();
    2827 
    2828 #ifdef INSTRUMENT_LAYOUT_SCHEDULING
    2829     if (!ownerElement() && !m_bParsing)
    2830         printf("Parsing finished at %lld\n", elapsedTime().count());
    2831 #endif
    28322821}
    28332822
     
    28782867       return;
    28792868
    2880 #ifdef INSTRUMENT_LAYOUT_SCHEDULING
    2881     if (!ownerElement())
    2882         printf("Beginning a document.write at %lld\n", elapsedTime().count());
    2883 #endif
    2884 
    28852869    bool hasInsertionPoint = m_parser && m_parser->hasInsertionPoint();
    28862870    if (!hasInsertionPoint && (m_ignoreOpensDuringUnloadCount || m_ignoreDestructiveWriteCount))
     
    28922876    ASSERT(m_parser);
    28932877    m_parser->insert(text);
    2894 
    2895 #ifdef INSTRUMENT_LAYOUT_SCHEDULING
    2896     if (!ownerElement())
    2897         printf("Ending a document.write at %lld\n", elapsedTime().count());
    2898 #endif   
    28992878}
    29002879
     
    36593638    m_didCalculateStyleResolver = true;
    36603639
    3661 #ifdef INSTRUMENT_LAYOUT_SCHEDULING
    3662     if (!ownerElement())
    3663         printf("Beginning update of style selector at time %lld.\n", elapsedTime().count());
    3664 #endif
    3665 
    36663640    auto styleSheetUpdate = (updateFlag == RecalcStyleIfNeeded || updateFlag == DeferRecalcStyleIfNeeded)
    36673641        ? AuthorStyleSheets::OptimizedUpdate
     
    36803654    }
    36813655
    3682     if (!stylesheetChangeRequiresStyleRecalc)
    3683         return;
    3684 
    3685     // This recalcStyle initiates a new recalc cycle. We need to bracket it to
    3686     // make sure animations get the correct update time
    3687     {
    3688         AnimationUpdateBlock animationUpdateBlock(m_frame ? &m_frame->animation() : nullptr);
     3656    if (stylesheetChangeRequiresStyleRecalc)
    36893657        recalcStyle(Style::Force);
    3690     }
    3691 
    3692 #ifdef INSTRUMENT_LAYOUT_SCHEDULING
    3693     if (!ownerElement())
    3694         printf("Finished update of style selector at time %lld\n", elapsedTime().count());
    3695 #endif
    3696 
    3697     if (renderView()) {
    3698         renderView()->setNeedsLayoutAndPrefWidthsRecalc();
    3699         if (view())
    3700             view()->scheduleRelayout();
    3701     }
    3702 
    3703     evaluateMediaQueryList();
    37043658}
    37053659
Note: See TracChangeset for help on using the changeset viewer.