Bug 95397 - Need to merge didFirstVisuallyNonEmptyLayout and didNewFirstVisuallyNonEmptyLayout
Summary: Need to merge didFirstVisuallyNonEmptyLayout and didNewFirstVisuallyNonEmptyL...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Beth Dakin
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-08-29 16:24 PDT by Beth Dakin
Modified: 2012-11-21 12:34 PST (History)
19 users (show)

See Also:


Attachments
Patch (53.34 KB, patch)
2012-08-29 17:32 PDT, Beth Dakin
webkit-ews: commit-queue-
Details | Formatted Diff | Diff
Patch, trying to fix QT build (53.96 KB, patch)
2012-08-29 18:07 PDT, Beth Dakin
gyuyoung.kim: commit-queue-
Details | Formatted Diff | Diff
Patch, with more build fixing (54.97 KB, patch)
2012-08-30 12:08 PDT, Beth Dakin
gyuyoung.kim: commit-queue-
Details | Formatted Diff | Diff
Patch for EFL (54.97 KB, patch)
2012-08-30 14:54 PDT, Beth Dakin
no flags Details | Formatted Diff | Diff
Patch with different design (119.92 KB, patch)
2012-09-04 22:31 PDT, Beth Dakin
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Patch (118.90 KB, patch)
2012-09-05 12:47 PDT, Beth Dakin
buildbot: commit-queue-
Details | Formatted Diff | Diff
Patch (118.90 KB, patch)
2012-09-05 13:34 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 Beth Dakin 2012-08-29 16:24:56 PDT
The name didNewFirstVisuallyNonEmptyLayout is an abomination. We should merge didFirstLayout, didFirstVisuallyNonEmptyLayout, and didNewFirstVisuallyNonEmptyLayout. They will all be part of the same callback api, but there will be an enum representing the three stages of these states. The callback will fire three times -- once for each state. 

<rdar://problem/10791680>
Comment 1 Beth Dakin 2012-08-29 17:32:04 PDT
Created attachment 161368 [details]
Patch

The API that I added has a sort of silly name: didUnlockLayoutAchievement. I do have some less-silly ideas for alternatives, such as:

didReachLayoutMilestone
didCompleteLayoutPhase
didAchieveLayoutState

I thought we could have a discussion now during review about the best name.

I plan to remove the old API in a follow-up patch.
Comment 2 Adam Barth 2012-08-29 17:52:05 PDT
didUnlockLayoutAchievement is cute.  Perhaps didChangeLayoutState to be analogous with document.readyState ?
Comment 3 Early Warning System Bot 2012-08-29 18:01:52 PDT
Comment on attachment 161368 [details]
Patch

Attachment 161368 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/13680484
Comment 4 Beth Dakin 2012-08-29 18:07:16 PDT
Created attachment 161375 [details]
Patch, trying to fix QT build
Comment 5 Beth Dakin 2012-08-29 18:59:14 PDT
(In reply to comment #2)
> didUnlockLayoutAchievement is cute.  Perhaps didChangeLayoutState to be analogous with document.readyState ?

That's a good option too!
Comment 6 Gyuyoung Kim 2012-08-29 19:46:14 PDT
Comment on attachment 161375 [details]
Patch, trying to fix QT build

Attachment 161375 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/13686470
Comment 7 Beth Dakin 2012-08-30 12:08:05 PDT
Created attachment 161527 [details]
Patch, with more build fixing
Comment 8 Gyuyoung Kim 2012-08-30 13:19:11 PDT
Comment on attachment 161527 [details]
Patch, with more build fixing

Attachment 161527 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/13682834
Comment 9 Beth Dakin 2012-08-30 14:54:38 PDT
Created attachment 161565 [details]
Patch for EFL
Comment 10 Beth Dakin 2012-09-04 22:31:01 PDT
Created attachment 162159 [details]
Patch with different design

I talked more with Dan and Sam, and we decided to go with an API with a slightly different design. In this design, didFirstLayout, didFirstVisuallyNonEmptyLayout, and didNewFirstVisuallyNonEmptyLayout are even more merged than before, and clients need to opt into which layout milestones they are interested in hearing about.
Comment 11 WebKit Review Bot 2012-09-04 22:33:41 PDT
Attachment 162159 [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/WebKit2/WebProcess/WebPage/WebPage.cpp:411:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Source/WebKit/mac/WebView/WebViewInternal.h:69:  The parameter name "options" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/WebKit/mac/WebView/WebViewInternal.h:70:  The parameter name "options" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/WebKit2/UIProcess/WebPageProxy.cpp:296:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:32:  Alphabetical sorting problem.  [build/include_order] [4]
Source/WebCore/loader/FrameLoaderClient.h:33:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 6 in 87 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 WebKit Review Bot 2012-09-04 22:48:39 PDT
Comment on attachment 162159 [details]
Patch with different design

Attachment 162159 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13757461
Comment 13 Early Warning System Bot 2012-09-04 22:48:59 PDT
Comment on attachment 162159 [details]
Patch with different design

Attachment 162159 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/13761396
Comment 14 Early Warning System Bot 2012-09-04 22:49:46 PDT
Comment on attachment 162159 [details]
Patch with different design

Attachment 162159 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/13753658
Comment 15 Build Bot 2012-09-04 22:58:34 PDT
Comment on attachment 162159 [details]
Patch with different design

Attachment 162159 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/13761398
Comment 16 Peter Beverloo (cr-android ews) 2012-09-04 23:04:08 PDT
Comment on attachment 162159 [details]
Patch with different design

Attachment 162159 [details] did not pass cr-android-ews (chromium-android):
Output: http://queues.webkit.org/results/13743768
Comment 17 Sam Weinig 2012-09-04 23:30:05 PDT
Comment on attachment 162159 [details]
Patch with different design

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

Lovin' it!

> Source/WebCore/page/LayoutMilestoneOptions.h:37
> +typedef unsigned LayoutMilestoneOptions;

I am not sure the word Options adds anything here.

> Source/WebKit2/UIProcess/API/C/WKPage.h:122
>      WKPageDidNewFirstVisuallyNonEmptyLayoutCallback                     didNewFirstVisuallyNonEmptyLayout;
> +    WKPageDidLayoutCallback                                             didLayout;

This new function needs to be added at the bottom of the struct.

> Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:259
> +void InjectedBundlePageLoaderClient::didLayout(WebPage* page, LayoutMilestoneOptions options, WTF::RefPtr<APIObject>& userData)

The WTF:: should not be necessary here.

> Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:86
> +    void didLayout(WebPage*, WebCore::LayoutMilestoneOptions, WTF::RefPtr<APIObject>& userData);

The WTF:: should not be needed here.

> Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h:143
> +    WKBundlePageDidLayoutCallback                                           didLayout;

Function needs to be at the bottom of the struct.

> Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:-62
> -// FIXME: This is temporary. Ultimately WebKit should choose the threshold itself.
> -WK_EXPORT void WKBundlePageSetPaintedObjectsCounterThreshold(WKBundlePageRef page, uint64_t threshold);

Were sure this has no callers?
Comment 18 Gyuyoung Kim 2012-09-04 23:35:24 PDT
Comment on attachment 162159 [details]
Patch with different design

Attachment 162159 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/13754680
Comment 19 Gyuyoung Kim 2012-09-04 23:52:39 PDT
Comment on attachment 162159 [details]
Patch with different design

Attachment 162159 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/13742785
Comment 20 Beth Dakin 2012-09-05 12:47:15 PDT
Created attachment 162307 [details]
Patch

Thanks, Sam! Here is a patch that addresses all of your comments and attempts to get the other ports building.
Comment 21 WebKit Review Bot 2012-09-05 12:52:35 PDT
Attachment 162307 [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/Page.h:319:  The parameter name "milestones" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 87 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 22 Build Bot 2012-09-05 13:22:01 PDT
Comment on attachment 162307 [details]
Patch

Attachment 162307 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/13770043
Comment 23 Beth Dakin 2012-09-05 13:34:15 PDT
Created attachment 162319 [details]
Patch

More build fixing.
Comment 24 Beth Dakin 2012-09-25 13:01:29 PDT
Thanks, Sam! Committed http://trac.webkit.org/changeset/129545
Comment 25 Beth Dakin 2012-09-25 16:08:44 PDT
This change caused a layout test to fail. I filed https://bugs.webkit.org/show_bug.cgi?id=97615 and committed a fix: http://trac.webkit.org/changeset/129569
Comment 26 Adam Roben (:aroben) 2012-11-21 12:34:06 PST
This seems to have caused bug 102970.