Skip to content
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

Merged
merged 12 commits into from
Jan 22, 2020
Merged

Conversation

dnfield
Copy link
Contributor

@dnfield dnfield commented Jan 14, 2020

/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

@dnfield dnfield changed the title [wip][fuchsia] HitTesting for fuchsia a11y [fuchsia] HitTesting for fuchsia a11y Jan 14, 2020
@dnfield
Copy link
Contributor Author

dnfield commented Jan 14, 2020

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.

@dnfield dnfield requested a review from cbracken January 14, 2020 17:31
@dnfield
Copy link
Contributor Author

dnfield commented Jan 14, 2020

@dnfield
Copy link
Contributor Author

dnfield commented Jan 15, 2020

@godofredoc - Linux Fuchsia has repeatedly failed on this due to different infra issues here...

@godofredoc
Copy link
Contributor

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),
Copy link
Member

Choose a reason for hiding this comment

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

Why the cast?

Copy link
Contributor Author

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 {
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Member

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),
Copy link
Member

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);
Copy link
Member

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.

Copy link
Contributor Author

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 = {
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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,
Copy link
Member

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

@dnfield
Copy link
Contributor Author

dnfield commented Jan 16, 2020

@godofredoc stick-movie-plank-alien misbehaving again, didn't finish paving within 30 minutes.

https://chromium-swarm.appspot.com/task?id=49c445271c064910

Copy link
Member

@chinmaygarde chinmaygarde left a 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 = {
Copy link
Member

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 {
Copy link
Member

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";
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes - added.

@dnfield dnfield added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Jan 22, 2020
@dnfield
Copy link
Contributor Author

dnfield commented Jan 22, 2020

@godofredoc - stick-movie-plank-alien failed again... https://chromium-swarm.appspot.com/task?id=49e4cbb4d21ac710

@dnfield
Copy link
Contributor Author

dnfield commented Jan 22, 2020

Is that because it's unplugged but somehow still in the pool?

@fluttergithubbot
Copy link
Contributor

This pull request is not suitable for automatic merging in its current state.

  • The status or check suite Linux Fuchsia has failed. Please fix the issues identified (or deflake) before re-applying this label.

@fluttergithubbot fluttergithubbot removed the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Jan 22, 2020
@dnfield dnfield merged commit c3e2c0f into flutter:master Jan 22, 2020
@dnfield dnfield deleted the fuchsia_hit branch January 22, 2020 09:12
@dnfield dnfield mentioned this pull request Jan 22, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 22, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 22, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 22, 2020
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Jan 23, 2020
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
jonahwilliams pushed a commit to jonahwilliams/flutter that referenced this pull request Jan 24, 2020
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
NoamDev pushed a commit to NoamDev/engine that referenced this pull request Feb 27, 2020
NoamDev added a commit to NoamDev/engine that referenced this pull request Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

a11y hit Test support in flutter
5 participants