Bug 74367 - WebCore has two (disconnected) ways to keep track of updated widgets, should be unified
Summary: WebCore has two (disconnected) ways to keep track of updated widgets, should ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Seidel (no email)
URL:
Keywords:
Depends on:
Blocks: 77167
  Show dependency treegraph
 
Reported: 2011-12-12 16:09 PST by Eric Seidel (no email)
Modified: 2012-01-30 17:37 PST (History)
4 users (show)

See Also:


Attachments
Patch (6.06 KB, patch)
2011-12-12 17:06 PST, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2011-12-12 16:09:31 PST
WebCore has two (disconnected) ways to keep track of updated widgets, should be unified

I added a comment about this a while back, but finally looking at fixing it:

void HTMLObjectElement::updateWidget(PluginCreationOption pluginCreationOption)
{
    ASSERT(!renderEmbeddedObject()->pluginCrashedOrWasMissing());
    // FIXME: We should ASSERT(needsWidgetUpdate()), but currently
    // FrameView::updateWidget() calls updateWidget(false) without checking if
    // the widget actually needs updating!
    setNeedsWidgetUpdate(false);

void HTMLEmbedElement::updateWidget(PluginCreationOption pluginCreationOption)
{
    ASSERT(!renderEmbeddedObject()->pluginCrashedOrWasMissing());
    // FIXME: We should ASSERT(needsWidgetUpdate()), but currently
    // FrameView::updateWidget() calls updateWidget(false) without checking if
    // the widget actually needs updating!

The comment is slightly out of date since updateWidget now takes an enum (yay!) but the point is the same.

The DOM-based "is this widget dirty" bool has been with us since the original kde import:
http://trac.webkit.org/browser/trunk/WebCore/khtml/html/html_objectimpl.h?annotate=blame&rev=8844#L140

The FrameView "dirty widgets" list was added by bdakin in:
http://trac.webkit.org/changeset/25726 (in a sekret radar).

The FrameView need makes sense.  So maybe what should happen is that
void FrameView::addWidgetToUpdate(RenderEmbeddedObject* object)
should just also call setNeedsWidgetUpdate() and that updateWidgets() should check to make sure that the update is
still needed when its run.

It's unclear if this list makes sense on FrameView long-term, as we move more plugin stuff out of the renderers and onto DOM objects like HTMLPluginElement/HTMLPluginImageElement, etc.
Comment 1 Eric Seidel (no email) 2011-12-12 17:06:11 PST
Created attachment 118912 [details]
Patch
Comment 2 WebKit Review Bot 2011-12-15 14:00:28 PST
Comment on attachment 118912 [details]
Patch

Clearing flags on attachment: 118912

Committed r102983: <http://trac.webkit.org/changeset/102983>
Comment 3 WebKit Review Bot 2011-12-15 14:00:32 PST
All reviewed patches have been landed.  Closing bug.