3422 Commits

Author SHA1 Message Date
freiling
1e72eb3be4 [fuchsia][flatland] Tests for FlatlandPlatformView (flutter/engine#29999) 2021-12-16 13:14:09 -08:00
Igor Cota
3ce5370e35 maybeGetInitialRouteFromIntent: check if URI data getPath() is null (flutter/engine#29766) 2021-12-16 13:09:13 -08:00
Chris Bracken
6a6541b4de Windows: Implement IAccessible hit testing (flutter/engine#30366)
IAccessible objects should implement accHitTest. Our implementation, in
AXPlatformNodeWin, delegates hit testing to
AXPlatformNodeDelegate::HitTestSync. Here, we do a quick recursive
depth-first walk of the accessibility tree to return the best match.

We define the best match as the deepest node in the tree that contains
the point under test whose children do not.

Issue: https://github.com/flutter/flutter/issues/77838
2021-12-16 10:13:15 -08:00
Emmanuel Garcia
522e4f06b6 Keep a single source of truth for embedding dependencies (flutter/engine#30359) 2021-12-15 23:39:02 -08:00
Jenn Magder
9b19d77c75 Revert "Removed the email warning about notifications entitlement" (flutter/engine#30330) 2021-12-14 18:09:02 -08:00
Tong Mu
3fface0f66 [Win32, Keyboard] Abstract KeyboardManager from FlutterWindowWin32 (flutter/engine#30296) 2021-12-14 17:54:03 -08:00
Jim Graham
46a8def326 Opacity peephole optimization (flutter/engine#29775) 2021-12-14 16:19:09 -08:00
Chris Bracken
a2d82caeab Desktop: Support a11y slider widgets (flutter/engine#30322)
Adds support to the common desktop accessibility bridge for widgets that
include a semantics node with the `isSlider` flag set.

Issue: https://github.com/flutter/flutter/issues/77838
2021-12-14 11:20:16 -08:00
Jenn Magder
aaaf467b08 Add logging to scrollable semantics test (flutter/engine#30321) 2021-12-14 11:14:02 -08:00
Dan Field
b38b90c039 Revert "Fix eglPresentationTimeANDROID is no effective" (flutter/engine#30310)
* Revert "Fix eglPresentationTimeANDROID is no effective (#30182)"

This reverts commit 0d7ba05d3456807e7e24353fe911738952a02888.

* Revert "Use eglPresentationTimeANDROID to avoid bogging down the GPU (#29727)"

This reverts commit edb87942de0404a2802351c050a4f1b6de239bd7.
2021-12-13 20:02:20 -08:00
Chris Bracken
a9722681ef Support toggle buttons for desktop accessibility (flutter/engine#30297) 2021-12-13 11:04:05 -08:00
voicewitness
600e46b8b0 Fix wrong context when use platfromview (flutter/engine#30184) 2021-12-12 22:14:05 -08:00
Marcel Kirchhoff
f27c7836eb Fix typo in jni registration (flutter/engine#30282) 2021-12-12 18:14:09 -08:00
Dan Field
9a45b6d009 Revert "iOS Background Platform Channels (#29665)" (flutter/engine#30289)
This reverts commit 7ab226eaf44a58e380fee9023b5eaf2eb6f73233.
2021-12-12 13:43:48 -08:00
MiracleSoul
0d7ba05d34 Fix eglPresentationTimeANDROID is no effective (flutter/engine#30182)
* Fix eglPresentationTimeANDROID is no effective

* Update android_environment_gl.cc

Co-authored-by: Dan Field <dfield@gmail.com>
2021-12-10 11:05:25 -08:00
Emmanuel Garcia
dceed9cd73 Migrate to Mockito 4.1.0 (flutter/engine#30257) 2021-12-10 10:19:10 -08:00
Chris Bracken
2474482021 Override FlutterPlatformNodeDelegate::GetUniqueId (flutter/engine#30261)
The default implementation of GetUniqueId on ui::AXPlatformNodeDelegate
always returns ID 1. We had previously implemented this on the windows
platform node delegate, but for consistency's sake, and because the
default implementation is surprising, we're promoting this to the
FlutterPlatformNodeDelegate base class.

Issue: https://github.com/flutter/flutter/issues/77838
2021-12-10 10:05:00 -08:00
chunhtai
95eab38132 Android accessibility bridge also fire selection change event when it predict selection change. (flutter/engine#30199) 2021-12-10 10:04:08 -08:00
Chris Bracken
f5dc978476 Test shell/platform/common a11y code on Windows (flutter/engine#30262)
This enables unittests for the accessibility bridge in
common_cpp_unittests, when running on Windows. Previously, we only
tested on macOS.

Issue: https://github.com/flutter/flutter/issues/77838
2021-12-09 22:49:50 -08:00
Chris Bracken
82f25e5da7 Fix TestAccessibilityBridgeDelegate event caching (flutter/engine#30260)
TestAccessibilityBridgeDelegate::accessibility_events previously held
values of type ui::AXEventGenerator::TargetedEvent. TargetedEvent
contains an AXNode pointer and a const reference to a
ui::AXEventGenerator::EventParams object, and as such it's unsafe to
make or read copies of TargetedEvent values outside the scope of the
AccessibilityBridgeDelegate::OnAccessibilityEvent callback.

In this patch, we update the accessibility_events vector to simply hold
EventType values since this is the only part of the value we use in our
existing tests. If in future we need the full TargetedEvent, we'll need
to properly copy these values.

This patch also fixes a typo in the accessibility_events identifier and
converts an EXPECT_EQ to an ASSERT_EQ in a case where the following
test expectations are meaningless/could crash if the
accessibility_events size isn't as expected.

Issue: https://github.com/flutter/flutter/issues/77838
2021-12-09 22:08:58 -08:00
Chris Bracken
616ed57c9b Simplify win32 platform node delegate GetParent (flutter/engine#30258)
In the Win32 accessibility tree, each AXTree node has an associated
IAccessible object. In WindowWin32, our WM_GETOBJECT handler returns the
IAccessible associated with the root node of the tree (node 0). On other
platforms, we often add our root accessibility object as a subnode of
some existing accessibility object associated with the view. On Windows,
the root IAccessible _is_ the accessibility object associated with the
view (on Windows, and HWND).

In the previous implementation, AccessibleObjectFromWindow actually just
returns the root IAccessible object, which is equivalent to just
returning GetNativeViewAccessible. Instead, we just return null once we
hit the root of the tree.

Issue: https://github.com/flutter/flutter/issues/77838
2021-12-09 19:29:11 -08:00
Chris Bracken
01b8db3de9 Call IAccessible::accFocus to move a11y focus (flutter/engine#30256)
On receipt of a FOCUS_CHANGED event from the AX tree, call
IAccessible::accFocus to tell screen readers to move the accessibility
focus to that node. This is in addition to setting the keyboard focus
via the EVENT_OBJECT_FOCUS event.

Issue: https://github.com/flutter/flutter/issues/77838
2021-12-09 15:58:07 -08:00
Chris Bracken
5992275cdb Win32: Handle OnAccessibilityEvent (flutter/engine#30176)
Implements OnAccessibilityEvent, which translates events from the AXTree
into Windows MSAA event notifications.

This also eliminates the UIA root object lookup in response to
WM_GETOBJECT, since our initial implementation, like Chromium's default
implementation, is based on MSAA.

Issue: https://github.com/flutter/flutter/issues/77838
2021-12-09 14:38:24 -08:00
Amanda
6819f18463 [fuchsia] Use network-legacy-deprecated pkg in embedder test (flutter/engine#30244) 2021-12-09 13:34:05 -08:00
Rulong Chen(陈汝龙)
915625716a [android] Fix unexpected behavior in |detachFromFlutterEngine|. (flutter/engine#30202) 2021-12-09 10:44:04 -08:00
eggfly
d459933b42 [Android] Fix mEditable NullPointerException in TextInputPlugin (flutter/engine#30145) 2021-12-08 20:19:05 -08:00
Chris Bracken
0d41ebed6a Implement GetUniqueId on Windows node delegates (flutter/engine#30204)
`AXPlatformNodeDelegate` provides a default implementation of
`GetUniqueId()` which returns the same value (1) for all nodes.
`AXPlatformNodeWin` relies on a unique ID being returned from this
method in its `GetTargetFromChildID` method.

In the world MSAA accessibility, each `HWND` may have a root
`IAccessible` object associated with it. Events are fired by calling the
`NotifyWinEvent` Win32 call and specifying:

1. The `HWND` (in our case, the one associated with our `WindowWin32`)
2. The target object (`OBJID_CLIENT` for the root `IAccessible`
   associated with that `HWND`)
3. A child identifier that uniquely identifies the target node in the
   tree

This child identifier can be one of:

* `CHILDID_SELF` for events targeting the root `IAccessible`.
* A positive integer that specifies the index of a direct child of the
  root.
* A negative integer which, when negated, specifies the unique ID of a
  child within the tree.

On receipt of an accessibility event, `AXPlatformWin` (our `IAccessible`
implementation) looks up the target `IAccessible` from the child ID
specified on the event using its `GetTargetFromChildID` method and
delegates the appropriate method call to that object.

So, why is this implemented on our `AXPlatformNodeDelegate` subclass and
not on `AXPlatformNodeWin` itself? Because the implementation of
`AXPlatformNode::GetUniqueId()` delegates this lookup to the node
delegate.

As background, `AXUniqueId` automatically assigns itself a
globally-unique value in its constructor; it tracks all used values in
an internal static pool.

Issue: https://github.com/flutter/flutter/issues/77838
2021-12-08 09:41:46 -08:00
Chris Yang
22693e2599 [ios platform view] fix overlay zPosition (flutter/engine#29930) 2021-12-07 16:04:01 -08:00
Chris Bracken
0189aaaca1 Win32: Implement DispatchAccessibilityAction (flutter/engine#30187)
Implements DispatchAccessibilityAction: a pass-through method that
forwards to the engine, which calls through the Embedder API back to the
framework.

Issue: https://github.com/flutter/flutter/issues/77838
2021-12-07 11:07:45 -08:00
Chris Bracken
334a0c6ff9 Use MallocMapping for DispatchSemanticsAction data (flutter/engine#30149)
In the Windows embedder, the data parameter of
FlutterWindowsEngine::DispatchSemanticsAction was a vector of bytes.
Here, we switch it to use MallocMapping since that is the type of the
data paramater on the DispatchAccessibilityAction method of
AccessibilityBridgeDelegate, which calls this method. This avoids an
extra type conversion.
2021-12-06 08:44:41 -08:00
eggfly
fdfdd6dccb Fix embedder_->EndFrame() not called in case of DrawLastLayerTree() (flutter/engine#29979) 2021-12-05 06:59:01 -08:00
Emmanuel Garcia
0849c0ecd7 Fix cast in FlutterView (flutter/engine#30106) 2021-12-03 15:54:01 -08:00
Jenn Magder
cb6cd0a3e8 Update IosUnitTests to use iPhone 11 simulator (flutter/engine#30090) 2021-12-03 10:49:02 -08:00
Emmanuel Garcia
cc8debdc54 Close image reader when the resource is unreachable (flutter/engine#30089) 2021-12-02 16:29:01 -08:00
Tong Mu
5d28d76321 [Windows keyboard] Remove redundant parameter FlutterWindowsView (flutter/engine#30086) 2021-12-02 15:39:01 -08:00
ColdPaleLight
299cf0138d Migrate sk_cf_obj to sk_cfp (flutter/engine#30029) 2021-12-02 13:29:01 -08:00
陈昱
30c4de0797 Make fragment leftover from an attach/detach race slightly safer (flutter/engine#29908) 2021-12-02 13:19:01 -08:00
David Worsham
c1e33b58a5 fuchsia: Add a SoftwareSurfaceProducer for debug (flutter/engine#29657) 2021-12-02 12:09:51 -08:00
Emircan Uysaler
d7a828ff3d [fuchsia] Change Touch response to YES (flutter/engine#30041) 2021-12-02 11:38:30 -08:00
Tong Mu
fdc78e4146 [Win32, keyboard] Fix dead key events that don't have the dead key mask (flutter/engine#30004)
This PR fixes flutter/flutter#92654, a rare case where dead key events are not properly handled.
2021-12-01 00:49:44 -08:00
Tong Mu
2626d453ff [macOS] MacOS Keyboard properly handles multi-char characters (flutter/engine#30005)
* Attempt

* Write my own decode

* Doc

* Format

* Fix comment and log

* Update FlutterEmbedderKeyResponder.mm
2021-12-01 00:49:19 -08:00
Emmanuel Garcia
f0d3d31b08 Use WindowInfoTracker.Companion.getOrCreate instead of the short version (flutter/engine#30012) 2021-11-30 17:24:01 -08:00
Filip Filmar
e769683b1d [fuchsia] Fix unset key and present key meaning (flutter/engine#29995) 2021-11-30 15:59:02 -08:00
gaaclarke
5b1174940a Removed the email warning about notifications entitlement (flutter/engine#29996) 2021-11-30 14:51:08 -08:00
Filip Filmar
e2dbdf16bd [fuchsia] Fixes the HID usage handling (flutter/engine#29815)
The old code stripped the USB hid usage page value from the Fuchsia
key.  It shouldn't be doing that.  This change fixes the issue,
and adds tests that rely on the key constants to verify that the
change indeed does what it is supposed to do.

In the process of fixing this, filed a few known issues and marked them
as TODO. These issues should be handled in separate PRs.

Fixes: https://github.com/flutter/flutter/issues/93890
2021-11-29 15:41:17 -08:00
Chris Bracken
22c822564d Win32: add test of native a11y tree nodes (flutter/engine#29993)
Adds AddSemanticsNodeUpdateWithChildren, which tests that the native
tree of IAccessible COM objects is an accurate representation of the
platform-agnostic accessibility tree.

Issue: https://github.com/flutter/flutter/issues/77838
2021-11-29 15:34:05 -08:00
Callum Moffat
8877397345 Remove iPadOS mouse pointer if no longer connected (flutter/engine#28319) 2021-11-29 14:47:01 -08:00
Chris Bracken
f8dfe2fab4 Win32 a11y bridge and platform node delegates (flutter/engine#29829)
* Win32 a11y bridge and platform node delegates

This is the third in a series of patches adding accessibility support
for the Windows embedder. This patch wires in the Accessibility bridge,
and lands the core structure of the Windows FlutterPlatformNodeDelegate
and AccessibilityBridgeDelegate classes, including:

* Instantiating the AccessibilityBridge when the semantics tree is
  enabled.
* Creating FlutterPlatformNodeDelegate wrappers for semantics tree
  nodes.
* Handling custom action updates.
* Building and updating the accessibility tree on semantics updates.
* Returning the native IAccessible objects when queried.

Breaking this out so that the follow-up patches can be reviewed and
landed in smaller, independent chunks.

Issue: https://github.com/flutter/flutter/issues/77838
Issue: https://github.com/flutter/flutter/issues/93928
2021-11-29 13:23:42 -08:00
Chris Bracken
5b6219cb49 [Win32] Use mock macro for UpdateSemanticsEnabled (flutter/engine#29976)
Previously, we'd mocked out UpdateSemanticsEnabled using a simple
lambda. Due to the embedder API's C ABI, we were unable to make use of
lambda captures. This patch instead uses MOCK_ENGINE_PROC so we can make
the test variable a local and rely on lambda capture.

Issue: https://github.com/flutter/flutter/issues/77838
2021-11-29 10:39:54 -08:00
eggfly
b87bbe9bc9 Fix typo and clean some includes (flutter/engine#29940) 2021-11-29 09:34:38 -08:00