[Webkit-unassigned] [Bug 163892] [GTK] Add function webkit_dom_element_get_bounding_client_rect

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 13 04:28:13 PDT 2017


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

Carlos Garcia Campos <cgarcia at igalia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #303650|review?                     |review+
              Flags|                            |

--- Comment #30 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 303650
  --> https://bugs.webkit.org/attachment.cgi?id=303650
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=303650&action=review

> Tools/TestWebKitAPI/Tests/WebKit2Gtk/DOMClientRectTest.cpp:26
> +static bool testClientRectPosition(WebKitDOMClientRect* clientRect)

This is only used inside the WebKitDOMClientRectTest, it can be a static function in the class instead of here. If you don't want it to look like a test case just renamed to something like checkClientRectPosition.

> Tools/TestWebKitAPI/Tests/WebKit2Gtk/DOMClientRectTest.cpp:49
> +    gfloat top, right, bottom, left, width, height;
> +    g_object_get(clientRect,
> +        "top", &top,
> +        "right", &right,
> +        "bottom", &bottom,
> +        "left", &left,
> +        "width", &width,
> +        "height", &height, nullptr);
> +    g_assert_cmpfloat(top, ==, -25);
> +    g_assert_cmpfloat(right, ==, 50);
> +    g_assert_cmpfloat(bottom, ==, 175);
> +    g_assert_cmpfloat(left, ==, -50);
> +    g_assert_cmpfloat(width, ==, 100);
> +    g_assert_cmpfloat(height, ==, 200);

We don't need to test this twice, g_object_get uses the public getters in the end

> Tools/TestWebKitAPI/Tests/WebKit2Gtk/DOMClientRectTest.cpp:51
> +    return true;

Test cases are boolean because they might return false to indicate that the test failed, even though most of the times they just r4eturn true and use asserts to make something fail.. But this is just a helper function.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170313/c88100f9/attachment.html>


More information about the webkit-unassigned mailing list