[webkit-gtk] RFC: Improving FrameLoader signals

Martin Robinson martin.james.robinson at gmail.com
Fri May 28 08:18:42 PDT 2010


(resending from the correct email address)

WebKitters,

Today I did a quick audit of the frame loader signals we do have and compared
it to the Mac port. Our signals have come a long way, but I feel we can improve
them still. Attached is a very rough proposal. I'd love to get some feedback/
hatemail.

A couple things:

I'd like to remove the WEBKIT_LOAD_FIRST_VISUALLY_NON_EMPTY_LAYOUT
state from load-status, as it's really more of an event than a state
the frame is
in. In the timeline of a load, I'm not sure if there is any guarantee that this
happens before or after load completion. This forces clients to keep track
of state outside the view as well. The frame shouldn't throw that information
away.

It's very hard to track the load status of an individual frame. Frames have a
load-status property, but how do you know when one appears to get a handle
on it? My proposal includes adding a frame-created signal to track new frames.

The WebView has a load-status property, but that is really the load-status
of the main frame. The fact that it is a property of the view makes it seem
like it is some measure of the state of all the frames in the view, which it
isn't (though I'll admit that this bit is subjective).

One of the reasons I think we should figure this all out now is that we should
decide on a consistent and systematic way to name things. In my proposal
I tried to keep the naming consistent with the FrameLoaderClient method
names. I think this will give us the least trouble in the future.

If people like the idea of adding more signals, perhaps we should keep
them all private for now and add them to the API as they stabilize (there is no
saying FrameLoaderClient will not make them disappear in the future). DRT,
etc can use them for the time being.

Proposal follows. Perhaps it can move to a wiki page or something.

(+) = new   (=) = unchanged   [d] = deprecate it

- createFrame
   (+) WebKitWebView::frame-created(Frame)
- dispatchDidClearWindowObjectInWorld
   (+) WebKitWebView::window-object-cleared(Frame, object)
   (+) WebKitWebView::window-object-cleared-in-script-world(Frame, World)
   (+) WebKitWebFrame::window-object-cleared(object)
   (+) WebKitWebFrame::window-object-cleared-in-script-world(World)
- didDisplayInsecureContent
   (+) WebKitWebView::insecure-content-displayed(Frame)
   (+) WebKitWebFrame::insecure-content-displayed()
- didRunInsecureContent
   (+) WebKitWebView::ran-insecure-content(Frame, SecurityOrigin)
   (+) WebKitWebFrame::ran-insecure-content(SecurityOrigin)
- dispatchDidHandleOnloadEvents
   (+) WebKitWebView::onload-events-handled(Frame)
   (+) WebKitWebFrame::onload-events-handled()
- dispatchDidReceiveServerRedirectForProvisionalLoad
   (+) WebKitWebView::server-redirected-provisional-load(Frame)
   (+) WebKitWebFrame::server-redirected-provisional-load()
- dispatchDidCancelClientRedirect
   (+) WebKitWebView::client-redirect-canceled(Frame)
   (+) WebKitWebFrame::client-redirect-canceled()
- dispatchWillPerformClientRedirect
   (+) WebKitWebView::client-redirect-starting(Frame, url, delay, fireDate)
   (+) WebKitWebFrame::client-redirect-starting(url, delay, fireDate)
- dispatchDidChangeLocationWithinPage
   (+) WebKitWebView::location-within-page-changed(Frame)
   (+) WebKitWebFrame::location-within-page-changed()
- dispatchDidPushStateWithinPage
   (+) WebKitWebView::location-within-page-changed(Frame)
   (+) WebKitWebFrame::state-within-page-pushed()
- dispatchDidReplaceStateWithinPage
   (+) WebKitWebView::state-within-page-replaced(Frame)
   (+) WebKitWebFrame::state-within-page-replaced()
- dispatchDidPopStateWithinPage
   (+) WebKitWebView::state-within-page-popped(Frame)
   (+) WebKitWebFrame::state-within-page-popped()
- dispatchWillClose
   (+) WebKitWebView::will-close(Frame)
   (+) WebKitWebFrame::will-close()
- dispatchDidReceiveTitle
   (=) WebKitWebView::title-changed(Frame, title)
   (=) WebKitWebFrame::title-received(title)
   (=) notify::title
- dispatchDidFinishDocumentLoad
   (=) WebKitWebView::document-load-finished(Frame)
   (+) WebKitWebFrame::document-load-finished()
- dispatchDidStartProvisionalLoad
   (+) WebKitWebView::provisional-load-started(Frame)
   (+) WebKitWebFrame::provisional-load-started()
   (=) notify::load_status
- dispatchDidCommitLoad
   (+) WebKitWebView::load-committed(Frame)
   (+) WebKitWebFrame::load-committed()
   (=) notify::load_status (comitted)
- dispatchDidFinishLoad
   (=) WebKitWebView::load-finished(Frame)
   (+) WebKitWebFrame::load-finished()
   (=) notify::load_status (finished)
- dispatchDidFailProvisionalLoad
   (=) WebKitWebView::load-error(Frame, uri, error)
   (+) WebKitWebView::provisional-load-failed(Frame, error)
   (+) WebKitWebFrame::provisional-load-failed(error)
   (=) notify::load_status (failed)
- dispatchDidFailLoad
   (=) WebKitWebView::load-error(Frame, uri, error)
   (+) WebKitWebView::load-failed(Frame, error)
   (+) WebKitWebFrame::load-failed(error)
   (=) notify::load_status (failed)
- dispatchDidFirstLayout
   (+) WebKitWebView::first-layout-complete(Frame)
   (+) WebKitWebFrame::first-layout-complete()
   (note: does not affect load status)
- dispatchDidFirstVisuallyNonEmptyLayout
   (+) WebKitWebView::first-non-empty-layout-complete(Frame)
   (+) WebKitWebFrame::first-non-empty-layout-complete()
   (note: no longer affects load status)
- didChangeTitle
   (=) notify::title
- postProgressStartedNotification
   (+) WebKitWebView::progress-started(Frame)
   (+) WebKitWebFrame::progress-started()
   (=) notify::progress
- postProgressEstimateChangedNotification
   (=) notify::progress
- postProgressFinishedNotification
   (+) WebKitWebView::progress-finished(Frame)
   (+) WebKitWebFrame::progress-finished()
   (=) notify::progress
- dispatchDidReceiveIcon
   [d] (=) WebKitWebFrame::icon-loaded()
   (+) WebKitWebView::icon-received(Frame)
   (+) WebKitWebFrame::icon-received()
- dispatchDidChangeIcons
   (+) WebKitWebView::icon-changed(Frame)
   (+) WebKitWebFrame::icon-changed()

Resource loading:
- dispatchWillSendRequest
   (+) WebKitWebView::resource-request-starting(Frame, Resource,
Request, Response)
   (+) WebKitWebFrame::resource-request-starting(Resource, Request, Response)
- dispatchDidReceiveResponse
   (+) WebKitWebView::resource-response-received(Frame, Resource, Response)
   (+) WebKitWebFrame::resource-response-received(Resource, Response)
   (+) WebKitWebResource::response-received(Response)
- dispatchDidFinishLoading
   (+) WebKitWebView::resource-loading-finished(Frame, Resource)
   (+) WebKitWebFrame::resource-loading-finished(Resource)
   (+) WebKitWebResource::loading-finished()
- dispatchDidReceiveContentLength
   (+) WebKitWebView::resource-content-length-received(Frame, Resource, Length)
   (+) WebKitWebFrame::resource-content-length-received(Resource, Length)
   (+) WebKitWebResource::loading-finished(Length)
- dispatchDidFailLoading
   (+) WebKitWebView::resource-load-failed(Frame, Resource, Error)
   (+) WebKitWebFrame::resource-load-failed(Resource, Error)
   (+) WebKitWebResource::load-failed(Error)
- dispatchDidLoadResourceFromMemoryCache
   (+) WebKitWebView::resource-loaded-from-memory-cache(Frame, Resource, Error)
   (+) WebKitWebFrame::resource-loaded-from-memory-cache(Resource, Error)
   (+) WebKitWebResource::loaded-from-memory-cache
- willCacheResponse
   (+) WebKitWebView::resource-will-be-cached(Frame, Resource)
   (+) WebKitWebFrame::resource-will-be-cached(Resource)
   (+) WebKitWebResource::will-be-cached()

Policy decisions
- dispatchDecidePolicyForMIMEType
   (=) WebKitWebView::mime-type-policy-decision-requested(Frame,
Request, MimeType, PolicyDecision)
   (+) WebKitWebFrame::mime-type-policy-decision-requested(Request,
MimeType, PolicyDecision)
- dispatchDecidePolicyForNewWindowAction
   (=) WebKitWebView::new-window-policy-decision-requested(Frame,
Action, PolicyDecision)
   (+) WebKitWebFrame::new-window-policy-decision-requested(Action,
PolicyDecision)
- dispatchDecidePolicyForNavigationAction
   (=) WebKitWebView::navigation-policy-decision-requested(Frame,
Action, PolicyDecision)
   (+) WebKitWebFrame::navigation-policy-decision-requested(Action,
PolicyDecision)
- willSubmitForm
   (=) WebKitWebView::form-submission-decision-requested(Frame, Form,
Vaues, PolicyDecision)
   (+) WebKitWebFrame::form-submission-decision-requested(Form,
Vaues, PolicyDecision)
- dispatchUnableToImplementPolicy
   (=) WebKitWebView::policy-decision-error(Frame, Error)
   (+) WebKitWebFrame::policy-decision-error(Error)


Thank you for your time,
Martin


More information about the webkit-gtk mailing list