[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
hyatt
hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:39:19 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit c2a41aad822a361cd39d8cecd10987b8e12915af
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu May 13 01:01:58 2004 +0000
Improve layout scheduling. Make sure no layouts can be scheduled until over a minimum delay threshold.
* khtml/khtmlview.cpp:
(KHTMLView::scheduleRelayout):
* khtml/rendering/render_frames.cpp:
(RenderPart::updateWidgetPositions):
* khtml/rendering/render_text.cpp:
(RenderText::paint):
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::DocumentImpl):
(DocumentImpl::close):
(DocumentImpl::setParsing):
(DocumentImpl::shouldScheduleLayout):
(DocumentImpl::minimumLayoutDelay):
* khtml/xml/dom_docimpl.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6584 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 13b603a..6c33d97 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,21 @@
+2004-05-12 David Hyatt <hyatt at apple.com>
+
+ Improve layout scheduling. Make sure no layouts can be scheduled until over a minimum delay threshold.
+
+ * khtml/khtmlview.cpp:
+ (KHTMLView::scheduleRelayout):
+ * khtml/rendering/render_frames.cpp:
+ (RenderPart::updateWidgetPositions):
+ * khtml/rendering/render_text.cpp:
+ (RenderText::paint):
+ * khtml/xml/dom_docimpl.cpp:
+ (DocumentImpl::DocumentImpl):
+ (DocumentImpl::close):
+ (DocumentImpl::setParsing):
+ (DocumentImpl::shouldScheduleLayout):
+ (DocumentImpl::minimumLayoutDelay):
+ * khtml/xml/dom_docimpl.h:
+
2004-05-11 Chris Blumenberg <cblu at apple.com>
Support for: <rdar://problem/3616471>: (API: provide way to get from WebFrame to DOMDocument and vice versa)
diff --git a/WebCore/khtml/khtmlview.cpp b/WebCore/khtml/khtmlview.cpp
index 053e830..2745a35 100644
--- a/WebCore/khtml/khtmlview.cpp
+++ b/WebCore/khtml/khtmlview.cpp
@@ -1824,15 +1824,10 @@ void KHTMLView::scheduleRelayout()
if (!d->layoutSchedulingEnabled)
return;
- if (d->layoutTimerId)
+ if (d->layoutTimerId || (m_part->xmlDocImpl() && !m_part->xmlDocImpl()->shouldScheduleLayout()))
return;
- bool parsing = false;
- if( m_part->xmlDocImpl() ) {
- parsing = m_part->xmlDocImpl()->parsing();
- }
-
- d->layoutTimerId = startTimer( parsing ? 1000 : 0 );
+ d->layoutTimerId = startTimer(m_part->xmlDocImpl() ? m_part->xmlDocImpl()->minimumLayoutDelay() : 0);
}
void KHTMLView::unscheduleRelayout()
diff --git a/WebCore/khtml/rendering/render_frames.cpp b/WebCore/khtml/rendering/render_frames.cpp
index 0c4a25b..2a702b3 100644
--- a/WebCore/khtml/rendering/render_frames.cpp
+++ b/WebCore/khtml/rendering/render_frames.cpp
@@ -998,7 +998,7 @@ void RenderPart::updateWidgetPositions()
QScrollView *view = static_cast<QScrollView *>(m_widget);
if (view && view->inherits("KHTMLView"))
- static_cast<KHTMLView*>(view)->scheduleRelayout();
+ static_cast<KHTMLView*>(view)->layout();
}
}
#endif
diff --git a/WebCore/khtml/rendering/render_text.cpp b/WebCore/khtml/rendering/render_text.cpp
index 2b44a1a..6591977 100644
--- a/WebCore/khtml/rendering/render_text.cpp
+++ b/WebCore/khtml/rendering/render_text.cpp
@@ -668,13 +668,6 @@ void RenderText::paint(PaintInfo& i, int tx, int ty)
do {
if (isPrinting)
{
- // FIXME: Need to understand what this section is doing.
- if (ty+s->m_y < i.r.y())
- {
- // This has been printed already we suppose.
- continue;
- }
-
if (ty+s->m_y+s->height() > i.r.y() + i.r.height())
{
RenderCanvas* canvasObj = canvas();
diff --git a/WebCore/khtml/xml/dom_docimpl.cpp b/WebCore/khtml/xml/dom_docimpl.cpp
index 1547ea7..2202f03 100644
--- a/WebCore/khtml/xml/dom_docimpl.cpp
+++ b/WebCore/khtml/xml/dom_docimpl.cpp
@@ -323,6 +323,7 @@ DocumentImpl::DocumentImpl(DOMImplementationImpl *_implementation, KHTMLView *v)
m_processingLoadEvent = false;
m_startTime.restart();
+ m_overMinimumLayoutThreshold = false;
}
DocumentImpl::~DocumentImpl()
@@ -1307,7 +1308,7 @@ void DocumentImpl::close()
bool isRedirectingSoon = view() && view()->part()->d->m_scheduledRedirection != noRedirectionScheduled && view()->part()->d->m_scheduledRedirection != historyNavigationScheduled && view()->part()->d->m_delayRedirect == 0;
- if (doload && wasNotRedirecting && isRedirectingSoon && m_startTime.elapsed() < 1000) {
+ if (doload && wasNotRedirecting && isRedirectingSoon && m_startTime.elapsed() < cLayoutTimerDelay) {
// Just bail out. During the onload we were shifted to another page.
// i-Bench does this. When this happens don't bother painting or laying out.
delete m_tokenizer;
@@ -1354,16 +1355,32 @@ void DocumentImpl::setParsing(bool b)
{
if (m_bParsing != b) {
m_bParsing = b;
-#if 0
- // Remove optimization until we figure out a way to avoid breaking our ibench cheat.
- if (!b && haveStylesheetsLoaded() &&
+ if (!b && haveStylesheetsLoaded() && !minimumLayoutDelay() &&
(!ownerElement() || (ownerElement()->renderer() && !ownerElement()->renderer()->needsLayout())) &&
renderer() && renderer()->needsLayout())
updateLayout();
-#endif
}
}
+
+bool DocumentImpl::shouldScheduleLayout()
+{
+ return renderer() && haveStylesheetsLoaded() && (!m_tokenizer || m_overMinimumLayoutThreshold || m_startTime.elapsed() > cLayoutScheduleThreshold);
+}
+
+int DocumentImpl::minimumLayoutDelay()
+{
+ if (!parsing() && m_overMinimumLayoutThreshold)
+ return 0;
+
+ int elapsed = m_startTime.elapsed();
+ m_overMinimumLayoutThreshold = elapsed > cLayoutScheduleThreshold;
+ if (parsing()) // Always want the nearest multiple of the timer delay.
+ return cLayoutTimerDelay - elapsed % cLayoutTimerDelay;
+ // We'll want to schedule the timer to fire at the minimum layout threshold.
+ return kMax(0, cLayoutScheduleThreshold - elapsed);
+}
+
void DocumentImpl::write( const DOMString &text )
{
write(text.string());
diff --git a/WebCore/khtml/xml/dom_docimpl.h b/WebCore/khtml/xml/dom_docimpl.h
index cad8538..30ab8db 100644
--- a/WebCore/khtml/xml/dom_docimpl.h
+++ b/WebCore/khtml/xml/dom_docimpl.h
@@ -55,6 +55,13 @@ class RenderArena;
class KWQAccObjectCache;
#endif
+// This amount of time must have elapsed before we will even consider scheduling a layout without a delay.
+const int cLayoutScheduleThreshold = 250;
+
+// This is the amount of time we will delay doing a layout whenever we are either still parsing, or
+// when the minimum amount of time according to the |cLayoutScheduleThreshold| has not yet elapsed.
+const int cLayoutTimerDelay = 1000;
+
namespace khtml {
class CSSStyleSelector;
class DocLoader;
@@ -340,6 +347,8 @@ public:
void setParsing(bool b);
bool parsing() const { return m_bParsing; }
+ int minimumLayoutDelay();
+ bool shouldScheduleLayout();
void setTextColor( QColor color ) { m_textColor = color; }
QColor textColor() const { return m_textColor; }
@@ -610,7 +619,8 @@ protected:
bool m_processingLoadEvent;
QTime m_startTime;
-
+ bool m_overMinimumLayoutThreshold;
+
#ifndef KHTML_NO_XBL
XBL::XBLBindingManager* m_bindingManager; // The access point through which documents and elements communicate with XBL.
#endif
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list