Commit 323fa91a authored by andersca@apple.com's avatar andersca@apple.com
Browse files

2009-03-19 Anders Carlsson <andersca@apple.com>

        Reviewed by Dan Bernstein.

        <rdar://problem/6682554> Flash content not being rendered (Shockwave Flash 10.0 r22)
        
        If calling updateWidget for some reason resulted in another widget being added to m_widgetUpdateSet, then
        that object would never be updated.
        
        * page/FrameView.cpp:
        (WebCore::FrameView::updateWidgets):
        Factor the widget updating code out into this method. Return true if the update set is empty.
        
        (WebCore::FrameView::performPostLayoutTasks):
        Loop over the update set multiple times until all widgets have been updated or until we reach the cap.
        
        * page/FrameView.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@41847 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 836aac94
2009-03-19 Anders Carlsson <andersca@apple.com>
Reviewed by Dan Bernstein.
<rdar://problem/6682554> Flash content not being rendered (Shockwave Flash 10.0 r22)
If calling updateWidget for some reason resulted in another widget being added to m_widgetUpdateSet, then
that object would never be updated.
* page/FrameView.cpp:
(WebCore::FrameView::updateWidgets):
Factor the widget updating code out into this method. Return true if the update set is empty.
(WebCore::FrameView::performPostLayoutTasks):
Loop over the update set multiple times until all widgets have been updated or until we reach the cap.
* page/FrameView.h:
2009-03-18 Timothy Hatcher <timothy@apple.com>
 
Make the defered data loading timer honor the Page's scheduled runloop pairs.
......@@ -81,6 +81,9 @@ static const double maxDeferredRepaintDelayDuringLoading = 0;
static const double deferredRepaintDelayIncrementDuringLoading = 0;
#endif
// The maximum number of updateWidgets iterations that should be done before returning.
static const unsigned maxUpdateWidgetsIterations = 2;
struct ScheduledEvent {
RefPtr<Event> m_event;
RefPtr<Node> m_eventTarget;
......@@ -1054,6 +1057,29 @@ void FrameView::resumeScheduledEvents()
ASSERT(m_scheduledEvents.isEmpty() || m_enqueueEvents);
}
bool FrameView::updateWidgets()
{
if (m_nestedLayoutCount > 1 || !m_widgetUpdateSet || m_widgetUpdateSet->isEmpty())
return true;
Vector<RenderPartObject*> objectVector;
copyToVector(*m_widgetUpdateSet, objectVector);
size_t size = objectVector.size();
for (size_t i = 0; i < size; ++i) {
RenderPartObject* object = objectVector[i];
object->updateWidget(false);
// updateWidget() can destroy the RenderPartObject, so we need to make sure it's
// alive by checking if it's still in m_widgetUpdateSet.
if (m_widgetUpdateSet->contains(object)) {
object->updateWidgetPosition();
m_widgetUpdateSet->remove(object);
}
}
return m_widgetUpdateSet->isEmpty();
}
void FrameView::performPostLayoutTasks()
{
if (m_firstLayoutCallbackPending) {
......@@ -1069,20 +1095,10 @@ void FrameView::performPostLayoutTasks()
RenderView* root = m_frame->contentRenderer();
root->updateWidgetPositions();
if (m_widgetUpdateSet && m_nestedLayoutCount <= 1) {
Vector<RenderPartObject*> objectVector;
copyToVector(*m_widgetUpdateSet, objectVector);
size_t size = objectVector.size();
for (size_t i = 0; i < size; ++i) {
RenderPartObject* object = objectVector[i];
object->updateWidget(false);
// updateWidget() can destroy the RenderPartObject, so we need to make sure it's
// alive by checking if it's still in m_widgetUpdateSet.
if (m_widgetUpdateSet->contains(object))
object->updateWidgetPosition();
}
m_widgetUpdateSet->clear();
for (unsigned i = 0; i < maxUpdateWidgetsIterations; i++) {
if (updateWidgets())
break;
}
resumeScheduledEvents();
......
......@@ -211,6 +211,8 @@ private:
void updateDeferredRepaintDelay();
double adjustedDeferredRepaintDelay() const;
bool updateWidgets();
static double sCurrentPaintTimeStamp; // used for detecting decoded resource thrash in the cache
unsigned m_refCount;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment