-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input events dispatch to top-level frame #1847
base: master
Are you sure you want to change the base?
Changes from all commits
d140333
e50676d
ab33a82
eda93b1
403bdbb
88e7b6b
adf94ad
6cdef65
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2212,8 +2212,8 @@ <h2>Sessions</h2> | |
browsing context</dfn>, which is set to the parent of the <a>current | ||
browsing context</a> when changing browsing contexts, and an | ||
associated <dfn>current top-level browsing context</dfn>, which is | ||
set to the top-browsing context ancestor of the <a>current browsing | ||
context</a>, when changing browsing contexts.</p> | ||
set to the [=browsing context/top-level browsing context=] of the | ||
<a>current browsing context</a>, when changing browsing contexts.</p> | ||
|
||
<p>An <a>HTTP session</a> has an associated <dfn>session | ||
timeouts</dfn> which is a <a>timeouts configuration</a>. This is | ||
|
@@ -8286,11 +8286,12 @@ <h3>Ticks</h3> | |
content observable effects that must be consistent across | ||
implementations. To accommodate this, the specification requires | ||
that <a>remote ends</a> <dfn>perform implementation-specific action | ||
dispatch steps</dfn> on a <a>browsing context</a> <var>context</var>, | ||
and a <var>list of events</var> and their properties. These steps | ||
must be equivalent to performing the given input device manipulations | ||
on <var>context</var>, such that trusted events corresponding to the | ||
entries in <var>list of events</var>are dispatched. | ||
dispatch steps</dfn> on a <var>context</var>, and a <var>list of events</var> | ||
and their properties. These steps must be equivalent to performing the given | ||
input device manipulations on the | ||
[=browsing context/top-level browsing context=] of the <var>context</var>, | ||
such that trusted events corresponding to the entries in | ||
<var>list of events</var> are dispatched. | ||
Comment on lines
+8293
to
+8294
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alternatively we can "hand-wave" hear like "These steps must be equivalent to user trying to perform the given input device manipulations on context through the top-level browsing context." There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
<aside class=note> | ||
<p>The list of events is not comprehensive; in particular the default | ||
|
@@ -8338,13 +8339,58 @@ <h3>Processing actions</h3> | |
input JSON, such that the actions to be performed in a single <a>tick</a> | ||
are grouped together. | ||
|
||
<p>To <dfn>get parent offset</dfn> of <var>context</var>: | ||
<ol class="algorithm"> | ||
<li>Let <var>offsetLeft</var> equal to 0 and <var>offsetTop</var> equal to 0. | ||
</li> | ||
<li> | ||
Let <var>navigable</var> be <var>context</var>'s <a>active document</a>'s | ||
[=navigable/parent=]. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [=navigable/parent=] is a property of a navigable and not the document. Did you mean to get the current navigable instead of a parent (e.g., https://html.spec.whatwg.org/#node-navigable)? |
||
</li> | ||
<li>Let <var>parent navigable</var> be <var>navigable</var>'s parent.</li> | ||
<li>If <var>parent navigable</var> is not null: | ||
<ol> | ||
<li> Let <var>parent context</var> be <var>parent navigable</var>'s | ||
[=navigable/document=]'s [=document/browsing context=]. | ||
</li> | ||
<li>Let <code>(parentOffsetLeft, parentOffsetTop)</code> be the result of | ||
[=get parent offset=] of <var>parent context</var>. | ||
</li> | ||
<li>Add <code>parentOffsetLeft</code> to <code>offsetLeft</code>.</li> | ||
<li>Add <code>parentOffsetTop</code> to <code>offsetTop</code>.</li> | ||
<li>Let <var>containerElement</var> be an <a>element</a> which <a>navigable | ||
container</a> presents <var>parent navigable</var>. | ||
</li> | ||
<li>Let <code>containerRect</code> be the result of calling | ||
{{Element/getBoundingClientRect()}} of <var>containerElement</var>. | ||
</li> | ||
<li>Let <code>borderLeftWidth</code> be the computed [=border-left-width=] | ||
of <code>containerElement</code> in <a>CSS pixels</a>. | ||
</li> | ||
<li>Let <code>borderTopWidth</code> be the computed [=border-top-width=] of | ||
<code>containerElement</code> in <a>CSS pixels</a>. | ||
</li> | ||
<li>Add <code>containerRect.left</code> + <code>borderLeftWidth</code> to | ||
<code>offsetLeft</code>. | ||
</li> | ||
<li>Add <code>containerRect.top</code> + <code>borderTopWidth</code> to | ||
<code>offsetTop</code>. | ||
</li> | ||
</ol> | ||
</li> | ||
<li>Return (<var>offsetLeft</var>, <var>offsetTop</var>).</li> | ||
</ol> | ||
<span class=issue>TODO: clarify if the algo respect transforms?</span> | ||
<span class=issue>TODO: respect iframe's viewport's intersections</span> | ||
|
||
<p>To <dfn>get coordinates relative to an origin</dfn> | ||
given <var>source</var>, <var>x offset</var>, <var>y offset</var>, | ||
<var>origin</var>, <var>browsing context</var>, and <var>actions | ||
options</var>: | ||
|
||
<ol class="algorithm"> | ||
<li>Let <code>(parentOffsetLeft, parentOffsetTop)</code> be the result of | ||
[=get parent offset=] of <var>browsing context</var>.</li> | ||
<li><p>Run the substeps of the first matching value | ||
of <var>origin</var> | ||
<dl> | ||
|
@@ -8392,7 +8438,7 @@ <h3>Processing actions</h3> | |
</dd> | ||
</dl> | ||
|
||
<li><p>Return (<var>x</var>, <var>y</var>) | ||
<li><p>Return (<var>x</var> + <var>parentOffsetLeft</var>, <var>y</var> + <var>parentOffsetTop</var>) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should the offset be applied to all origins or only the viewport? I think the origin pointer might already be in the top level context coordinates and not sure if the element origin does some adjustments already. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would expect the origin "pointer" to be relative to "context" param of "PerformActionsParameters" of the command. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That does not seem to follow from the spec text since input sources are per top-level browsing context. |
||
</ol> | ||
|
||
<p>To <dfn>extract an action sequence</dfn> given | ||
|
@@ -11714,6 +11760,7 @@ <h2>Index</h2> | |
<!-- Dirty value flag --> <li><dfn><a href=https://html.spec.whatwg.org/#concept-fe-dirty>Dirty value flag</a></dfn> | ||
<!-- Disabled --> <li><dfn><a href=https://html.spec.whatwg.org/#concept-element-disabled>Actually disabled</a></dfn> | ||
<!-- Document readiness --> <li><dfn><a href=https://html.spec.whatwg.org/#current-document-readiness>Document readiness</a></dfn> | ||
<!-- Document's browsing context --> <li><dfn data-dfn-for="document"><a href=https://html.spec.whatwg.org/#concept-document-bc>Browsing context</a></dfn> | ||
<!-- Element contexts --> <li><dfn data-lt="element context"><a href=https://html.spec.whatwg.org/#concept-element-contexts>Element contexts</a></dfn> | ||
<!-- Enumerated attribute --> <li><dfn><a href=https://html.spec.whatwg.org/#enumerated-attribute>Enumerated attribute</a></dfn> | ||
<!-- Event loop --> <li><dfn><a href=https://html.spec.whatwg.org/#event-loop>Event loop</a></dfn> | ||
|
@@ -11725,6 +11772,8 @@ <h2>Index</h2> | |
<!-- Joint session history --> <li><dfn><a href=https://html.spec.whatwg.org/#joint-session-history>Joint session history</a></dfn> | ||
<!-- Mature (navigation) --> <li><dfn data-lt="matured"><a href=https://html.spec.whatwg.org/#concept-navigate-mature>Mature</a></dfn> navigation. | ||
<!-- Mutable --> <li><dfn><a href=https://html.spec.whatwg.org/#concept-fe-mutable>Mutable</a></dfn> | ||
<!-- Navigable's document --> <li><dfn data-dfn-for="navigable"><a href=https://html.spec.whatwg.org/#nav-document>Document</a></dfn> | ||
<!-- Navigable's parent --> <li><dfn data-dfn-for="navigable"><a href=https://html.spec.whatwg.org/#nav-parent>Parent</a></dfn> | ||
<!-- Navigate --> <li><dfn data-lt="navigating|navigation"><a href=https://html.spec.whatwg.org/#navigate>Navigate</a></dfn> | ||
<!-- Origin-clean --> <li><dfn><a href=https://html.spec.whatwg.org/#concept-canvas-origin-clean>Origin-clean</a></dfn> | ||
<!-- Overridden reload --> <li><dfn><a href="https://html.spec.whatwg.org/multipage/dom.html#an-overridden-reload">An overridden reload</a></dfn> | ||
|
@@ -11742,6 +11791,7 @@ <h2>Index</h2> | |
<!-- Simple dialogs --> <li><dfn data-lt="simple dialog"><a href=https://html.spec.whatwg.org/#simple-dialogs>Simple dialogs</a></dfn> | ||
<!-- Steps to fire beforeunload --> <li><dfn><a href=https://html.spec.whatwg.org/#steps-to-fire-beforeunload>Steps to fire beforeunload</a></dfn> | ||
<!-- Suffering from bad input --> <li><dfn><a href=https://html.spec.whatwg.org/#suffering-from-bad-input>Suffering from bad input</a></dfn> | ||
<!-- Top-level browsing context --> <li><dfn data-dfn-for="browsing context"><a href=https://html.spec.whatwg.org/#bc-tlbc>Top-level browsing context</a></dfn> | ||
<!-- Traverse the history by a delta --> <li><dfn><a href=https://html.spec.whatwg.org/#traverse-the-history-by-a-delta>Traverse the history by a delta</a></dfn> | ||
<!-- Unfocusing steps --><li><dfn><a href=https://html.spec.whatwg.org/#unfocusing-steps>unfocusing steps</a></dfn> | ||
<!-- User prompt --> <li><dfn data-lt="user prompts"><a href=https://html.spec.whatwg.org/#user-prompts>User prompt</a></dfn> | ||
|
@@ -11869,6 +11919,15 @@ <h2>Index</h2> | |
<!-- CSS pixels --> <li><dfn><a href=https://www.w3.org/TR/css-values-3/#px>CSS pixels</a></dfn> | ||
</ul> | ||
|
||
<dd>The following properties are defined in | ||
the CSS Backgrounds and Borders Module Level 3: [[CSS3-BACKGROUND]] | ||
<ul> | ||
<!-- border-left-width property --> <li>The <dfn><a href=https://drafts.csswg.org/css-backgrounds-3/#propdef-border-left-width><code>border-left-width</code></a></dfn> property | ||
</ul> | ||
<ul> | ||
<!-- border-top-width property --> <li>The <dfn><a href=https://drafts.csswg.org/css-backgrounds-3/#propdef-border-left-width><code>border-top-width</code></a></dfn> property | ||
</ul> | ||
|
||
<dd>The following properties are defined in | ||
the CSS Basic Box Model Level 3 specification: [[CSS3-BOX]] | ||
<ul> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep browsing context indicating the context var type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I missed it.