Bug 78722

Summary: Expose Window constructor
Product: WebKit Reporter: Erik Arvidsson <arv>
Component: DOMAssignee: Erik Arvidsson <arv>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: abarth, ahmad.saleem792, ap, bfulgham, ian, ossy, rniwa, sam, webkit-bug-importer, webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#the-window-objecthttp://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#the-window-object
Attachments:
Description Flags
Patch none

Description Erik Arvidsson 2012-02-15 10:18:15 PST
We currently do not expose the Window constructor. Other browsers do.

assertTrue(window.Window !== undefined)

This is related to bug 78721 which is about renaming the constructor.
Comment 1 Ian 'Hixie' Hickson 2012-02-15 11:32:06 PST
Constructor? You mean prototype object, right? Window shouldn't be a constructor.
Comment 2 Erik Arvidsson 2012-02-15 11:49:29 PST
(In reply to comment #1)
> Constructor? You mean prototype object, right? Window shouldn't be a constructor.

No. I mean constructor. It is not constructable but it is still a constructor. Just like Document and HTMLDocument are exposed.

IE and Mozilla pass the following

assertTrue(typeof Window !== 'undefined');
Comment 3 Erik Arvidsson 2012-02-15 12:10:19 PST
Created attachment 127211 [details]
Patch
Comment 4 WebKit Review Bot 2012-02-15 18:47:27 PST
Comment on attachment 127211 [details]
Patch

Clearing flags on attachment: 127211

Committed r107869: <http://trac.webkit.org/changeset/107869>
Comment 5 WebKit Review Bot 2012-02-15 18:47:32 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Csaba Osztrogonác 2012-02-16 01:39:20 PST
Reopen, because it broke 3 tests on Qt. I assume that on other platforms too, but unfortunately I can't check it, because build.webkit.org is unavailable.
- fast/dom/Window/window-properties.html - http://build.webkit.sed.hu/results/x86-64%20Linux%20Qt%20Release/r107900%20%2833816%29/fast/dom/Window/window-properties-pretty-diff.html
- fast/dom/Window/window-property-descriptors.html - http://build.webkit.sed.hu/results/x86-64%20Linux%20Qt%20Release/r107900%20(33816)/fast/dom/Window/window-property-descriptors-pretty-diff.html
- fast/js/global-constructors.html - http://build.webkit.sed.hu/results/x86-64%20Linux%20Qt%20Release/r107900%20%2833816%29/fast/js/global-constructors-pretty-diff.html

I think the first two tests only needs to be rebaselined. But the third one seems an error: +FAIL Window.toString() should be [object WindowConstructor]. Was [object DOMWindowConstructor].
Comment 7 Csaba Osztrogonác 2012-02-16 02:40:09 PST
I updated the 3 tests on Qt - http://trac.webkit.org/changeset/107916
Please check what should we do with the 3rd failing test.
Comment 8 Erik Arvidsson 2012-02-16 08:36:01 PST
Sorry about that. These tests where in the test_expectation.txt for chromium. I should have realized it would change the expectations for JSC based platforms.

(In reply to comment #7)
> I updated the 3 tests on Qt - http://trac.webkit.org/changeset/107916
> Please check what should we do with the 3rd failing test.

The FAIL in global-constructors-expected.txt is bug 78721

The changes to the Skipped file seems unrelated though.
Comment 9 Ahmad Saleem 2022-07-26 09:48:47 PDT
From WPT - Safari passes all "window constructor" events, do we need anything further?

https://wpt.fyi/results/dom/events?label=master&label=experimental&aligned&q=constructor

Please ignore my comment, if I incorrect or wrong and update latest status accordingly. Thanks!
Comment 10 Ryosuke Niwa 2022-07-26 10:03:51 PDT
We have window.Window now.
Comment 11 Radar WebKit Bug Importer 2022-07-26 10:04:39 PDT
<rdar://problem/97612310>