Bug 171145 - Rename callerDOMWindow()/CallerDocument to incumbentDOMWindow()/IncumbentDocument
Summary: Rename callerDOMWindow()/CallerDocument to incumbentDOMWindow()/IncumbentDocu...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Local Build
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords:
Depends on:
Blocks: 163412
  Show dependency treegraph
 
Reported: 2017-04-21 15:17 PDT by Daniel Bates
Modified: 2017-04-27 16:25 PDT (History)
8 users (show)

See Also:


Attachments
Patch (8.02 KB, patch)
2017-04-21 15:19 PDT, Daniel Bates
sbarati: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews112 for mac-elcapitan (2.18 MB, application/zip)
2017-04-21 17:09 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2017-04-21 15:17:21 PDT
We should use the HTML standard's terminology "incumbent" instead of "caller" to describe the "most-recently-entered author function or script on the stack, or the author function or script that originally scheduled the currently-running callback." (<https://html.spec.whatwg.org/multipage/webappapis.html#realms-settings-objects-global-objects>, 21 April 2017).
Comment 1 Daniel Bates 2017-04-21 15:19:25 PDT
Created attachment 307816 [details]
Patch
Comment 2 Saam Barati 2017-04-21 15:48:49 PDT
Comment on attachment 307816 [details]
Patch

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

r=me

> Source/WebCore/bindings/js/JSDOMWindowBase.cpp:291
> +DOMWindow& incumbentDOMWindow(ExecState* exec)

IMO, I think it could be helpful to have a comment here either linking to the spec, or describing the heart of what this function does.
Just by reading its name, it wouldn't be obvious to me. I understand what it's called incumbent, since this isn't always
the caller (setTimeout, etc), but I think it's "caller" in spirit.
Comment 3 Build Bot 2017-04-21 17:09:18 PDT
Comment on attachment 307816 [details]
Patch

Attachment 307816 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/3579366

New failing tests:
media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-styles.html
Comment 4 Build Bot 2017-04-21 17:09:20 PDT
Created attachment 307842 [details]
Archive of layout-test-results from ews112 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews112  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 5 Daniel Bates 2017-04-27 16:21:00 PDT
(In reply to Saam Barati from comment #2)
> Comment on attachment 307816 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=307816&action=review
> 
> r=me
> 
> > Source/WebCore/bindings/js/JSDOMWindowBase.cpp:291
> > +DOMWindow& incumbentDOMWindow(ExecState* exec)
> 
> IMO, I think it could be helpful to have a comment here either linking to
> the spec, or describing the heart of what this function does.
> Just by reading its name, it wouldn't be obvious to me. I understand what
> it's called incumbent, since this isn't always
> the caller (setTimeout, etc), but I think it's "caller" in spirit.

Will add the follow comment above this function before landing:

// DOMWindow associated with global object of the "most-recently-entered author function or script
// on the stack, or the author function or script that originally scheduled the currently-running callback."
// (<https://html.spec.whatwg.org/multipage/webappapis.html#concept-incumbent-everything>, 27 April 2017)
// FIXME: Make this work for an "author function or script that originally scheduled the currently-running callback."
// See <https://bugs.webkit.org/show_bug.cgi?id=163412>.
Comment 6 Daniel Bates 2017-04-27 16:23:35 PDT
(In reply to Daniel Bates from comment #5)
> [...]
> Will add the follow comment above this function before landing:
> 
Actually, I will add this comment above the declaration of incumbentDOMWindow() in JSDOMWindowBase.h.
Comment 7 Daniel Bates 2017-04-27 16:25:09 PDT
Committed r215904: <http://trac.webkit.org/changeset/215904>