Changeset 16191 in webkit
- Timestamp:
- Sep 1, 2006 6:43:36 PM (18 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r16190 r16191 1 2006-09-01 David Hyatt <hyatt@apple.com> 2 3 Fix for 10682, refine the FOUC paint suppression logic so that it 4 is only triggered when FOUC would really have occurred. 5 6 Reviewed by aroben 7 8 * css/cssstyleselector.cpp: 9 (WebCore::CSSStyleSelector::styleForElement): 10 * dom/Document.cpp: 11 (WebCore::Document::Document): 12 (WebCore::Document::updateLayoutIgnorePendingStylesheets): 13 (WebCore::Document::updateStyleSelector): 14 * dom/Document.h: 15 (WebCore::Document::haveStylesheetsLoaded): 16 (WebCore::Document::): 17 (WebCore::Document::didLayoutWithPendingStylesheets): 18 * rendering/RenderBlock.cpp: 19 (WebCore::RenderBlock::paintChildren): 20 * rendering/RenderLayer.cpp: 21 (WebCore::RenderLayer::paintLayer): 22 1 23 2006-09-01 MorganL <morlmor@yahoo.com> 2 24 -
trunk/WebCore/css/cssstyleselector.cpp
r16045 r16191 768 768 RenderStyle* CSSStyleSelector::styleForElement(Element* e, RenderStyle* defaultParent, bool allowSharing, bool resolveForRootDefault) 769 769 { 770 if (allowSharing && !e->document()->haveStylesheetsLoaded()) { 770 // Once an element has a renderer, we don't try to destroy it, since otherwise the renderer 771 // will vanish if a style recalc happens during loading. 772 if (allowSharing && !e->document()->haveStylesheetsLoaded() && !e->renderer()) { 771 773 if (!styleNotYetAvailable) { 772 774 styleNotYetAvailable = ::new RenderStyle(); -
trunk/WebCore/dom/Document.cpp
r16169 r16191 266 266 m_pendingStylesheets = 0; 267 267 m_ignorePendingStylesheets = false; 268 m_ didLayoutWithPendingStylesheets = false;268 m_pendingSheetLayout = NoLayoutWithPendingSheets; 269 269 270 270 m_cssTarget = 0; … … 931 931 if (!haveStylesheetsLoaded()) { 932 932 m_ignorePendingStylesheets = true; 933 m_didLayoutWithPendingStylesheets = true; 933 // FIXME: We are willing to attempt to suppress painting with outdated style info only once. Our assumption is that it would be 934 // dangerous to try to stop it a second time, after page content has already been loaded and displayed 935 // with accurate style information. (Our suppression involves blanking the whole page at the 936 // moment. If it were more refined, we might be able to do something better.) 937 // It's worth noting though that this entire method is a hack, since what we really want to do is 938 // suspend JS instead of doing a layout with inaccurate information. 939 if (m_pendingSheetLayout == NoLayoutWithPendingSheets) 940 m_pendingSheetLayout = DidLayoutWithPendingSheets; 934 941 updateStyleSelector(); 935 942 } … … 1776 1783 return; 1777 1784 1778 if ( m_didLayoutWithPendingStylesheets) {1779 m_ didLayoutWithPendingStylesheets = false;1785 if (didLayoutWithPendingStylesheets() && m_pendingStylesheets <= 0) { 1786 m_pendingSheetLayout = IgnoreLayoutWithPendingSheets; 1780 1787 if (renderer()) 1781 1788 renderer()->repaint(); -
trunk/WebCore/dom/Document.h
r16129 r16191 241 241 * any @imports that they may be loading). 242 242 */ 243 bool haveStylesheetsLoaded( bool checkIgnoreFlag = true) const { return m_pendingStylesheets <= 0 || (checkIgnoreFlag && m_ignorePendingStylesheets); }243 bool haveStylesheetsLoaded() const { return m_pendingStylesheets <= 0 || m_ignorePendingStylesheets; } 244 244 245 245 /** … … 598 598 #endif // XPATH_SUPPORT 599 599 600 enum PendingSheetLayout { NoLayoutWithPendingSheets, DidLayoutWithPendingSheets, IgnoreLayoutWithPendingSheets }; 601 602 bool didLayoutWithPendingStylesheets() const { return m_pendingSheetLayout == DidLayoutWithPendingSheets; } 603 600 604 protected: 601 605 CSSStyleSelector* m_styleSelector; … … 629 633 // to track that this happened so that we can do a full repaint when the stylesheets 630 634 // do eventually load. 631 bool m_didLayoutWithPendingStylesheets;635 PendingSheetLayout m_pendingSheetLayout; 632 636 633 637 RefPtr<CSSStyleSheet> m_elemSheet; -
trunk/WebCore/rendering/RenderBlock.cpp
r16129 r16191 1259 1259 // It's ok not to draw, because later on, when all the stylesheets do load, updateStyleSelector on the Document 1260 1260 // will do a full repaint(). 1261 if ( !document()->haveStylesheetsLoaded(false))1261 if (document()->didLayoutWithPendingStylesheets()) 1262 1262 return; 1263 1263 -
trunk/WebCore/rendering/RenderLayer.cpp
r16129 r16191 1274 1274 // It's ok not to draw, because later on, when all the stylesheets do load, updateStyleSelector on the Document 1275 1275 // will do a full repaint(). 1276 if ( !renderer()->document()->haveStylesheetsLoaded(false) && !renderer()->isRenderView() && !renderer()->isRoot())1276 if (renderer()->document()->didLayoutWithPendingStylesheets() && !renderer()->isRenderView() && !renderer()->isRoot()) 1277 1277 return; 1278 1278
Note: See TracChangeset
for help on using the changeset viewer.