[Webkit-unassigned] [Bug 35937] Support for HTMLProgressElement

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 11 04:04:26 PST 2010


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





--- Comment #13 from TAMURA, Kent <tkent at chromium.org>  2010-03-11 04:04:25 PST ---
(From update of attachment 50464)
I think an indeterminate <progress> should be animated, and progress bar
controls of Windows and Mac needs animation even if their value are not
changed. This patch seems to have no capability of such cases.


> Index: WebCore/platform/qt/RenderThemeQt.cpp
> ===================================================================
> --- WebCore/platform/qt/RenderThemeQt.cpp	(revision 55826)
> +++ WebCore/platform/qt/RenderThemeQt.cpp	(working copy)
> +bool RenderThemeQt::paintProgressBar(RenderObject* o, const RenderObject::PaintInfo& pi, const IntRect& r)
> +{
> +    StylePainter p(this, pi);
> +    if (!p.isValid())
> +       return true;
> +
> +    QStyleOptionProgressBarV2 option;
> +    if (p.widget)
> +       option.initFrom(p.widget);
> +    initializeCommonQStyleOptions(option, o);
> +
> +    RenderProgress* renderProgress = toRenderProgress(o);
> +    HTMLProgressElement* element = static_cast<HTMLProgressElement*>(renderProgress->node());
> +    option.rect = r;
> +    option.maximum = element->max();
> +    option.minimum = 0;
> +    option.progress = element->value();
> +
> +    const QPoint topLeft = r.topLeft();
> +    p.painter->translate(topLeft);
> +    option.rect.moveTo(QPoint(0, 0));
> +    option.rect.setSize(r.size());
> +
> +    p.drawControl(QStyle::CE_ProgressBar, option);
> +    p.painter->translate(-topLeft);
> +
> +    return false;
> +}

What is drawn if the progress element is indeterminate?

> Index: WebCore/rendering/RenderProgress.cpp
> ===================================================================
> --- WebCore/rendering/RenderProgress.cpp	(revision 0)
> +++ WebCore/rendering/RenderProgress.cpp	(revision 0)

> +RenderProgress::RenderProgress(Element* element)
> +    : RenderBlock(element)
> +{
> +    setSize(QSize(defaultProgressWidth, defaultProgressHeight));

Do not use QSize here.

-- 
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