Bug 26377 - [GTK] Confusion about range of 'progress' property
Summary: [GTK] Confusion about range of 'progress' property
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-13 15:33 PDT by Xan Lopez
Modified: 2009-06-15 13:26 PDT (History)
1 user (show)

See Also:


Attachments
progress.patch (3.00 KB, patch)
2009-06-15 08:31 PDT, Xan Lopez
no flags Details | Formatted Diff | Diff
progress.patch (1.63 KB, patch)
2009-06-15 08:55 PDT, Xan Lopez
gustavo: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xan Lopez 2009-06-13 15:33:19 PDT
The definition of the property 'progress' in WebKitWebView says it goes from 0.0 to 1.0:

    g_object_class_install_property(objectClass, PROP_PROGRESS,
                                    g_param_spec_double("progress",
                                                        "Progress",
                                                        "Determines the current progress of the load",
                                                        0.0, 1.0, 1.0,
                                                        WEBKIT_PARAM_READABLE));

But its actual implementation uses 0.0 to 100.0:

gdouble webkit_web_view_get_progress(WebKitWebView* webView)
{
    g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 1.0);

    return lround(core(webView)->progress()->estimatedProgress() * 100);
}

Notice that even in the same function the error/default value is 1.0 !
Comment 1 Xan Lopez 2009-06-15 08:31:48 PDT
Created attachment 31292 [details]
progress.patch

Do not multiply the value in get_progress by 100.
Comment 2 Xan Lopez 2009-06-15 08:55:04 PDT
Created attachment 31293 [details]
progress.patch

Ehm, get rid of the lround too, it's useless.
Comment 3 Gustavo Noronha (kov) 2009-06-15 13:23:00 PDT
Comment on attachment 31293 [details]
progress.patch

Yep!
Comment 4 Xan Lopez 2009-06-15 13:26:12 PDT
Thanks, landed as r44694.