[Webkit-unassigned] [Bug 37308] [Chromium] Support HTML5 <progress> element on Windows.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 21 14:51:47 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=37308


Darin Fisher (:fishd, Google) <fishd at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #53968|review?                     |review-
               Flag|                            |




--- Comment #13 from Darin Fisher (:fishd, Google) <fishd at chromium.org>  2010-04-21 14:51:47 PST ---
(From update of attachment 53968)
> +++ b/WebCore/rendering/RenderThemeChromiumWin.cpp
...
> +bool RenderThemeChromiumWin::paintProgressBar(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
> +{
> +    RenderProgress* renderProgress = toRenderProgress(o);
> +
> +    int fillPart;
> +    IntRect fillRect;
> +    if (renderProgress->isDeterminate()) {
> +        fillPart = PP_FILL;
> +        int dx = r.width() * renderProgress->position();
> +        if (renderProgress->style()->direction() == RTL)
> +            fillRect = IntRect(r.x() + r.width() - dx, r.y(), dx, r.height());
> +        else
> +            fillRect = IntRect(r.x(), r.y(), dx, r.height());
> +    } else {
> +        fillPart = PP_MOVEOVERLAY;
> +        int dx = r.width() * renderProgress->animationProgress() * 2 - r.width();
> +        fillRect = IntRect(r.x() + dx, r.y(), r.width(), r.height());
> +    }
> +
> +    WebCore::ThemePainter painter(i.context, r);

nit: no need for the WebCore:: prefix when you are in the WebCore namespace.


> +    ChromiumBridge::paintProgressBar(painter.context(),
> +                                     PP_BAR,
> +                                     0,
> +                                     r, 
> +                                     fillPart,
> +                                     0,
> +                                     fillRect);

It looks like barState and fillState are not used.  Should those
parameters be excluded?  Also, is there any reason to pass PP_BAR
given that it is a constant?  It seems like the callee would know
to pass PP_BAR on to Windows.


> +++ b/WebKit/chromium/public/win/WebThemeEngine.h
...
> @@ -73,6 +73,10 @@ public:
>      virtual void paintTrackbar(
>          WebCanvas*, int part, int state, int classicState,
>          const WebRect&) = 0;
> +
> +    virtual void paintProgressBar(
> +        WebCanvas*, int barPart, int barState, const WebRect& barRect, 
> +        int fillPart, int fillState, const WebRect& fillRect) {} // FIXME: make pure virtual after implementation landed.
>  };

^^^ we should actually make any embedder implemented methods non-pure.
the old way was for them to be pure, but that makes it harder to change
the API.  the new way is to make methods like these non-pure.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list