Bug 127371 - Explore new API that could be used to help build infinitely scrolling websites
Summary: Explore new API that could be used to help build infinitely scrolling websites
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Beth Dakin
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-01-21 14:54 PST by Beth Dakin
Modified: 2014-01-30 11:21 PST (History)
21 users (show)

See Also:


Attachments
Patch (12.12 KB, patch)
2014-01-21 15:50 PST, Beth Dakin
no flags Details | Formatted Diff | Diff
Patch (12.14 KB, patch)
2014-01-21 16:00 PST, Beth Dakin
no flags Details | Formatted Diff | Diff
Patch (12.20 KB, patch)
2014-01-21 16:23 PST, Beth Dakin
no flags Details | Formatted Diff | Diff
Patch (12.34 KB, patch)
2014-01-22 13:57 PST, Beth Dakin
no flags Details | Formatted Diff | Diff
Patch (22.46 KB, patch)
2014-01-25 20:48 PST, Beth Dakin
no flags Details | Formatted Diff | Diff
Patch (28.18 KB, patch)
2014-01-27 23:23 PST, Beth Dakin
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2 (563.43 KB, application/zip)
2014-01-28 00:47 PST, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-02 for mac-mountainlion (483.51 KB, application/zip)
2014-01-28 01:15 PST, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2 (503.49 KB, application/zip)
2014-01-28 01:53 PST, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-03 for mac-mountainlion (557.96 KB, application/zip)
2014-01-28 03:43 PST, Build Bot
no flags Details
Patch (28.08 KB, patch)
2014-01-28 15:02 PST, 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 Beth Dakin 2014-01-21 14:54:23 PST
We want to explore new API that could be used to help build infinitely scrolling websites.

<rdar://problem/14935014>
Comment 1 Beth Dakin 2014-01-21 15:50:00 PST
Created attachment 221798 [details]
Patch

Here's a patch we can use as a jumping point for further discussion.
Comment 2 Beth Dakin 2014-01-21 16:00:01 PST
Created attachment 221800 [details]
Patch
Comment 3 Beth Dakin 2014-01-21 16:23:33 PST
Created attachment 221804 [details]
Patch
Comment 4 Sam Weinig 2014-01-21 21:41:07 PST
Comment on attachment 221804 [details]
Patch

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

> Source/WebCore/ChangeLog:11
> +        This patch adds 4 new events that will fire when the user has scrolled close to 
> +        corresponding edge of the document.

This could use some fleshing out, perhaps listing the new event names.

> Source/WebCore/html/HTMLAttributeNames.in:275
> +onwebkitwillrevealbottom
> +onwebkitwillrevealleft
> +onwebkitwillrevealright
> +onwebkitwillrevealtop

I'm not sure we need to support these as attributes, but Ted should weigh in.

> Source/WebCore/page/FrameView.cpp:2949
> +    // For each direction (top, bottom, left and right), send the will reveal edge event for that direction

Nit: Top and bottom aren't really directions, maybe, "edge"?

> Source/WebCore/page/FrameView.cpp:2964
> +            frame().document()->dispatchWindowEvent(willRevealEvent.release(), frame().document()->domWindow());

We should probably fire these asynchronously, which can be done via frame().document()->enqueueWindowEvent(event.release()); We may also want null check document() here.
Comment 5 Beth Dakin 2014-01-22 13:57:33 PST
(In reply to comment #4)
> (From update of attachment 221804 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=221804&action=review
> 
> > Source/WebCore/ChangeLog:11
> > +        This patch adds 4 new events that will fire when the user has scrolled close to 
> > +        corresponding edge of the document.
> 
> This could use some fleshing out, perhaps listing the new event names.
> 

Sure. I added a little more information.

> > Source/WebCore/html/HTMLAttributeNames.in:275
> > +onwebkitwillrevealbottom
> > +onwebkitwillrevealleft
> > +onwebkitwillrevealright
> > +onwebkitwillrevealtop
> 
> I'm not sure we need to support these as attributes, but Ted should weigh in.
> 

Ted and I spoke in person. He thinks we should support them. He thinks that not including them would introduce a confusing inconsistency even though they are kind of silly.

> > Source/WebCore/page/FrameView.cpp:2949
> > +    // For each direction (top, bottom, left and right), send the will reveal edge event for that direction
> 
> Nit: Top and bottom aren't really directions, maybe, "edge"?
> 

Fixed.

> > Source/WebCore/page/FrameView.cpp:2964
> > +            frame().document()->dispatchWindowEvent(willRevealEvent.release(), frame().document()->domWindow());
> 
> We should probably fire these asynchronously, which can be done via frame().document()->enqueueWindowEvent(event.release()); We may also want null check document() here.

Fixed.

Thanks for the feedback! I will upload a new patch shortly. I was spreading a rumor earlier that this patch has a problem where it doesn't always fire the event if you scroll too fast. Turns out that was a bug in my test app NOT in this implementation.
Comment 6 Beth Dakin 2014-01-22 13:57:54 PST
Created attachment 221902 [details]
Patch
Comment 7 Beth Dakin 2014-01-22 13:59:07 PST
Names that might be better: webkitwillrevealbottomedge, webkitwillreachbottomsoon, webkitwillreachbottonedgesoon
Comment 8 Beth Dakin 2014-01-25 20:48:31 PST
Created attachment 222248 [details]
Patch
Comment 9 WebKit Commit Bot 2014-01-25 20:50:56 PST
Attachment 222248 [details] did not pass style-queue:


ERROR: Source/WebCore/dom/EventNames.h:123:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebCore/dom/EventNames.h:128:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 2 in 20 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 10 Beth Dakin 2014-01-27 23:23:35 PST
Created attachment 222408 [details]
Patch

Here is a patch with a couple more tests, as Sam requested.
Comment 11 WebKit Commit Bot 2014-01-27 23:25:58 PST
Attachment 222408 [details] did not pass style-queue:


ERROR: Source/WebCore/dom/EventNames.h:123:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebCore/dom/EventNames.h:128:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 2 in 23 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 Build Bot 2014-01-28 00:47:43 PST
Comment on attachment 222408 [details]
Patch

Attachment 222408 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/5055793170743296

New failing tests:
fast/events/will-reveal-edges-window-attributes.html
Comment 13 Build Bot 2014-01-28 00:47:45 PST
Created attachment 222415 [details]
Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-13  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 14 Build Bot 2014-01-28 01:14:57 PST
Comment on attachment 222408 [details]
Patch

Attachment 222408 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/6034654066900992

New failing tests:
fast/events/will-reveal-edges-window-attributes.html
Comment 15 Build Bot 2014-01-28 01:15:02 PST
Created attachment 222417 [details]
Archive of layout-test-results from webkit-ews-02 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-02  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 16 Build Bot 2014-01-28 01:53:16 PST
Comment on attachment 222408 [details]
Patch

Attachment 222408 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/5638829880901632

New failing tests:
fast/events/will-reveal-edges-window-attributes.html
Comment 17 Build Bot 2014-01-28 01:53:21 PST
Created attachment 222422 [details]
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-16  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 18 Build Bot 2014-01-28 03:43:55 PST
Comment on attachment 222408 [details]
Patch

Attachment 222408 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5101886290001920

New failing tests:
fast/events/will-reveal-edges-window-attributes.html
Comment 19 Build Bot 2014-01-28 03:43:59 PST
Created attachment 222428 [details]
Archive of layout-test-results from webkit-ews-03 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-03  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 20 Beth Dakin 2014-01-28 15:02:55 PST
Created attachment 222498 [details]
Patch
Comment 21 WebKit Commit Bot 2014-01-28 15:04:39 PST
Attachment 222498 [details] did not pass style-queue:


ERROR: Source/WebCore/dom/EventNames.h:123:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebCore/dom/EventNames.h:128:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 2 in 23 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 22 Beth Dakin 2014-01-28 15:52:07 PST
Thanks Sam! I'll wait a day or two to land in case anyone has more feedback. And I filed https://bugs.webkit.org/show_bug.cgi?id=127810 to make this work for overflow:scroll.
Comment 23 Beth Dakin 2014-01-30 11:21:13 PST
http://trac.webkit.org/changeset/163092
Comment 24 Beth Dakin 2014-01-30 11:21:14 PST
http://trac.webkit.org/changeset/163092