-
Notifications
You must be signed in to change notification settings - Fork 142
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
Add window.h5vcc.accessibility #5154
base: main
Are you sure you want to change the base?
Conversation
264dff8
to
576ce28
Compare
576ce28
to
7eafdb4
Compare
// This callback is invoked when text-to-speech settings have changed. It | ||
// may also be invoked if other accessibility settings (ones not related to | ||
// text-to-speech) have changed. | ||
attribute EventHandler ontexttospeechchange; |
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.
Does this correspond to a c25 web api? The name is not very similar to a c25 one, so it's unclear.
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.
No, this does not match C25 web API exactly. I'm following the blink syntax standard for creating EventHandler, I think our other new h5vcc web APIs are following this syntax too, e.g. in h5vcc_metrics.idl and h5vcc_runtime.idl
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.
You might want to keep the old name for now, otherwise you will need to make a custom Kabuki change and use a loader to test screen reader. Because Kabuki won't recognize this new event.
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.
Our other h5vcc APIs that used events instead of callbacks change the names of web APIs but all correspond to c25 APIs and so have very similar names to them. If this is a similar case, it should change the name as you did but be similar to the c25 name. Or, if you think the name is inaccurate now that we use events (i.e. if it's addTextToSpeechListener
), you should explicitly call out in the comment what this API corresponds to from c25.
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.
Additionally, you added the API in the IDL but you did not add an implementation for it (even a stub) in the source as far as I can tell
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 believe the API will be auto-generated by DEFINE_ATTRIBUTE_EVENT_LISTENER. If not, I'll add to this in follow-up CLs.
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.
Added comments to explain how to map the APIs to C25.
third_party/blink/renderer/modules/cobalt/h5vcc_accessibility/h_5_vcc_accessibility.cc
Outdated
Show resolved
Hide resolved
7a82a93
to
b086396
Compare
Can you please do the following before merging?
This build config uses some strict compiler flags in blink that aren't used for existing CI builds. So it would be good to manually verify the build works until b/405988705 is fixed. |
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.
Left a few small comments but otherwise looks good!
third_party/blink/renderer/modules/cobalt/h5vcc_accessibility/h_5_vcc_accessibility.idl
Outdated
Show resolved
Hide resolved
third_party/blink/renderer/modules/cobalt/h5vcc_accessibility/h_5_vcc_accessibility.idl
Outdated
Show resolved
Hide resolved
b086396
to
322ae17
Compare
You are right!
|
322ae17
to
854742a
Compare
// This callback is invoked when text-to-speech settings have changed. It | ||
// may also be invoked if other accessibility settings (ones not related to | ||
// text-to-speech) have changed. | ||
attribute EventHandler ontexttospeechchange; |
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.
You might want to keep the old name for now, otherwise you will need to make a custom Kabuki change and use a loader to test screen reader. Because Kabuki won't recognize this new event.
third_party/blink/renderer/modules/cobalt/h5vcc_accessibility/h_5_vcc_accessibility.cc
Outdated
Show resolved
Hide resolved
c60c07c
to
5e588a8
Compare
Yup - thanks for fixing them! |
third_party/blink/renderer/modules/cobalt/h5vcc_accessibility/h_5_vcc_accessibility.h
Outdated
Show resolved
Hide resolved
cobalt/browser/h5vcc_accessibility/public/mojom/h5vcc_accessibility.mojom
Outdated
Show resolved
Hide resolved
new H5vccAccessibilityImpl(*render_frame_host, std::move(receiver)); | ||
} | ||
|
||
void H5vccAccessibilityImpl::GetTextToSpeech(GetTextToSpeechCallback callback) { |
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.
If there are different implementations for 1P-ATV and 3P then I'd recommend, instead of branching here on preprocessor conditionals, providing different Mojo implementations.
See the CrashAnnotator
Mojo interface as an example:
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.
Thanks Holden, I'll focus on ATV implementation first, in next PR.
4cab11e
to
e378f46
Compare
e378f46
to
8b226a9
Compare
This PR adds window.h5vcc.accessibility APIs.
There are 2 exposed attributes
textToSpeech
which is readonly, andontexttospeechchange
which would trigger register callback only from C++ backend when a11y settings are changed.b/391708407