-
Notifications
You must be signed in to change notification settings - Fork 6k
Fix DOM-based ParagraphRuler.hitTest() #14504
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
1 similar comment
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
|
@googlebot I signed it! |
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
1 similar comment
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
mdebbar
left a comment
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.
|
@jason-simmons Hi Jason. You were assigned to the default reviewer by Github. Are there anything I can improve this PR? |
|
@photon3108 I don't think @jason-simmons will be reviewing this PR as it's a web-only change. @ferhatb and my approvals should be good enough. Please wait until all the checkmarks become green then merge the PR. Thanks again for helping us improve Flutter for web! |
|
@mdebbar Github doesn't authorize me to merge this issue. All are green but there is no merge button. I thought you were waiting for @jason-simmons' review. Could you help me merge it? Thanks. |
* bb118c6 Roll src/third_party/dart 8d11c1dce64a..642f8d052fd7 (1 commits) (flutter/engine#14574) * 09c434d Use ELF for Dart AOT snapshots on Fuchsia. (flutter/engine#13896) * e1e7851 Roll fuchsia/sdk/core/linux-amd64 from VdBKA... to uFFWW... (flutter/engine#14575) * f317f8f Roll src/third_party/skia c76ac8e325c7..77742c350371 (1 commits) (flutter/engine#14576) * 2ba5633 instructions for running firefox/safari tests (flutter/engine#14562) * 9cf1e46 Roll src/third_party/dart 642f8d052fd7..7113fc79a83c (3 commits) (flutter/engine#14578) * f5b877a [web] Run engine tests on Safari locally by launching safari installed on MacOS (flutter/engine#14555) * 68d9196 Fix DOM-based ParagraphRuler.hitTest() (flutter/engine#14504) * bb65df8 Roll src/third_party/skia 77742c350371..a8352ccaae37 (8 commits) (flutter/engine#14579) * ad1ab56 Roll src/third_party/dart 7113fc79a83c..e50d98cd5651 (8 commits) (flutter/engine#14580) * 22413ef Update formatting in web_ui scene bulder to match flutter style and dartfmt. (flutter/engine#14539) * 6e825e7 Roll fuchsia/sdk/core/mac-amd64 from Ykb4b... to f51Q_... (flutter/engine#14584) * 1d3bb8c Fix message_loop_fuchsia and thus enable fml_tests and flow_tests for Fuchsia (flutter/engine#14583) * 1f7bb9d Wire up OpacityLayer to Scenic (flutter/engine#14577) * 11db035 Roll src/third_party/skia a8352ccaae37..87e9ddb675b6 (11 commits) (flutter/engine#14585) * bd58af7 Roll src/third_party/dart e50d98cd5651..141fcfa61092 (3 commits) (flutter/engine#14586) * 929b1ed Engine support for ImageFiltered widget (flutter/engine#14491) * 40b84fc Fix lint warnings across web_ui, add missing browserEngine case in text field. (flutter/engine#14535) * ea1d330 Roll fuchsia/sdk/core/linux-amd64 from uFFWW... to 25LzW... (flutter/engine#14587) * 854d5f8 Roll src/third_party/skia 87e9ddb675b6..7e2dea568299 (1 commits) (flutter/engine#14589)
* [web] Fix ParagraphRuler.hitTest * [web] Add a test-case for paragraph.getPositionForOffset and nested TextSpans * [web] Add a test-case for paragraph.getPositionForOffset and nested TextSpans * [web] remove trailing spaces * [web] avoid differences of overflow-wrap between chrome and firefox
|
This is still broken on |
|
On further investigating, looks like it breaks when the TextAlign used is something other than left. @photon3108 I'm tagging you since you are the contributor. |

Description
If you tap the nested
TextSpan, it doesn't received the tap event byTapGestureRecognizer. That's becauseDOM-basedimplementation ofParagraphRuler.hitTest()doesn't pick the inner-mostTextSpanup. I fixed it by arranging the search path with breadth-first traversal. There are more explanations in the comments of test-case.Issues
Fixed: flutter/flutter#46975
Related: flutter/flutter#33523
Tests
I added a test-case for general implementation and that covers both cases of
DOM-basedandCanvas-basedimplementation.