Commit e7af75e
authored
fix: Improve robustness of
## The basics
- [x] I [validated my changes](https://developers.google.com/blockly/guides/contribute/core#making_and_verifying_a_change)
## The details
### Resolves
Fixes RaspberryPiFoundation/blockly-keyboard-experimentation#515
### Proposed Changes
This adds `canBeFocused()` checks to all the places that could currently cause problems if a node were to return `false`.
### Reason for Changes
This can't introduce a problem in current Core and, in fact, most of these classes can never return `false` even through subclasses. However, this adds better robustness and fixes the underlying issue by ensuring that `getFocusableElement()` isn't called for a node that has indicated it cannot be focused.
### Test Coverage
I've manually tested this through the keyboard navigation plugin. However, there are clearly additional tests that would be nice to add both for the traverser and for `WorkspaceSvg`, both likely as part of resolving #8915.
### Documentation
No new documentation changes should be needed here.
### Additional Information
This is fixing theoretical issues in Core, but a real issue tracked by the keyboard navigation plugin repository.IFocusableNode uses (#9031)1 parent a1be83b commit e7af75e
2 files changed
+21
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | | - | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
102 | | - | |
103 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2746 | 2746 | | |
2747 | 2747 | | |
2748 | 2748 | | |
2749 | | - | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
2750 | 2752 | | |
2751 | 2753 | | |
2752 | 2754 | | |
| |||
2769 | 2771 | | |
2770 | 2772 | | |
2771 | 2773 | | |
| 2774 | + | |
2772 | 2775 | | |
2773 | 2776 | | |
2774 | 2777 | | |
| |||
2780 | 2783 | | |
2781 | 2784 | | |
2782 | 2785 | | |
2783 | | - | |
| 2786 | + | |
| 2787 | + | |
| 2788 | + | |
2784 | 2789 | | |
2785 | 2790 | | |
2786 | | - | |
| 2791 | + | |
| 2792 | + | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
2787 | 2798 | | |
2788 | 2799 | | |
2789 | 2800 | | |
| |||
0 commit comments