-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[fuchsia] HitTesting for fuchsia a11y #15570
Conversation
Retry of failing Fuchsia build here: https://ci.chromium.org/p/flutter/builders/try/Linux%20Fuchsia/2150 Original failed because of infra issue on bot_update. |
@godofredoc - Linux Fuchsia has repeatedly failed on this due to different infra issues here... |
https://github.com/flutter/engine/blob/master/testing/fuchsia/run_tests.sh#L37 seems like we need to add a delay after paving or a retry to the ssh connection. The test seems to be flaking because we are trying to ssh immediately after paving and the device may be still not available. |
.rect = flutter_node.rect, | ||
.transform = flutter_node.transform, | ||
.children_in_hit_test_order = | ||
std::vector<int32_t>(flutter_node.childrenInHitTestOrder), |
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.
Why the cast?
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.
Fuchsia needs these at int32_t
private: | ||
struct SemanticsNode { |
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.
Why not just reuse flutter::SemanticsNode
from //flutter/lib/ui/semantics/semantics_node.h
. It may have some redundant bits but having two of these is really hard to parse.
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.
This started as an attempt to avoid holding onto more than we need, but I agree it's less helpful now. I'll change it.
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.
Ah. The reason I can't do this is I need the screen_rect, which flutter::SemanticsNode
does not have.
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 for clarifying.
.rect = flutter_node.rect, | ||
.transform = flutter_node.transform, | ||
.children_in_hit_test_order = | ||
std::vector<int32_t>(flutter_node.childrenInHitTestOrder), |
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.
Not sure why the cast is necessary but just reusing the flutter::SemanticsNode would negate the need for any of this.
|
||
{ | ||
std::unordered_set<int32_t> visited_nodes; | ||
UpdateScreenRects(kRootNodeId, SkMatrix44::I(), &visited_nodes); |
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.
Let's have an UpdateSceenRects
overload that doesn't take the final argument so that callers don't have to do this dance. This interface looks a bit awkward to use.
UpdateScreenRects(int32_t node_id, SkMatrix44 parent_transform, std::unordered_set<int32_t>& visited_nodes = {});
should work too I think.
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.
The initializer doesn't work because it's a non-const lvalue reference trying to bind to a temporary.
I can make a convenience override though.
const auto& current_transform = parent_transform * node.transform; | ||
|
||
const auto& rect = node.rect; | ||
std::vector<SkVector4> points = { |
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.
This can all be done in a single call to SkMatrix44::map2
, then putting the resulting points in a SkRect
and then calling SkRect::sort
.
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.
Nice. Done ... I think. Am I picking the right indices?
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.
lol, I am confused too. But these look right.
SkMatrix44 parent_transform, | ||
std::unordered_set<int32_t>* visited_nodes); | ||
|
||
void GetHitNode(int32_t node_id, |
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.
A bit of documentation would be nice.
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.
How about std::optional<Hit> GetHitNode(...)
for clarity?
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'm not sure if this really makes things clearer, but did it.
@godofredoc stick-movie-plank-alien misbehaving again, didn't finish paving within 30 minutes. |
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.
Other than the missing return ending up working on an invalid iterator, lgtm.
const auto& current_transform = parent_transform * node.transform; | ||
|
||
const auto& rect = node.rect; | ||
std::vector<SkVector4> points = { |
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.
lol, I am confused too. But these look right.
private: | ||
struct SemanticsNode { |
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 for clarifying.
std::unordered_set<int32_t>* visited_nodes) { | ||
auto it = nodes_.find(node_id); | ||
if (it == nodes_.end()) { | ||
FML_LOG(ERROR) << "UpdateScreenRects called on unknown node"; |
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.
Aren't you missing an early return here?
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.
Yes - added.
@godofredoc - stick-movie-plank-alien failed again... https://chromium-swarm.appspot.com/task?id=49e4cbb4d21ac710 |
Is that because it's unplugged but somehow still in the pool? |
This pull request is not suitable for automatic merging in its current state.
|
flutter/engine@83a64b7...46e58b9 git log 83a64b7..46e58b9 --first-parent --oneline 2020-01-22 iska.kaushik@gmail.com [bots] remove auto-assign for web PRs (flutter/engine#15878) 2020-01-22 dnfield@google.com [fuchsia] HitTesting for fuchsia a11y (flutter/engine#15570) 2020-01-22 skia-flutter-autoroll@skia.org Roll src/third_party/skia 808f021b51df..d59053987a27 (4 commits) (flutter/engine#15882) 2020-01-22 skia-flutter-autoroll@skia.org Roll src/third_party/dart 4ad5fab95753..439cabaec02f (2 commits) (flutter/engine#15881) 2020-01-22 skia-flutter-autoroll@skia.org Roll src/third_party/skia 4277f0173657..808f021b51df (7 commits) (flutter/engine#15879) 2020-01-22 goderbauer@google.com Remove unused Imports and private method (flutter/engine#15872) 2020-01-22 skia-flutter-autoroll@skia.org Roll src/third_party/dart ef0c7f16e609..4ad5fab95753 (41 commits) (flutter/engine#15875) 2020-01-22 stuartmorgan@google.com Add missing include in GLFW and Windows embeddings (flutter/engine#15867) 2020-01-22 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/linux-amd64 from p1UDn... to v-OJE... (flutter/engine#15874) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC aaclarke@google.com on the revert to ensure that a human is aware of the problem. To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
flutter/engine@83a64b7...46e58b9 git log 83a64b7..46e58b9 --first-parent --oneline 2020-01-22 iska.kaushik@gmail.com [bots] remove auto-assign for web PRs (flutter/engine#15878) 2020-01-22 dnfield@google.com [fuchsia] HitTesting for fuchsia a11y (flutter/engine#15570) 2020-01-22 skia-flutter-autoroll@skia.org Roll src/third_party/skia 808f021b51df..d59053987a27 (4 commits) (flutter/engine#15882) 2020-01-22 skia-flutter-autoroll@skia.org Roll src/third_party/dart 4ad5fab95753..439cabaec02f (2 commits) (flutter/engine#15881) 2020-01-22 skia-flutter-autoroll@skia.org Roll src/third_party/skia 4277f0173657..808f021b51df (7 commits) (flutter/engine#15879) 2020-01-22 goderbauer@google.com Remove unused Imports and private method (flutter/engine#15872) 2020-01-22 skia-flutter-autoroll@skia.org Roll src/third_party/dart ef0c7f16e609..4ad5fab95753 (41 commits) (flutter/engine#15875) 2020-01-22 stuartmorgan@google.com Add missing include in GLFW and Windows embeddings (flutter/engine#15867) 2020-01-22 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/linux-amd64 from p1UDn... to v-OJE... (flutter/engine#15874) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC aaclarke@google.com on the revert to ensure that a human is aware of the problem. To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
This reverts commit d41eb4b.
/cc @ankitdave06
This still needs a test, but working when tested manually
I'm a little torn on whether my defensive guards around cycles are overly-pessimistic. The framework should never allow this to happen, but if it does happen the engine will crash with a stack overflow - and the engine API has no asserts in place to check it otherwise.
Fixes flutter/flutter#47386