script: Implement check for supported and enabled commands#42634
script: Implement check for supported and enabled commands#42634TimvdLippe merged 1 commit intoservo:mainfrom
Conversation
|
🔨 Triggering try run (#22036341222) for Linux (WPT) |
|
Test results for linux-wpt from try job (#22036341222): Flaky unexpected result (33)
Stable unexpected results that are known to be intermittent (15)
Stable unexpected results (31)
|
|
|
1e2108f to
c304b32
Compare
The first step of `execCommand` commands is to figure out if they are supported and enabled. Therefore, implement these two pieces with only 1 command: delete. The implementation of `delete` is currently mostly dummy, to have at least something going. But the main part of this change is to setup the infrastructure to figure out when commands are supported and enabled. For the first part, its simply the list of commands we currently have implemented, which is only delete. For the second part, we need to consider the active range of the current selection and do various checks, as well as check the presence of `contenteditable`. Part of servo#25005 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
c304b32 to
8d216cf
Compare
simonwuelker
left a comment
There was a problem hiding this comment.
Personally I'd prefer a Command enum that we can match in fn execute and friends over Box<dyn BaseCommand>. In my experience the latter is hard to debug because its annoying to identify the command given only dyn BaseCommand. But I'm not working on this code, so I'll leave that up to you.
Thanks for working on this API!
|
I did think about an enum and am not yet sure what's gonna work best. The spec is quite vague at times and all over the place, so I am trying my best to put some structure to it. Once I know more details, I will reconsider implementing it as enum for the mentioned reasons. |
The first step of
execCommandcommands is to figure outif they are supported and enabled. Therefore, implement
these two pieces with only 1 command: delete.
The implementation of
deleteis currently mostly dummy,to have at least something going. But the main part of
this change is to setup the infrastructure to figure out
when commands are supported and enabled.
For the first part, its simply the list of commands we
currently have implemented, which is only delete.
For the second part, we need to consider the active range
of the current selection and do various checks, as well as
check the presence of
contenteditable.Part of #25005