Changeset 25308 in webkit


Ignore:
Timestamp:
Aug 29, 2007, 3:46:41 PM (17 years ago)
Author:
antti
Message:

WebCore:

Reviewed by Mitz.


Fix <rdar://problem/5425951>
REGRESSION: change to updateLayoutIgnorePendingStylesheets causes SAP Portal page to render wrong


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 state gets cleaned when style sheets arrive
but in updateLayoutIgnorePendingStylesheets() we need to do full style recalc to get up-to-date style immediatly.


Added a document flag to track if there are any nodes that did not have their real style calculated due to
pending stylesheets.

Test: fast/dynamic/style-access-late-stylesheet-load.html

  • css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::styleForElement):
  • dom/Document.cpp: (WebCore::Document::Document): (WebCore::Document::recalcStyle): (WebCore::Document::updateLayoutIgnorePendingStylesheets):
  • dom/Document.h: (WebCore::Document::setHasNodesWithPlaceholderStyle):

LayoutTests:

Reviewed by Mitz.


Test for <rdar://problem/5425951>
REGRESSION: change to updateLayoutIgnorePendingStylesheets causes SAP Portal page to render wrong

  • fast/dynamic/style-access-late-stylesheet-load-expected.txt: Added.
  • fast/dynamic/style-access-late-stylesheet-load.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r25284 r25308  
     12007-08-29  Antti Koivisto  <antti@apple.com>
     2
     3        Reviewed by Mitz.
     4       
     5        Test for <rdar://problem/5425951>
     6        REGRESSION: change to updateLayoutIgnorePendingStylesheets causes SAP Portal page to render wrong
     7
     8        * fast/dynamic/style-access-late-stylesheet-load-expected.txt: Added.
     9        * fast/dynamic/style-access-late-stylesheet-load.html: Added.
     10
    1112007-08-28  Sam Weinig  <sam@webkit.org>
    212
  • trunk/WebCore/ChangeLog

    r25306 r25308  
     12007-08-29  Antti Koivisto  <antti@apple.com>
     2
     3        Reviewed by Mitz.
     4       
     5        Fix <rdar://problem/5425951>
     6        REGRESSION: change to updateLayoutIgnorePendingStylesheets causes SAP Portal page to render wrong
     7       
     8        If new nodes have been added or style recalc has been done with style sheets still pending, some nodes
     9        may not have had their real style calculated yet. Normally this state gets cleaned when style sheets arrive
     10        but in updateLayoutIgnorePendingStylesheets() we need to do full style recalc to get up-to-date style immediatly.
     11       
     12        Added a document flag to track if there are any nodes that did not have their real style calculated due to
     13        pending stylesheets.
     14
     15        Test: fast/dynamic/style-access-late-stylesheet-load.html
     16
     17        * css/CSSStyleSelector.cpp:
     18        (WebCore::CSSStyleSelector::styleForElement):
     19        * dom/Document.cpp:
     20        (WebCore::Document::Document):
     21        (WebCore::Document::recalcStyle):
     22        (WebCore::Document::updateLayoutIgnorePendingStylesheets):
     23        * dom/Document.h:
     24        (WebCore::Document::setHasNodesWithPlaceholderStyle):
     25
    1262007-08-29  Alice Liu  <alice.liu@apple.com>
    227
  • trunk/WebCore/css/CSSStyleSelector.cpp

    r25264 r25308  
    794794        }
    795795        styleNotYetAvailable->ref();
     796        e->document()->setHasNodesWithPlaceholderStyle();
    796797        return styleNotYetAvailable;
    797798    }
  • trunk/WebCore/dom/Document.cpp

    r25107 r25308  
    319319    m_pendingStylesheets = 0;
    320320    m_ignorePendingStylesheets = false;
     321    m_hasNodesWithPlaceholderStyle = false;
    321322    m_pendingSheetLayout = NoLayoutWithPendingSheets;
    322323
     
    987988
    988989    if (change == Force) {
     990        // style selector may set this again during recalc
     991        m_hasNodesWithPlaceholderStyle = false;
     992       
    989993        RenderStyle* oldStyle = renderer()->style();
    990994        if (oldStyle)
     
    10991103            m_pendingSheetLayout = DidLayoutWithPendingSheets;
    11001104            updateStyleSelector();
    1101         }
     1105        } else if (m_hasNodesWithPlaceholderStyle)
     1106            // If new nodes have been added or style recalc has been done with style sheets still pending, some nodes
     1107            // may not have had their real style calculated yet. Normally this gets cleaned when style sheets arrive
     1108            // but here we need up-to-date style immediatly.
     1109            recalcStyle(Force);
    11021110    }
    11031111
  • trunk/WebCore/dom/Document.h

    r25107 r25308  
    641641
    642642    bool didLayoutWithPendingStylesheets() const { return m_pendingSheetLayout == DidLayoutWithPendingSheets; }
     643   
     644    void setHasNodesWithPlaceholderStyle() { m_hasNodesWithPlaceholderStyle = true; }
    643645
    644646    String iconURL();
     
    696698    // do eventually load.
    697699    PendingSheetLayout m_pendingSheetLayout;
     700   
     701    bool m_hasNodesWithPlaceholderStyle;
    698702
    699703    RefPtr<CSSStyleSheet> m_elemSheet;
Note: See TracChangeset for help on using the changeset viewer.