Skip to content

Conversation

@yezhizhen
Copy link
Member

@yezhizhen yezhizhen commented Oct 3, 2025

subtype is given in the context but never used.


Preview | Diff

<li><p>If <var>source</var> is undefined, set <var>source</var> to
the result of <a>trying</a> to <a>create an input source</a>
with <var>input state</var> and <var>type</var>.
with <var>input state</var>, <var>type</var> and <var>subtype</var>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find!

There is one further thing that I noticed when checking the chain of calls: Within create an input source the subtype is mentioned as optional, while calling create a pointer input source requires the subtype. I think that we should remove the optional from the create an input source algorithm.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should still keep optional, as only "pointer input source" requires subtype.
There seems to be a bigger problem now: it seems most of caller don't passes subtype, even for those explicitly creating "pointer" input source, e.g. this.
cc @xiaochengh

I propose to add subtype to all callers that explicitly create "pointer", but keep subtype as optional in create an input source.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's also related to this issue #1925 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yezhizhen good point! I completely missed that. So yes, that makes sense and great that you are going to fix the other freshly detected issues as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So create an input source is called in step 6 of process an input source action sequence. There is no subtype passed in at the moment if it's a pointer input source. In its step 5 the parameters are processed and the subtype is available as parameters.pointerType. That one needs to be passed down.

sequence</dfn>, given <var>input state</var>, <var>action
sequence</var>, and <var>actions options</var>, a <a>remote end</a>
must:
sequence</var>, and <var>actions options</var>, and optional <var>subtype</var>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sequence</var>, and <var>actions options</var>, and optional <var>subtype</var>,
sequence</var>, <var>actions options</var>, and optional <var>subtype</var>,

<li><p>Let <var>actions by tick</var> be the result of <a>trying</a>
to <a>extract an action sequence</a> with <var>input state</var>,
<var>parameters</var>, and <var>actions options</var>.
<var>parameters</var>, <var>actions options</var> and optional <var>subtype</var>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this level subtype is undefined. It's not part of the outer actions dictionary but part of inner actions (specifically pointer as you pointed out). So we cannot pass subtype here. Here an example:

{
  "actions": [
    {
      "type": "pointer",
      "actions": [
        {
          "type": "pointerMove",
          "x": 49,
          "y": 49,
          "origin": {
            "element-6066-11e4-a52e-4f735466cecf": "32a6492e-a085-405e-a39a-9765c35dcb2e"
          }
        },
        {
          "type": "pointerDown",
          "button": 0
        },
        {
          "type": "pointerMove",
          "x": 149,
          "y": 149,
          "origin": {
            "element-6066-11e4-a52e-4f735466cecf": "32a6492e-a085-405e-a39a-9765c35dcb2e"
          }
        },
        {
          "type": "pointerUp",
          "button": 0
        }
      ],
      "parameters": {
        "pointerType": "mouse"
      },
      "id": "1"
    }
  ]
}

state</var>, <var>action sequence</var>, and <var>actions
options</var>.
state</var>, <var>action sequence</var>, <var>actions
options</var> and optional <var>subtype</var>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that here we still have a list of )(inner) actions that are getting passed to process an input source action sequence. So we still don't have a type subtype and as such won't need the variable.

<li><p>If <var>source</var> is undefined, set <var>source</var> to
the result of <a>trying</a> to <a>create an input source</a>
with <var>input state</var> and <var>type</var>.
with <var>input state</var>, <var>type</var> and <var>subtype</var>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So create an input source is called in step 6 of process an input source action sequence. There is no subtype passed in at the moment if it's a pointer input source. In its step 5 the parameters are processed and the subtype is available as parameters.pointerType. That one needs to be passed down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants