Bug 105546 - Add window.internals.nonFastScrollableRects for testing scrollable areas in fast/slow paths
Summary: Add window.internals.nonFastScrollableRects for testing scrollable areas in f...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Xianzhu Wang
URL:
Keywords:
Depends on:
Blocks: 104950 105075
  Show dependency treegraph
 
Reported: 2012-12-20 09:41 PST by Xianzhu Wang
Modified: 2013-01-07 14:15 PST (History)
12 users (show)

See Also:


Attachments
Patch to grab missing symbols on ews (10.21 KB, patch)
2012-12-20 10:42 PST, Xianzhu Wang
no flags Details | Formatted Diff | Diff
Patch to grab win symbol (12.33 KB, patch)
2012-12-20 11:15 PST, Xianzhu Wang
no flags Details | Formatted Diff | Diff
Patch for review (13.92 KB, patch)
2012-12-20 13:09 PST, Xianzhu Wang
no flags Details | Formatted Diff | Diff
Patch to fail to grab win symbol (11.56 KB, patch)
2012-12-21 10:01 PST, Xianzhu Wang
no flags Details | Formatted Diff | Diff
Retry ews-win to grab symbol (11.47 KB, patch)
2012-12-21 17:35 PST, Xianzhu Wang
no flags Details | Formatted Diff | Diff
Patch (12.17 KB, patch)
2013-01-04 10:52 PST, Xianzhu Wang
no flags Details | Formatted Diff | Diff
Patch (10.31 KB, patch)
2013-01-04 11:48 PST, Xianzhu Wang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xianzhu Wang 2012-12-20 09:41:40 PST
We need to test if a scrollable area will be scrolled in fast/slow path in bug 105075 and bug 104950.
Comment 1 Xianzhu Wang 2012-12-20 10:42:57 PST
Created attachment 180364 [details]
Patch to grab missing symbols on ews
Comment 2 Build Bot 2012-12-20 11:06:46 PST
Comment on attachment 180364 [details]
Patch to grab missing symbols on ews

Attachment 180364 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/15459060
Comment 3 Xianzhu Wang 2012-12-20 11:15:49 PST
Created attachment 180375 [details]
Patch to grab win symbol
Comment 4 Build Bot 2012-12-20 11:52:39 PST
Comment on attachment 180375 [details]
Patch to grab win symbol

Attachment 180375 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/15461038
Comment 5 Xianzhu Wang 2012-12-20 13:09:52 PST
Created attachment 180396 [details]
Patch for review
Comment 6 Tien-Ren Chen 2012-12-20 19:16:41 PST
I think it would be more useful to export the rects as javascript arrays. That way it is easier to write test scripts to generate absolute <divs> on the page, in case we want to make it a pixel test.
Comment 7 Xianzhu Wang 2012-12-21 10:01:32 PST
(In reply to comment #6)
> I think it would be more useful to export the rects as javascript arrays. That way it is easier to write test scripts to generate absolute <divs> on the page, in case we want to make it a pixel test.

Done.
Comment 8 Xianzhu Wang 2012-12-21 10:01:53 PST
Created attachment 180531 [details]
Patch to fail to grab win symbol
Comment 9 Build Bot 2012-12-21 10:31:55 PST
Comment on attachment 180531 [details]
Patch to fail to grab win symbol

Attachment 180531 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/15455461
Comment 10 Tien-Ren Chen 2012-12-21 14:53:58 PST
(In reply to comment #7)
> (In reply to comment #6)
> > I think it would be more useful to export the rects as javascript arrays. That way it is easier to write test scripts to generate absolute <divs> on the page, in case we want to make it a pixel test.
> 
> Done.

Thanks! I really like this patch!

nits: By the way, the rects returned will be in absolute coordinates right? I think we can reuse ClientRect as the return type -- not worth the trouble to create another rect type, and some other internal functions are already doing this. However I think we should document it somehow. Maybe a line of comment? Or change the function name to nonFastScrollableAbsoluteRects? I don't have a strong opinion to either. Your call.
Comment 11 Xianzhu Wang 2012-12-21 16:48:54 PST
(In reply to comment #10)
> Thanks! I really like this patch!
> 
> nits: By the way, the rects returned will be in absolute coordinates right? I think we can reuse ClientRect as the return type -- not worth the trouble to create another rect type, and some other internal functions are already doing this. However I think we should document it somehow. Maybe a line of comment? Or change the function name to nonFastScrollableAbsoluteRects? I don't have a strong opinion to either. Your call.

The rects will be in the coordinates of the frame corresponding to the document parameter of the function.
Comment 12 Xianzhu Wang 2012-12-21 17:35:05 PST
Created attachment 180580 [details]
Retry ews-win to grab symbol
Comment 13 Tien-Ren Chen 2012-12-21 17:36:37 PST
(In reply to comment #11)
> (In reply to comment #10)
> > Thanks! I really like this patch!
> > 
> > nits: By the way, the rects returned will be in absolute coordinates right? I think we can reuse ClientRect as the return type -- not worth the trouble to create another rect type, and some other internal functions are already doing this. However I think we should document it somehow. Maybe a line of comment? Or change the function name to nonFastScrollableAbsoluteRects? I don't have a strong opinion to either. Your call.
> 
> The rects will be in the coordinates of the frame corresponding to the document parameter of the function.

It is absolute rect, as seen from:
IntRect RenderLayer::scrollableAreaBoundingBox() const
{
    return renderer()->absoluteBoundingBoxRect();
}

The definition of absolute rect is simple. Means its position is the same as if you add a position:absolute box on the document body.

It becomes complicated with the Chromium Android scaling model (applyPageScaleFactorInCompositor() == false) though. In this mode RenderObject::absoluteRect WILL BE SCALED by the page scale factor. That is why we have another term "normalized coordinate" to describe the unscaled absolute rect. It is unlikely to fix absolute rect without breaking everything. Sorry. :(

Bonus: We also have this client coordinate, which is measured relative to the upper left of the viewport, in CSS pixels. It is essentially the same as if you add a position:fixed box on the document body. (Not entirely true, FrameView::scrollOffsetForFixedPosition() can return arbitrary offset to layout fixed position) For Chromium Android M18 the client coordinates have similar scaling problem as absolute coordinates. I submitted a few patches recently to make sure most of the DOM object to correctly input/output unscaled coordinate. In next release they will work properly.
Comment 14 Build Bot 2012-12-21 22:55:49 PST
Comment on attachment 180580 [details]
Retry ews-win to grab symbol

Attachment 180580 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/15451681
Comment 15 Xianzhu Wang 2013-01-04 10:52:40 PST
Created attachment 181333 [details]
Patch
Comment 16 James Robinson 2013-01-04 11:00:50 PST
Comment on attachment 181333 [details]
Patch

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

> Source/WebCore/dom/ClientRectList.h:43
>          static PassRefPtr<ClientRectList> create(const Vector<FloatQuad>& quads) { return adoptRef(new ClientRectList(quads)); }
> +        static PassRefPtr<ClientRectList> create(const Vector<FloatRect>& rects) { return adoptRef(new ClientRectList(rects)); }

Is this necessary?  All FloatRects are also FloatQuads and I don't think this case is performance sensitive enough to need special casing.
Comment 17 Xianzhu Wang 2013-01-04 11:48:05 PST
Created attachment 181350 [details]
Patch
Comment 18 Xianzhu Wang 2013-01-04 11:50:13 PST
(In reply to comment #16)
> (From update of attachment 181333 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=181333&action=review
> 
> > Source/WebCore/dom/ClientRectList.h:43
> >          static PassRefPtr<ClientRectList> create(const Vector<FloatQuad>& quads) { return adoptRef(new ClientRectList(quads)); }
> > +        static PassRefPtr<ClientRectList> create(const Vector<FloatRect>& rects) { return adoptRef(new ClientRectList(rects)); }
> 
> Is this necessary?  All FloatRects are also FloatQuads and I don't think this case is performance sensitive enough to need special casing.

Agreed. Removed the added create() and constructor.
Comment 19 Xianzhu Wang 2013-01-07 12:02:09 PST
@jamesr, does the latest patch look good to you?
Comment 20 James Robinson 2013-01-07 13:44:51 PST
Comment on attachment 181350 [details]
Patch

R=me
Comment 21 WebKit Review Bot 2013-01-07 14:14:55 PST
Comment on attachment 181350 [details]
Patch

Clearing flags on attachment: 181350

Committed r138991: <http://trac.webkit.org/changeset/138991>
Comment 22 WebKit Review Bot 2013-01-07 14:15:02 PST
All reviewed patches have been landed.  Closing bug.