Bug 93693 - [WK2] REGRESSION(125091): pixel results don't show scrollbars anymore
Summary: [WK2] REGRESSION(125091): pixel results don't show scrollbars anymore
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Beth Dakin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-10 00:16 PDT by Balazs Kelemen
Modified: 2012-08-15 13:01 PDT (History)
8 users (show)

See Also:


Attachments
Patch (1.41 KB, patch)
2012-08-10 00:21 PDT, Balazs Kelemen
mitz: review-
Details | Formatted Diff | Diff
Patch that adds new SnapshotOptions (10.32 KB, patch)
2012-08-10 13:46 PDT, Beth Dakin
no flags Details | Formatted Diff | Diff
Patch for style bot (10.30 KB, patch)
2012-08-10 13:54 PDT, Beth Dakin
no flags Details | Formatted Diff | Diff
Patch (11.32 KB, patch)
2012-08-12 23:13 PDT, Beth Dakin
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Balazs Kelemen 2012-08-10 00:16:33 PDT
A typo was made in the patch, it calls FrameView::paintContents instead of paint so ScrollView has not got a chance to take care about scrollbars.
Comment 1 Balazs Kelemen 2012-08-10 00:21:34 PDT
Created attachment 157649 [details]
Patch
Comment 2 mitz 2012-08-10 00:30:47 PDT
Comment on attachment 157649 [details]
Patch

This is not the right fix. Prior to r125091, WebPage had two functions for taking snapshots, snapshotInViewCoordinates, which captured scroll bars (and only the visible part of the document view) and snapshotInDocumentCoordinates, which didn’t capture scroll bar (and could capture any part of the document view). r125091 neglected to notice this difference and left only one function which works similarly to the old snapshotInDocumentCoordinates, and made WKBundlePageCreateSnapshotInViewCoordinates call into it.
Comment 3 Balazs Kelemen 2012-08-10 00:44:02 PDT
I'm confused. The author, Beth Dakin said the change in pixel test behavior was not intentional. Isn't the unified method supposed to behave like snapshotInViewCoordinates (it is in fact called from WKBundlePageCreateSnapshotInViewCoordinates)?
Comment 4 mitz 2012-08-10 00:47:33 PDT
(In reply to comment #3)
> I'm confused. The author, Beth Dakin said the change in pixel test behavior was not intentional.

Correct.

> Isn't the unified method supposed to behave like snapshotInViewCoordinates (it is in fact called from WKBundlePageCreateSnapshotInViewCoordinates)?

No, it isn’t. It is also called from WKBundlePageCreateSnapshotInDocumentCoordinates, which expects it to have the behavior snapshotInDocumentCoordinates had. The fix is to either separate the function back into two, or add an option telling it how to behave, so that it can keep serving both APIs as expected.
Comment 5 Beth Dakin 2012-08-10 11:28:24 PDT
(In reply to comment #4)
> No, it isn’t. It is also called from WKBundlePageCreateSnapshotInDocumentCoordinates, which expects it to have the behavior snapshotInDocumentCoordinates had. The fix is to either separate the function back into two, or add an option telling it how to behave, so that it can keep serving both APIs as expected.

I think we should add a new SnapshotOptions for including or excluding the scrollbar, much like there is an option fro including/excluding selection highlighting. The FrameView::paintContentsForSnapshot could take another parameter of representing whether it should include scrollbars and call paint() or not and call paintContents().
Comment 6 Beth Dakin 2012-08-10 11:29:06 PDT
(In reply to comment #5)
> (In reply to comment #4)
> > No, it isn’t. It is also called from WKBundlePageCreateSnapshotInDocumentCoordinates, which expects it to have the behavior snapshotInDocumentCoordinates had. The fix is to either separate the function back into two, or add an option telling it how to behave, so that it can keep serving both APIs as expected.
> 
> I think we should add a new SnapshotOptions for including or excluding the scrollbar, much like there is an option fro including/excluding selection highlighting. The FrameView::paintContentsForSnapshot could take another parameter of representing whether it should include scrollbars and call paint() or not and call paintContents().

And I am happy to write up this patch if you are busy, Balazs. Just let me know.
Comment 7 Balazs Kelemen 2012-08-10 11:43:05 PDT
> > I think we should add a new SnapshotOptions for including or excluding the scrollbar, much like there is an option fro including/excluding selection highlighting. The FrameView::paintContentsForSnapshot could take another parameter of representing whether it should include scrollbars and call paint() or not and call paintContents().
> 
> And I am happy to write up this patch if you are busy, Balazs. Just let me know.

Well, yes I had other stuff to do, and now it's already late evening here, so I appreciate if you pick this up :)
Comment 8 Beth Dakin 2012-08-10 13:46:40 PDT
Created attachment 157802 [details]
Patch that adds new SnapshotOptions
Comment 9 WebKit Review Bot 2012-08-10 13:50:56 PDT
Attachment 157802 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/page/FrameView.h:251:  The parameter name "coordinateSpace" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 10 Beth Dakin 2012-08-10 13:54:58 PDT
Created attachment 157804 [details]
Patch for style bot
Comment 11 Beth Dakin 2012-08-12 23:13:35 PDT
Created attachment 157923 [details]
Patch
Comment 12 Balazs Kelemen 2012-08-15 10:38:05 PDT
(In reply to comment #11)
> Created an attachment (id=157923) [details]
> Patch

That seems fine to me, could somebody review the patch?
Comment 13 Beth Dakin 2012-08-15 13:01:00 PDT
Thanks Sam! Committed http://trac.webkit.org/changeset/125700