Skip to content
  • antti@apple.com's avatar
    Subtree invalidation on stylesheet change · a607df8b
    antti@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=75834
    
    Source/WebCore: 
    
    Reviewed by Andreas Kling.
            
    Currently if we add a stylesheet with scoped selectors and matching scope elements exist,
    we recalculate the entire document style. It is sufficient to invalidate the subtrees 
    matching the scope only.
            
    This allows us to do less full style recalcs on many popular web sites (nytimes.com for example).
    Subtree recalcs are typically much cheaper.
            
    Test: fast/css/id-or-class-before-stylesheet.html
    
    * dom/Document.cpp:
    (WebCore::Document::testAddedStylesheetRequiresStyleRecalc):
    (WebCore::Document::analyzeStylesheetChange):
    (WebCore::Document::updateActiveStylesheets):
    * dom/Document.h:
    
    LayoutTests: 
    
    Reviewed by Andreas Kling.
    
    * fast/css/id-or-class-before-stylesheet-expected.txt: Added.
    * fast/css/id-or-class-before-stylesheet.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104445 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    a607df8b