Index: core/frame/Window.idl |
diff --git a/core/frame/Window.idl b/core/frame/Window.idl |
index 4ef969a5797c7302bfde3b4c10526ab279a1f3be..679fd07f3e627a1849d8f442b065267e7f6c5700 100644 |
--- a/core/frame/Window.idl |
+++ b/core/frame/Window.idl |
@@ -24,18 +24,21 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-// HTML 5 draft spec: |
-// http://www.w3.org/html/wg/drafts/html/master/browsers.html#window |
+// https://html.spec.whatwg.org/#the-window-object |
+ |
// FIXME: explain all uses of [DoNotCheckSecurity] |
[ |
CheckSecurity=Frame, |
- Custom=ToV8, |
- ImplementedAs=LocalDOMWindow, |
+ ImplementedAs=DOMWindow, |
PrimaryGlobal, |
- WillBeGarbageCollected, |
] interface Window : EventTarget { |
- // DOM Level 0 |
- readonly attribute Screen screen; |
+ // the current browsing context |
+ // FIXME: The spec uses the WindowProxy type for this and many other attributes. |
+ [Unforgeable, DoNotCheckSecurity] readonly attribute Window window; |
+ [Replaceable, DoNotCheckSecurity] readonly attribute Window self; |
+ [Unforgeable] readonly attribute Document document; |
+ attribute DOMString name; |
+ [PutForwards=href, Unforgeable, DoNotCheckSecurity] readonly attribute Location location; |
readonly attribute History history; |
[Replaceable, MeasureAs=BarPropLocationbar] readonly attribute BarProp locationbar; |
[Replaceable, MeasureAs=BarPropMenubar] readonly attribute BarProp menubar; |
@@ -43,140 +46,131 @@ |
[Replaceable, MeasureAs=BarPropScrollbars] readonly attribute BarProp scrollbars; |
[Replaceable, MeasureAs=BarPropStatusbar] readonly attribute BarProp statusbar; |
[Replaceable, MeasureAs=BarPropToolbar] readonly attribute BarProp toolbar; |
- [LogActivity=GetterOnly] readonly attribute Navigator navigator; |
- [Replaceable] readonly attribute Navigator clientInformation; |
- [DoNotCheckSecurity, Unforgeable, Replaceable, PutForwards=href] readonly attribute Location location; |
- [Custom, MeasureAs=WindowEvent, NotEnumerable] attribute Event event; |
- |
- Selection getSelection(); |
- |
- [CheckSecurity=Node, Custom=Getter] readonly attribute Element frameElement; |
- |
- [DoNotCheckSecurity, CallWith=ExecutionContext] void focus(); |
- [DoNotCheckSecurity] void blur(); |
+ attribute DOMString status; |
[DoNotCheckSecurity, CallWith=ExecutionContext] void close(); |
- |
- void print(); |
+ [DoNotCheckSecurity] readonly attribute boolean closed; |
void stop(); |
+ [DoNotCheckSecurity, CallWith=ExecutionContext] void focus(); |
+ [DoNotCheckSecurity] void blur(); |
- [Custom] Window open(DOMString url, |
- DOMString name, |
- optional DOMString options); |
- |
- [RuntimeEnabled=ShowModalDialog, Custom] any showModalDialog(DOMString url, |
- optional any dialogArgs, |
- optional DOMString featureArgs); |
+ // other browsing contexts |
+ [Replaceable, DoNotCheckSecurity] readonly attribute Window frames; |
+ [Replaceable, DoNotCheckSecurity] readonly attribute unsigned long length; |
+ [Unforgeable, DoNotCheckSecurity] readonly attribute Window top; |
+ // FIXME: opener should be of type any. |
+ [DoNotCheckSecurity, Custom=Setter] attribute Window opener; |
+ [Replaceable, DoNotCheckSecurity] readonly attribute Window parent; |
+ [CheckSecurity=Node, Custom=Getter] readonly attribute Element? frameElement; |
+ // FIXME: open() should have 4 optional arguments with defaults. |
+ [Custom] Window open(DOMString url, DOMString target, optional DOMString features); |
+ // FIXME: These getters should not have [NotEnumerable]. |
+ [NotEnumerable, DoNotCheckSecurity] getter Window (unsigned long index); |
+ [Custom, NotEnumerable, DoNotCheckSecurity] getter object (DOMString name); |
+ |
+ // the user agent |
+ [LogActivity=GetterOnly] readonly attribute Navigator navigator; |
+ [RuntimeEnabled=ApplicationCache, LogActivity=GetterOnly] readonly attribute ApplicationCache applicationCache; |
+ // user prompts |
void alert(); |
void alert(DOMString message); |
boolean confirm(optional DOMString message = ""); |
- DOMString? prompt(optional DOMString message = "", |
- optional DOMString defaultValue = ""); |
- |
- boolean find([Default=Undefined] optional DOMString string, |
- [Default=Undefined] optional boolean caseSensitive, |
- [Default=Undefined] optional boolean backwards, |
- [Default=Undefined] optional boolean wrap, |
- [Default=Undefined] optional boolean wholeWord, |
- [Default=Undefined] optional boolean searchInFrames, |
- [Default=Undefined] optional boolean showDialog); |
- |
- [Replaceable, MeasureAs=WindowOffscreenBuffering] readonly attribute boolean offscreenBuffering; |
- |
- [Replaceable] readonly attribute long outerHeight; |
- [Replaceable] readonly attribute long outerWidth; |
- [Replaceable] readonly attribute long innerHeight; |
- [Replaceable] readonly attribute long innerWidth; |
- [Replaceable] readonly attribute long screenX; |
- [Replaceable] readonly attribute long screenY; |
- [Replaceable] readonly attribute long screenLeft; |
- [Replaceable] readonly attribute long screenTop; |
- [Replaceable] readonly attribute double scrollX; |
- [Replaceable] readonly attribute double scrollY; |
- readonly attribute double pageXOffset; |
- readonly attribute double pageYOffset; |
- |
- // Overloading can be replaced by optional if RuntimeEnabled is removed, by |
- // changing the third argument to *optional* Dictionary scrollOptions |
- void scrollBy(double x, double y); |
- [RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scrollBy(double x, double y, ScrollOptions scrollOptions); |
- void scrollTo(double x, double y); |
- [RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scrollTo(double x, double y, ScrollOptions scrollOptions); |
- void scroll(double x, double y); |
- [RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scroll(double x, double y, ScrollOptions scrollOptions); |
- void moveBy([Default=Undefined] optional float x, [Default=Undefined] optional float y); // FIXME: this should take longs not floats. |
- void moveTo([Default=Undefined] optional float x, [Default=Undefined] optional float y); // FIXME: this should take longs not floats. |
- void resizeBy([Default=Undefined] optional float x, [Default=Undefined] optional float y); // FIXME: this should take longs not floats. |
- void resizeTo([Default=Undefined] optional float width, [Default=Undefined] optional float height); // FIXME: this should take longs not floats. |
- |
- [DoNotCheckSecurity] readonly attribute boolean closed; |
- |
- [Replaceable, DoNotCheckSecurity] readonly attribute unsigned long length; |
- |
- attribute DOMString name; |
+ DOMString? prompt(optional DOMString message = "", optional DOMString defaultValue = ""); |
+ void print(); |
- attribute DOMString status; |
- [MeasureAs=WindowDefaultStatus] attribute DOMString defaultStatus; |
- // This attribute is an alias of defaultStatus and is necessary for legacy uses. |
- [ImplementedAs=defaultStatus, MeasureAs=WindowDefaultstatus] attribute DOMString defaultstatus; |
+ // FIXME: requestAnimationFrame should take a FrameRequestCallback: |
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=28152 |
+ [MeasureAs=UnprefixedRequestAnimationFrame] long requestAnimationFrame(FrameRequestCallback callback); |
+ void cancelAnimationFrame(long handle); |
- // Self referential attributes |
- [Replaceable, DoNotCheckSecurity] readonly attribute Window self; |
- [DoNotCheckSecurity, Unforgeable] readonly attribute Window window; |
- [Replaceable, DoNotCheckSecurity] readonly attribute Window frames; |
+ [DoNotCheckSecurity, Custom, RaisesException] void postMessage(any message, DOMString targetOrigin, optional sequence<Transferable> transfer); |
- [DoNotCheckSecurity, Custom=Setter] attribute Window opener; |
- [Replaceable, DoNotCheckSecurity] readonly attribute Window parent; |
- [DoNotCheckSecurity, Unforgeable] readonly attribute Window top; |
+ // HTML obsolete features |
+ // https://html.spec.whatwg.org/#Window-partial |
+ [MeasureAs=WindowCaptureEvents] void captureEvents(); |
+ [MeasureAs=WindowReleaseEvents] void releaseEvents(); |
- // DOM Level 2 AbstractView Interface |
- readonly attribute Document document; |
+ // CSS Object Model (CSSOM) |
+ // http://dev.w3.org/csswg/cssom/#extensions-to-the-window-interface |
+ // FIXME: The optional pseudoElt argument should have no default. |
+ [NewObject, TypeChecking=Interface] CSSStyleDeclaration getComputedStyle(Element elt, optional DOMString? pseudoElt = null); |
// CSSOM View Module |
- MediaQueryList matchMedia(DOMString query); |
+ // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface |
+ [NewObject] MediaQueryList matchMedia(DOMString query); |
+ [SameObject, Replaceable] readonly attribute Screen screen; |
- // styleMedia has been removed from the CSSOM View specification. |
- readonly attribute StyleMedia styleMedia; |
+ // browsing context |
+ void moveTo(long x, long y); |
+ void moveBy(long x, long y); |
+ void resizeTo(long x, long y); |
+ void resizeBy(long x, long y); |
- // DOM Level 2 Style Interface |
- CSSStyleDeclaration getComputedStyle([Default=Undefined] optional Element element, |
- [TreatUndefinedAs=NullString, Default=Undefined] optional DOMString? pseudoElement); |
- |
- // WebKit extensions |
- [MeasureAs=GetMatchedCSSRules] CSSRuleList getMatchedCSSRules([Default=Undefined] optional Element element, |
- [TreatUndefinedAs=NullString, Default=Undefined] optional DOMString? pseudoElement); |
+ // viewport |
+ [Replaceable] readonly attribute long innerWidth; |
+ [Replaceable] readonly attribute long innerHeight; |
+ // viewport scrolling |
+ [Replaceable] readonly attribute double scrollX; |
+ [Replaceable] readonly attribute double pageXOffset; |
+ [Replaceable] readonly attribute double scrollY; |
+ [Replaceable] readonly attribute double pageYOffset; |
+ [RuntimeEnabled=CSSOMSmoothScroll] void scroll(optional ScrollToOptions options); |
+ void scroll(unrestricted double x, unrestricted double y); |
+ [RuntimeEnabled=CSSOMSmoothScroll] void scrollTo(optional ScrollToOptions options); |
+ void scrollTo(unrestricted double x, unrestricted double y); |
+ [RuntimeEnabled=CSSOMSmoothScroll] void scrollBy(optional ScrollToOptions options); |
+ void scrollBy(unrestricted double x, unrestricted double y); |
+ |
+ // client |
+ [Replaceable] readonly attribute long screenX; |
+ [Replaceable] readonly attribute long screenY; |
+ [Replaceable] readonly attribute long outerWidth; |
+ [Replaceable] readonly attribute long outerHeight; |
[Replaceable] readonly attribute double devicePixelRatio; |
- [RuntimeEnabled=ApplicationCache, LogActivity=GetterOnly] readonly attribute ApplicationCache applicationCache; |
+ // Selection API |
+ // http://w3c.github.io/selection-api/#extensions-to-window-interface |
+ Selection? getSelection(); |
- [RuntimeEnabled=SessionStorage, LogActivity=GetterOnly, RaisesException=Getter] readonly attribute Storage sessionStorage; |
- [RuntimeEnabled=LocalStorage, LogActivity=GetterOnly, RaisesException=Getter] readonly attribute Storage localStorage; |
+ // Console API (non-standard but widely implemented in some form) |
+ // https://developer.chrome.com/devtools/docs/console-api |
+ [Replaceable] readonly attribute Console console; |
+ // Non-standard APIs |
+ [MeasureAs=WindowClientInformation, Replaceable] readonly attribute Navigator clientInformation; |
+ [MeasureAs=WindowEvent, Custom, NotEnumerable] attribute Event event; |
+ [MeasureAs=WindowFind] boolean find([Default=Undefined] optional DOMString string, |
+ [Default=Undefined] optional boolean caseSensitive, |
+ [Default=Undefined] optional boolean backwards, |
+ [Default=Undefined] optional boolean wrap, |
+ [Default=Undefined] optional boolean wholeWord, |
+ [Default=Undefined] optional boolean searchInFrames, |
+ [Default=Undefined] optional boolean showDialog); |
+ [MeasureAs=WindowOffscreenBuffering, Replaceable, NotEnumerable] readonly attribute boolean offscreenBuffering; |
+ [MeasureAs=WindowScreenLeft, Replaceable] readonly attribute long screenLeft; |
+ [MeasureAs=WindowScreenTop, Replaceable] readonly attribute long screenTop; |
+ [MeasureAs=WindowDefaultStatus] attribute DOMString defaultStatus; |
+ [MeasureAs=WindowDefaultstatus, ImplementedAs=defaultStatus] attribute DOMString defaultstatus; |
+ [MeasureAs=StyleMedia] readonly attribute StyleMedia styleMedia; |
+ [DeprecateAs=GetMatchedCSSRules] CSSRuleList getMatchedCSSRules([Default=Undefined] optional Element element, |
+ [TreatUndefinedAs=NullString, Default=Undefined] optional DOMString? pseudoElement); |
// This is the interface orientation in degrees. Some examples are: |
// 0 is straight up; -90 is when the device is rotated 90 clockwise; |
// 90 is when rotated counter clockwise. |
- [RuntimeEnabled=OrientationEvent, MeasureAs=WindowOrientation] readonly attribute long orientation; |
- |
- [Replaceable] readonly attribute Console console; |
- |
- // cross-document messaging |
- [DoNotCheckSecurity, Custom, RaisesException] void postMessage(SerializedScriptValue message, DOMString targetOrigin, optional sequence<Transferable> transfer); |
- |
- [Replaceable] readonly attribute Performance performance; |
- |
- [MeasureAs=UnprefixedRequestAnimationFrame] long requestAnimationFrame(RequestAnimationFrameCallback callback); |
- void cancelAnimationFrame(long id); |
- [DeprecateAs=PrefixedRequestAnimationFrame] long webkitRequestAnimationFrame(RequestAnimationFrameCallback callback); |
+ [MeasureAs=WindowOrientation, RuntimeEnabled=OrientationEvent] readonly attribute long orientation; |
+ [DeprecateAs=PrefixedRequestAnimationFrame] long webkitRequestAnimationFrame(FrameRequestCallback callback); |
[DeprecateAs=PrefixedCancelAnimationFrame, ImplementedAs=cancelAnimationFrame] void webkitCancelAnimationFrame(long id); |
[DeprecateAs=PrefixedCancelRequestAnimationFrame, ImplementedAs=cancelAnimationFrame] void webkitCancelRequestAnimationFrame(long id); |
- |
- [Replaceable] readonly attribute CSS CSS; |
+ [MeasureAs=PrefixedTransitionEventConstructor] attribute TransitionEventConstructor WebKitTransitionEvent; |
+ [Measure] attribute AnimationEventConstructor WebKitAnimationEvent; |
+ [DeprecateAs=PrefixedWindowURL] attribute URLConstructor webkitURL; |
+ [MeasureAs=PrefixedMutationObserverConstructor] attribute MutationObserverConstructor WebKitMutationObserver; |
// Event handler attributes |
- [RuntimeEnabled=CSSAnimationUnprefixed] attribute EventHandler onanimationend; |
- [RuntimeEnabled=CSSAnimationUnprefixed] attribute EventHandler onanimationiteration; |
- [RuntimeEnabled=CSSAnimationUnprefixed] attribute EventHandler onanimationstart; |
+ attribute EventHandler onanimationend; |
+ attribute EventHandler onanimationiteration; |
+ attribute EventHandler onanimationstart; |
[RuntimeEnabled=OrientationEvent] attribute EventHandler onorientationchange; |
attribute EventHandler onsearch; |
[RuntimeEnabled=Touch] attribute EventHandler ontouchcancel; |
@@ -190,20 +184,8 @@ |
attribute EventHandler onwebkittransitionend; |
attribute EventHandler onwheel; |
- [MeasureAs=WindowCaptureEvents] void captureEvents(); |
- [MeasureAs=WindowReleaseEvents] void releaseEvents(); |
- |
- // Additional constructors. |
- [MeasureAs=PrefixedTransitionEventConstructor] attribute TransitionEventConstructor WebKitTransitionEvent; |
- [RuntimeEnabled=CSSAnimationUnprefixed] attribute WebKitAnimationEventConstructor AnimationEvent; |
- [MeasureAs=PrefixedWindowURL] attribute URLConstructor webkitURL; // FIXME: deprecate this. |
- [MeasureAs=PrefixedMutationObserverConstructor] attribute MutationObserverConstructor WebKitMutationObserver; |
- |
// window.toString() requires special handling in V8 |
[DoNotCheckSignature, DoNotCheckSecurity, Custom, NotEnumerable] stringifier; |
- |
- [NotEnumerable] getter Window (unsigned long index); |
- [Custom, NotEnumerable] getter Window (DOMString name); |
}; |
// http://www.whatwg.org/specs/web-apps/current-work/#transferable-objects |