Bug 22842 - [Gtk] Top offsets of elements in DumpRenderTree are incorrect
Summary: [Gtk] Top offsets of elements in DumpRenderTree are incorrect
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2008-12-13 03:44 PST by Zan Dobersek
Modified: 2008-12-31 09:01 PST (History)
0 users

See Also:

Patch for reproducing the problem (1.06 KB, patch)
2008-12-13 04:33 PST, Zan Dobersek
no flags Details | Formatted Diff | Diff
Fix - move size allocation to a proper place (2.02 KB, patch)
2008-12-28 08:45 PST, Zan Dobersek
zecke: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2008-12-13 03:44:18 PST
Element's top offset values when running the tests through DumpRenderTree differ from those when viewing test in GtkLauncher.

A proof-of-problem patch to come.
Comment 1 Zan Dobersek 2008-12-13 04:33:39 PST
Created attachment 25997 [details]
Patch for reproducing the problem

This patch works with tests for SVG dynamic updates.

Through all these tests, the two outputs seem to be constant:
- when viewing any test in GtkLauncher, top offset is 66,
- when running any test in DRT, top offset is 311.
Left offset is always 8.

The difference occurs in RenderObject's offsetTop function, more precisely in this iteration[1] - it goes through one loop, in which curr is a RenderObject with #document node and is not a table row.
His yPos() is then added to y. In GtkLauncher, 58 is added to y, while in DRT y is increased by 303.
y then increases to the final value when offsetPar is recognized as a body and adds its yPos() (which equals to 8) to the y variable.

[1] http://trac.webkit.org/browser/trunk/WebCore/rendering/RenderObject.cpp#L538
Comment 2 Zan Dobersek 2008-12-28 08:45:24 PST
Created attachment 26279 [details]
Fix - move size allocation to a proper place

As it turns out, the problem is solved with a proper placement of widget's size allocation.

At the moment, size allocation is done at dumping, when testing is already done. However, it should be done before loading the test in the WebKitWebView.

Patch changes this.
Comment 3 Holger Freyther 2008-12-31 09:01:41 PST
Landed in r39529.