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> 2009-03-18 Timothy Hatcher <timothy@apple.com>
   
Make the defered data loading timer honor the Page's scheduled runloop pairs. Make the defered data loading timer honor the Page's scheduled runloop pairs.
...@@ -81,6 +81,9 @@ static const double maxDeferredRepaintDelayDuringLoading = 0; ...@@ -81,6 +81,9 @@ static const double maxDeferredRepaintDelayDuringLoading = 0;
static const double deferredRepaintDelayIncrementDuringLoading = 0; static const double deferredRepaintDelayIncrementDuringLoading = 0;
#endif #endif
// The maximum number of updateWidgets iterations that should be done before returning.
static const unsigned maxUpdateWidgetsIterations = 2;
struct ScheduledEvent { struct ScheduledEvent {
RefPtr<Event> m_event; RefPtr<Event> m_event;
RefPtr<Node> m_eventTarget; RefPtr<Node> m_eventTarget;
...@@ -1054,6 +1057,29 @@ void FrameView::resumeScheduledEvents() ...@@ -1054,6 +1057,29 @@ void FrameView::resumeScheduledEvents()
ASSERT(m_scheduledEvents.isEmpty() || m_enqueueEvents); 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() void FrameView::performPostLayoutTasks()
{ {
if (m_firstLayoutCallbackPending) { if (m_firstLayoutCallbackPending) {
...@@ -1069,22 +1095,12 @@ void FrameView::performPostLayoutTasks() ...@@ -1069,22 +1095,12 @@ void FrameView::performPostLayoutTasks()
RenderView* root = m_frame->contentRenderer(); RenderView* root = m_frame->contentRenderer();
root->updateWidgetPositions(); root->updateWidgetPositions();
if (m_widgetUpdateSet && m_nestedLayoutCount <= 1) {
Vector<RenderPartObject*> objectVector; for (unsigned i = 0; i < maxUpdateWidgetsIterations; i++) {
copyToVector(*m_widgetUpdateSet, objectVector); if (updateWidgets())
size_t size = objectVector.size(); break;
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();
} }
resumeScheduledEvents(); resumeScheduledEvents();
if (!root->printing()) { if (!root->printing()) {
......
...@@ -211,6 +211,8 @@ private: ...@@ -211,6 +211,8 @@ private:
void updateDeferredRepaintDelay(); void updateDeferredRepaintDelay();
double adjustedDeferredRepaintDelay() const; double adjustedDeferredRepaintDelay() const;
bool updateWidgets();
static double sCurrentPaintTimeStamp; // used for detecting decoded resource thrash in the cache static double sCurrentPaintTimeStamp; // used for detecting decoded resource thrash in the cache
unsigned m_refCount; 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