Changeset 84066 in webkit
- Timestamp:
- Apr 15, 2011 5:49:25 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r84065 r84066 1 2011-04-15 MORITA Hajime <morrita@google.com> 2 3 Reviewed by Simon Fraser. 4 5 Calls to WebCore::Document::mayCauseFlashOfUnstyledContent make frequently-run drawing methods slower 6 https://bugs.webkit.org/show_bug.cgi?id=58512 7 8 Manually rolled out r72367 at which mayCauseFlashOfUnstyledContent() was introduced. 9 This change keeps an small refactoring on 10 FrameView::shouldUpdate(), which doesn't affect on the behavior. 11 12 * dom/Document.cpp: 13 * dom/Document.h: 14 * page/FrameView.cpp: 15 (WebCore::FrameView::invalidateRect): 16 (WebCore::FrameView::shouldUpdate): 17 * rendering/RenderBlock.cpp: 18 (WebCore::RenderBlock::paintContents): 19 * rendering/RenderLayer.cpp: 20 (WebCore::RenderLayer::paintLayer): 21 1 22 2011-04-15 Chris Rogers <crogers@google.com> 2 23 -
trunk/Source/WebCore/dom/Document.cpp
r84050 r84066 4977 4977 #endif 4978 4978 4979 static bool hasHeadSibling(const Document* document)4980 {4981 Node* de = document->documentElement();4982 if (!de)4983 return false;4984 4985 for (Node* i = de->firstChild(); i; i = i->nextSibling()) {4986 // A child of the document element which is rather than <head> is4987 // typically visible and FOUC safe. So we return true here.4988 if (!i->hasTagName(headTag))4989 return true;4990 }4991 4992 return false;4993 }4994 4995 bool Document::mayCauseFlashOfUnstyledContent() const4996 {4997 // Some kind of FOUC is caused by a repaint request before page's <body> arrival4998 // because page authors often give background styles to <body>, not to <html>.4999 // (And these styles are unavailable before <style> or <link> is given.)5000 // This functions is used for checking such possibility of FOUCs.5001 // Note that the implementation considers only empty or <head> only contents as a FOUC cause5002 // rather than missing <body>, because non-HTML document like SVG and arbitrary XML from foreign namespace5003 // should be painted even if there is no <body>.5004 if (didLayoutWithPendingStylesheets())5005 return true;5006 return !hasHeadSibling(this);5007 }5008 5009 4979 } // namespace WebCore -
trunk/Source/WebCore/dom/Document.h
r83990 r84066 1083 1083 #endif 1084 1084 1085 bool mayCauseFlashOfUnstyledContent() const;1086 1087 1085 virtual EventTarget* errorEventTarget(); 1088 1086 virtual void logExceptionToConsole(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>); -
trunk/Source/WebCore/page/FrameView.cpp
r83943 r84066 329 329 { 330 330 if (!parent()) { 331 if (hostWindow() && shouldUpdate())331 if (hostWindow()) 332 332 hostWindow()->invalidateContentsAndWindow(rect, false /*immediate*/); 333 333 return; … … 1839 1839 { 1840 1840 if (!immediateRequested && isOffscreen() && !shouldUpdateWhileOffscreen()) 1841 return false;1842 if (!m_frame || !m_frame->document() || m_frame->document()->mayCauseFlashOfUnstyledContent())1843 1841 return false; 1844 1842 return true; -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r83611 r84066 2359 2359 // It's ok not to draw, because later on, when all the stylesheets do load, updateStyleSelector on the Document 2360 2360 // will do a full repaint(). 2361 if (document()-> mayCauseFlashOfUnstyledContent() && !isRenderView())2361 if (document()->didLayoutWithPendingStylesheets() && !isRenderView()) 2362 2362 return; 2363 2363 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r83899 r84066 2497 2497 // It's ok not to draw, because later on, when all the stylesheets do load, updateStyleSelector on the Document 2498 2498 // will do a full repaint(). 2499 if (renderer()->document()-> mayCauseFlashOfUnstyledContent() && !renderer()->isRenderView() && !renderer()->isRoot())2499 if (renderer()->document()->didLayoutWithPendingStylesheets() && !renderer()->isRenderView() && !renderer()->isRoot()) 2500 2500 return; 2501 2501
Note: See TracChangeset
for help on using the changeset viewer.