Skip to content

Commit ec8ace9

Browse files
domenicemilio
authored andcommitted
[cssom-view] Remove "familiar with" check for move/resize methods
Closes #1725 by removing the usage of incumbent settings object. I could find no evidence of such a check in the Blink, Gecko, or WebKit codebases. Indeed, such a check should not generally be necessary, as (unlike, e.g., window.close()) these methods are not accessible cross-origin. Also includes various changes for things that have updated in other specs: * Use "this" instead of "context object" * Use "string is" instead of "case-sensitive" * Use "start node" and "start offset" instead of referring to properties of Range (or now, AbstractRange) * Link to the correct "event loop" definition * Remove redundant anchor blocks, as these days most definitions are properly exported
1 parent b0eb5aa commit ec8ace9

1 file changed

Lines changed: 26 additions & 82 deletions

File tree

cssom-view-1/Overview.bs

Lines changed: 26 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Former Editor: Glenn Adams, Cox Communications, Inc. http://www.cox.com, gle
2020
Former Editor: Anne van Kesteren, Opera Software ASA http://www.opera.com, annevk@annevk.nl, https://annevankesteren.nl/
2121
!Legacy issues list: <a href="https://www.w3.org/Bugs/Public/buglist.cgi?product=CSS&amp;component=CSSOM%20View&amp;resolution=---">Bugzilla</a>
2222
Abstract: The APIs introduced by this specification provide authors with a way to inspect and manipulate the visual view of a document. This includes getting the position of element layout boxes, obtaining the width of the viewport through script, and also scrolling an element.
23-
Ignored Terms: open(), EventTarget, EventListener, Event, EventInit, Element, Range, Node, Text
2423
Ignored Vars: rect, point, quad
2524
Include Can I Use Panels: true
2625
Can I Use URL: https://drafts.csswg.org/cssom-view/
@@ -30,70 +29,24 @@ Can I Use URL: https://www.w3.org/TR/cssom-view-1/
3029
<pre class='anchors'>
3130
urlPrefix: https://html.spec.whatwg.org/multipage/
3231
urlPrefix: infrastructure.html
33-
type: dfn; text: html elements
34-
urlPrefix: browsers.html
35-
type: interface; text: WindowProxy
3632
type: dfn
37-
text: browsing context
38-
text: auxiliary browsing context
39-
text: familiar with
40-
text: associated Document; url: concept-document-window
41-
text: same origin
42-
text: active document
43-
urlPrefix: webappapis.html
44-
type: dfn
45-
text: responsible browsing context
46-
text: incumbent settings object
47-
text: event handlers
48-
text: event handler event type
49-
text: event handler IDL attributes
50-
urlPrefix: infrastructure.html
51-
type: dfn
52-
text: split a string on commas
53-
text: skip whitespace
54-
text: collect a sequence of characters
55-
text: space character
56-
text: converted to ascii lowercase
5733
text: rules for parsing integers
34+
urlPrefix: window-object.html
35+
type: method
36+
text: open(url, target, features); for: Window; url: #dom-open
5837
urlPrefix: https://drafts.csswg.org/cssom/
5938
type: dfn
6039
text: parse a media query list
6140
text: serialize a media query list
62-
urlPrefix: https://dom.spec.whatwg.org/#
63-
type: dfn
64-
text: context object
65-
urlPrefix: https://dom.spec.whatwg.org/#concept-
66-
type: dfn
67-
text: event
68-
text: event listener
69-
text: quirks mode; url: document-quirks
70-
text: fire an event; url: event-fire
71-
text: node document
72-
urlPrefix: https://dom.spec.whatwg.org/
73-
type: attribute;
74-
for: Event; urlPrefix: #dom-event-
75-
text: type
76-
text: isTrusted
77-
for: Range; urlPrefix: #dom-range-
78-
text: startContainer
79-
text: startOffset
80-
type: dfn; text: dispatch flag
8141
urlPrefix: https://www.w3.org/TR/CSS21/visuren.html
8242
type: dfn; text: anonymous block box; url: #anonymous-block-level
83-
urlPrefix: http://heycam.github.io/webidl/
84-
type: interface; urlPrefix: #idl-
85-
text: double
86-
text: long
87-
type: dfn; text: converted to an IDL value; url: dfn-convert-ecmascript-to-idl-value
88-
url: https://www.w3.org/TR/DOM-Level-3-Events/#interface-MouseEvent; type: interface; text: MouseEvent
8943
url: https://drafts.csswg.org/mediaqueries-4/#mf-colors; type: dfn; text: color media query
9044
</pre>
9145

9246
<pre class='link-defaults'>
9347
spec:css-display-3; type:value; for:display; text:table
9448
spec:css-position-3; type:property; text:position
9549
spec:dom; type:interface; text:Document
96-
spec:html; type:dfn; text:case-sensitive
9750
</pre>
9851

9952
<script src=https://resources.whatwg.org/file-issue.js async data-file-issue-url="https://github.com/w3c/csswg-drafts/issues/new?title=%5Bcssom-view%5D%20"></script>
@@ -321,7 +274,7 @@ The term <dfn>transforms</dfn> refers to SVG transforms and CSS transforms. [[!S
321274
When a method or an attribute is said to call another method or attribute, the user agent must invoke its internal API for that attribute or method so that
322275
e.g. the author can't change the behavior by overriding attributes or methods with custom properties or functions in ECMAScript.
323276

324-
Unless otherwise stated, string comparisons are done in a <a>case-sensitive</a> manner.
277+
Unless otherwise stated, all string comparisons use [=string/is=].
325278

326279

327280
<h3 id=css-pixels>CSS pixels</h3>
@@ -470,7 +423,7 @@ When the <dfn method for=Window caniuse=matchmedia>matchMedia(<var>query</var>)<
470423
<a lt='parse a media query list'>parsing</a>
471424
<var>query</var>.
472425
<li>Return a new {{MediaQueryList}} object,
473-
with the <a>context object’s</a>
426+
with [=this=]'s
474427
<a>associated <code>Document</code></a>
475428
as the <a for=MediaQueryList>document</a>,
476429
with <var>parsed media query list</var> as its associated <a>media query list</a>.
@@ -484,48 +437,39 @@ results when the {{Document}} is navigated.
484437

485438
The <dfn method for=Window>moveTo(<var>x</var>, <var>y</var>)</dfn> method must follow these steps:
486439

487-
1. Optionally, terminate these steps.
488-
1. Let <var>target</var> be the <a>browsing context</a> of the <a>context object</a>.
489-
1. Let <var>source</var> be the <a>responsible browsing context</a> of the <a>incumbent settings object</a>.
490-
1. If <var>source</var> is not <a>allowed to resize and move</a> <var>target</var>, terminate these steps.
440+
1. Optionally, return.
441+
1. Let <var>target</var> be [=this=]'s [=relevant global object=]'s [=Window/browsing context=].
442+
1. If |target| is not an [=auxiliary browsing context=] that was created by a script (as opposed to by an action of the user), then return.
491443
1. Optionally, clamp <var>x</var> and <var>y</var> in a user-agent-defined manner so that the window does not move outside the available space.
492444
1. Move <var>target</var>’s window such that the window’s top left corner is at coordinates (<var>x</var>, <var>y</var>) relative to the top left corner of the output device, measured in <a lt=px value>CSS pixels</a> of <var>target</var>. The positive axes are rightward and downward.
493445

494446
The <dfn method for=Window>moveBy(<var>x</var>, <var>y</var>)</dfn> method must follow these steps:
495447

496-
1. Optionally, terminate these steps.
497-
1. Let <var>target</var> be the <a>browsing context</a> of the <a>context object</a>.
498-
1. Let <var>source</var> be the <a>responsible browsing context</a> of the <a>incumbent settings object</a>.
499-
1. If <var>source</var> is not <a>allowed to resize and move</a> <var>target</var>, terminate these steps.
448+
1. Optionally, return.
449+
1. Let <var>target</var> be [=this=]'s [=relevant global object=]'s [=Window/browsing context=].
450+
1. If |target| is not an [=auxiliary browsing context=] that was created by a script (as opposed to by an action of the user), then return.
500451
1. Optionally, clamp <var>x</var> and <var>y</var> in a user-agent-defined manner so that the window does not move outside the available space.
501452
1. Move <var>target</var>'s window <var>x</var> <a lt=px value>CSS pixels</a> of <var>target</var> rightward and <var>y</var> <a lt=px value>CSS pixels</a> of <var>target</var> downward.
502453

503454

504455
The <dfn method for=Window>resizeTo(<var>width</var>, <var>height</var>)</dfn> method must follow these steps:
505456

506-
1. Optionally, terminate these steps.
507-
1. Let <var>target</var> be the <a>browsing context</a> of the <a>context object</a>.
508-
1. Let <var>source</var> be the <a>responsible browsing context</a> of the <a>incumbent settings object</a>.
509-
1. If <var>source</var> is not <a>allowed to resize and move</a> <var>target</var>, terminate these steps.
457+
1. Optionally, return.
458+
1. Let <var>target</var> be [=this=]'s [=relevant global object=]'s [=Window/browsing context=].
459+
1. If |target| is not an [=auxiliary browsing context=] that was created by a script (as opposed to by an action of the user), then return.
510460
1. Optionally, clamp <var>width</var> and <var>height</var> in a user-agent-defined manner so that the window does not get too small or bigger than the available space.
511461
1. Resize <var>target</var>'s window by moving its right and bottom edges such that the distance between the left and right edges of the viewport are <var>width</var> <a lt=px value>CSS pixels</a> of <var>target</var> and the distance between the top and bottom edges of the viewport are <var>height</var> <a lt=px value>CSS pixels</a> of <var>target</var>.
512462
1. Optionally, move <var>target</var>'s window in a user-agent-defined manner so that it does not grow outside the available space.
513463

514464
The <dfn method for=Window>resizeBy(<var>x</var>, <var>y</var>)</dfn> method must follow these steps:
515465

516-
1. Optionally, terminate these steps.
517-
1. Let <var>target</var> be the <a>browsing context</a> of the <a>context object</a>.
518-
1. Let <var>source</var> be the <a>responsible browsing context</a> of the <a>incumbent settings object</a>.
519-
1. If <var>source</var> is not <a>allowed to resize and move</a> <var>target</var>, terminate these steps.
466+
1. Optionally, return.
467+
1. Let <var>target</var> be [=this=]'s [=relevant global object=]'s [=Window/browsing context=].
468+
1. If |target| is not an [=auxiliary browsing context=] that was created by a script (as opposed to by an action of the user), then return.
520469
1. Optionally, clamp <var>x</var> and <var>y</var> in a user-agent-defined manner so that the window does not get too small or bigger than the available space.
521470
1. Resize <var>target</var>'s window by moving its right edge <var>x</var> <a lt=px value>CSS pixels</a> of <var>target</var> rightward and its bottom edge <var>y</var> <a lt=px value>CSS pixels</a> of <var>target</var> downward.
522471
1. Optionally, move <var>target</var>'s window in a user-agent-defined manner so that it does not grow outside the available space.
523472

524-
A <a>browsing context</a> <var>A</var> is <dfn>allowed to resize and move</dfn> a <a>browsing context</a> <var>B</var> if all the following conditions are met:
525-
526-
* <var>B</var> is an <a>auxiliary browsing context</a> that was created by a script (as opposed to by an action of the user).
527-
* <var>A</var> is <a>familiar with</a> <var>B</var>.
528-
529473
The <dfn attribute for=Window>innerWidth</dfn> attribute must return the <a>viewport</a> width including the size of a rendered
530474
scroll bar (if any), or zero if there is no <a>viewport</a>. <!--fingerprint-->
531475

@@ -716,7 +660,7 @@ A <dfn export>supported <code>open()</code> feature name</dfn> is one of the fol
716660

717661
<h3 id=the-mediaquerylist-interface>The {{MediaQueryList}} Interface</h3>
718662

719-
This section integrates with the <a spec=html>event loop</a> defined in HTML. [[!HTML]]
663+
This section integrates with the <a for=/>event loop</a> defined in HTML. [[!HTML]]
720664

721665
A {{MediaQueryList}} object has an associated <dfn>media query list</dfn>
722666
and an associated <dfn for=MediaQueryList>document</dfn> set on creation.
@@ -787,21 +731,21 @@ the associated <a>matches state</a>. <!--fingerprint-->
787731
The <dfn method for=MediaQueryList>addListener(<var>callback</var>)</dfn> method,
788732
when invoked, must run these steps:
789733

790-
1. <a spec=dom>Add an event listener</a> with the <a spec=dom>context object</a>
734+
1. <a spec=dom>Add an event listener</a> with [=this=]
791735
and an <a spec=dom>event listener</a> whose
792736
<a spec=dom for="event listener">type</a> is <code>change</code>,
793737
and <a spec=dom for="event listener">callback</a> is |callback|.
794738

795739
The <dfn method for=MediaQueryList>removeListener(<var>callback</var>)</dfn> method,
796740
when invoked, must run these steps:
797741

798-
1. If the <a spec=dom>context object</a>’s <a spec=dom for=EventTarget>event listener list</a>
742+
1. If [=this=]’s <a spec=dom for=EventTarget>event listener list</a>
799743
<a for=list>contains</a> an <a>event listener</a> whose
800744
<a spec=dom for="event listener">type</a> is <code>change</code>,
801745
<a spec=dom for="event listener">callback</a> is |callback|,
802746
and <a spec=dom for="event listener">capture</a> is false,
803747
then <a spec=dom>remove an event listener</a> with
804-
the <a spec=dom>context object</a> and that <a spec=dom>event listener</a>.
748+
[=this=] and that <a spec=dom>event listener</a>.
805749

806750
Note: This specification initially had a custom callback mechanism with {{addListener()}} and
807751
{{removeListener()}}, and the callback was invoked with the associated media query list as argument.
@@ -984,11 +928,11 @@ result of running these steps:
984928

985929
<dl>
986930
<dt><a>caret node</a>
987-
<dd>The {{Range/startContainer}}
931+
<dd>The [=range/start node=]
988932
of the <a>caret range</a>.
989933

990934
<dt><a>caret offset</a>
991-
<dd>The {{Range/startOffset}} of
935+
<dd>The [=range/start offset=] of
992936
the <a>caret range</a>.
993937
</dl>
994938

@@ -1635,7 +1579,7 @@ method must run the following steps:
16351579

16361580
<h3 id=resizing-viewports>Resizing viewports</h3>
16371581

1638-
This section integrates with the <a spec=html>event loop</a> defined in HTML. [[!HTML]]
1582+
This section integrates with the <a for=/>event loop</a> defined in HTML. [[!HTML]]
16391583

16401584
When asked to <dfn>run the resize steps</dfn> for a {{Document}} <var>doc</var>, run these steps:
16411585

@@ -1650,7 +1594,7 @@ When asked to <dfn>run the resize steps</dfn> for a {{Document}} <var>doc</var>,
16501594

16511595
<h3 id=scrolling-events>Scrolling</h3>
16521596

1653-
This section integrates with the <a spec=html>event loop</a> defined in HTML. [[!HTML]]
1597+
This section integrates with the <a for=/>event loop</a> defined in HTML. [[!HTML]]
16541598

16551599
Each {{Document}} has an associated list of <dfn>pending scroll event targets</dfn>, initially empty.
16561600

@@ -1775,7 +1719,7 @@ generally not listed.
17751719
* Some readonly attributes on {{Window}} were annotated with <code>[Replaceable]</code> IDL extended
17761720
attribute.
17771721
* {{MediaQueryList}}, <a event>scroll</a> event and <a event>resize</a> event are integrated with
1778-
the <a spec=html>event loop</a> in HTML so they are synchronized with animation frames.
1722+
the <a for=/>event loop</a> in HTML so they are synchronized with animation frames.
17791723
* The <code>instant</code> value of 'scroll-behavior' was renamed to ''scroll-behavior/auto''.
17801724
* The origin of {{Element/scrollLeft}} on {{Element}} was changed (for RTL).
17811725
* The {{Element/scrollIntoView()}} method on {{Element}} and {{Window/scroll()}},

0 commit comments

Comments
 (0)