-
Notifications
You must be signed in to change notification settings - Fork 6k
Apply local patch to chromium accessibility code #23110
Conversation
|
Trying to orient myself to this a bit - are there ways we could make this patch smaller and still have the same functionality? For example, there's a large number of lines related to removing the Is this something where we could just generate the files and check them in, or just add a namespace somewhere, or just create a new file with the expected members in the expected namespace? I think that would make this patch easier to review, and make it a little more possible to compare this code to upstream as we go forward. |
|
There seems to be a lot of cosmetic changes in this which I'm not sure are necessary. For example, changing the header guards and namespaces. Is there a functional reason for these changes, or are they purely cosmetic? |
|
@gw280 They are purely cosmetic. I feel keeping the ui namespace may be confusing because this does not related to ui. Same thing for mojom namespace. are we ok with keeping the same namespace? Alternatively I can put up PR that is purely just namespace changes before this PR |
|
My vote would be to leave the namespaces as-is. The additional code churn will make it more difficult to cherry-pick changes from upstream. |
ci/licenses.sh
Outdated
| local actualLicenseCount | ||
| actualLicenseCount="$(tail -n 1 flutter/ci/licenses_golden/licenses_flutter | tr -dc '0-9')" | ||
| local expectedLicenseCount=15 # When changing this number: Update the error message below as well describing all expected license types. | ||
| local expectedLicenseCount=12 # When changing this number: Update the error message below as well describing all expected license types. |
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.
Is this simply a function of removing unused files?
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 what you mean by removing unused files. This make sure the license count does not change unexpectedly
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.
My assumption is that this is that changes made in thsi patch are reducing the number of licenses we're including, so we're lowering this number.
Is that accurate? We've simply deleted files with different copyright years or whatever, so we no longer have as many?
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.
that is correct
|
Reverted namespace header guard changes. ready for review |
| std::to_string(static_cast<int>(round(bounds.y()))) + ")-(" + | ||
| std::to_string(static_cast<int>(round(bounds.width()))) + ", " + | ||
| std::to_string(static_cast<int>(round(bounds.height()))) + ")"; | ||
| // result += " transform=" + transform->ToString(); |
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.
Remove commented out code.
| @@ -2,26 +2,24 @@ | |||
| // Use of this source code is governed by a BSD-style license that can be | |||
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 have to completely rewrite this file because the upstream ax_platform_node_mac.mm is still WIP is not feature complete
| // Please make sure that this ScopedObserver is always declared last in order | ||
| // to prevent any use-after-free. | ||
| ScopedObserver<AXTree, AXTreeObserver> tree_event_observer_{this}; | ||
| // ScopedObserver<AXTree, AXTreeObserver> tree_event_observer_{this}; |
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.
nit: should this be removed?
| imploded << tokens[i] << " | "; | ||
| } | ||
| } | ||
| return imploded.str(); |
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.
probably best to spin this out into a separate function
|
|
||
| class AXTableInfo; | ||
| struct AXLanguageInfo; | ||
| // struct AXLanguageInfo; |
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.
nit: remove
| // | ||
| // Returns nullptr if the node has no language info. | ||
| AXLanguageInfo* GetLanguageInfo() const; | ||
| // AXLanguageInfo* GetLanguageInfo() const; |
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.
nit: remove
| // This should only be called by LabelLanguageForSubtree and is used as part | ||
| // of the language detection feature. | ||
| void SetLanguageInfo(std::unique_ptr<AXLanguageInfo> lang_info); | ||
| // void SetLanguageInfo(std::unique_ptr<AXLanguageInfo> lang_info); |
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.
nit: remove
| return "kToken"; | ||
| } | ||
|
|
||
| NOTREACHED(); |
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.
FML_UNREACHABLE()
| const AXTreeID& ax_tree_id) { | ||
| auto it = frame_to_ax_tree_id_map_.find(frame_id); | ||
| if (it != frame_to_ax_tree_id_map_.end()) { | ||
| NOTREACHED(); |
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.
FML_UNREACHABLE()
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 I didn't realize we have that, thanks for reminding
|
|
||
| NOTREACHED() |
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.
FML_UNREACHABLE()
| @@ -1640,32 +1607,32 @@ int AXPlatformNodeBase::GetHypertextOffsetFromEndpoint( | |||
| if (endpoint_index_in_common_parent > index_in_common_parent) | |||
| return static_cast<int32_t>(GetHypertext().size()); | |||
|
|
|||
| NOTREACHED(); | |||
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.
FML_UNREACHABLE()
| } | ||
|
|
||
| NOTREACHED(); |
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.
FML_UNREACHABLE()
chinmaygarde
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.
This library is going to be used by embedder implementations and is not part of the core engine (vended via the Embedder API in //flutter/platform/embedder). Because of this, it cannot depend on internal engine libraries. Neither FML nor Skia is used today by embedder only libraries.
third_party/accessibility/build.gn
Outdated
| } | ||
|
|
||
| public_deps = [ | ||
| "//flutter/fml", |
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.
FML and Skia are engine internal libraries and may not be used by embedder implementations (or their dependencies).
| deps = [ | ||
| ":accessibility", | ||
| ":accessibility_fixtures", | ||
| "//flutter/testing", |
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 is also an internal engine dependency.
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.
For unit test only target, do we need to worry about this?
|
@chinmaygarde I am not familiar with the internal library dependency. I thought the embedder library also uses FML library? |
|
The public Embedder API is a single C header with no internal engine dependencies (see |
b4f4ae9 to
a6b08b6
Compare
| @@ -1,608 +1,134 @@ | |||
| // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |||
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 have to completely rewrite this class because the chromium uses skia to implement this class.
|
@chinmaygarde @dnfield @gw280 |
|
A lot of the |
the two examples are base::Optional and base::string16. I have thought about this and I am a bit lean toward just replace them instead of
That being said, those are not strong arguments. I am willing to change it if there are other good reason to do so |
|
That's reasonable. If it's just those two then let's just leave it. |
dnfield
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.
I did not review every line of this patch, but RSLGTM.
I think @chinmaygarde 's concerns have been addressed.
| DOCUMENT_SELECTION_CHANGED, | ||
| DOCUMENT_TITLE_CHANGED, | ||
| DROPEFFECT_CHANGED, | ||
| // TODO(nektar): Deprecate this event and replace it with |
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.
are these changes which have been pulled in from upstream? if so, is there a way we can separate those out as we can probably avoid reviewing them.
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 reverted these change for now
|
Sorry to be clear, I was mostly just curious where changes like that came from, rather than holding this up for merging. If Dan's ok with it, them it LGTM. |
|
Since it won't affect the code and we can always pull it back if we need it in the future. The revert does make this pr less complex, i will continue merging with the revert. |
|
This pull request is not suitable for automatic merging in its current state.
|
Description
This PR rewire the dependency of these chromium code to be able to compile under the flutter.
Related Issues
flutter/flutter#23601
Tests
I added the following tests:
all the unittests are built and run in ci
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.Reviewer Checklist
Breaking Change
Did any tests fail when you ran them? Please read handling breaking changes.