RESOLVED FIXED 224280
Accessibility support for image text recognition.
https://bugs.webkit.org/show_bug.cgi?id=224280
Summary Accessibility support for image text recognition.
Andres Gonzalez
Reported 2021-04-07 08:19:47 PDT
Preliminary accessibility work to support image text extraction.
Attachments
Patch (deleted)
2021-04-07 08:25 PDT, Andres Gonzalez
ews-feeder: commit-queue-
Patch (deleted)
2021-04-07 08:58 PDT, Andres Gonzalez
no flags
Patch (14.84 KB, patch)
2021-04-12 08:56 PDT, Andres Gonzalez
no flags
Patch (24.63 KB, patch)
2021-04-15 08:11 PDT, Andres Gonzalez
no flags
Patch (29.70 KB, patch)
2021-04-15 15:55 PDT, Andres Gonzalez
no flags
Patch (34.03 KB, patch)
2021-04-15 18:56 PDT, Andres Gonzalez
no flags
Patch (42.77 KB, patch)
2021-05-19 13:04 PDT, Andres Gonzalez
no flags
Patch (38.22 KB, patch)
2021-06-17 16:53 PDT, Andres Gonzalez
no flags
Patch (37.37 KB, patch)
2021-06-18 06:54 PDT, Andres Gonzalez
ews-feeder: commit-queue-
Patch (37.46 KB, patch)
2021-06-18 07:32 PDT, Andres Gonzalez
no flags
Patch (37.63 KB, patch)
2021-06-21 08:22 PDT, Andres Gonzalez
no flags
Patch (37.62 KB, patch)
2021-06-21 10:54 PDT, Andres Gonzalez
no flags
Patch (38.33 KB, patch)
2021-06-22 11:40 PDT, Andres Gonzalez
no flags
Patch (39.00 KB, patch)
2021-06-23 08:28 PDT, Andres Gonzalez
no flags
Radar WebKit Bug Importer
Comment 1 2021-04-07 08:19:56 PDT
Andres Gonzalez
Comment 2 2021-04-07 08:25:30 PDT
Andres Gonzalez
Comment 3 2021-04-07 08:58:08 PDT
David Kilzer (:ddkilzer)
Comment 4 2021-04-07 09:21:25 PDT
The content of attachment 425396 [details] has been deleted
David Kilzer (:ddkilzer)
Comment 5 2021-04-09 09:34:08 PDT
The content of attachment 425405 [details] has been deleted
Andres Gonzalez
Comment 6 2021-04-12 08:56:11 PDT
chris fleizach
Comment 7 2021-04-12 09:14:24 PDT
Comment on attachment 425752 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=425752&action=review > Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h:469 > + bool isAXImageInstance() const override; we should probably call this isAccessibilityImageInstance() to match the other methods
Andres Gonzalez
Comment 8 2021-04-12 09:35:26 PDT
(In reply to chris fleizach from comment #7) > Comment on attachment 425752 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=425752&action=review > > > Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h:469 > > + bool isAXImageInstance() const override; > > we should probably call this > > isAccessibilityImageInstance() to match the other methods I was following the convention isClassNameInstance, and the class name AXImage, similar to isAXIsolatedObjectInstance. I very much prefer the AX prefix for class names instead of the whole Accessibility, and plan to do a gradual renaming. But I can be persuaded if you feel strongly otherwise.
Andres Gonzalez
Comment 9 2021-04-15 08:11:56 PDT
Andres Gonzalez
Comment 10 2021-04-15 15:55:38 PDT
Sam Weinig
Comment 11 2021-04-15 17:00:07 PDT
Comment on attachment 426147 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=426147&action=review > Source/WebCore/ChangeLog:3 > + Preliminary accessibility work Please provide a more clear title. > Source/WebCore/ChangeLog:8 > + No new tests (OOPS!). Please include the reason no tests are being included.
Andres Gonzalez
Comment 12 2021-04-15 18:56:16 PDT
chris fleizach
Comment 13 2021-04-15 22:58:59 PDT
Comment on attachment 426170 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=426170&action=review > Source/WebCore/accessibility/AXImage.cpp:62 > + if (m_imageOverlayHost) should this be !m_imageoverlayHost? and second, do we want to return an empty array here in that case? > Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:436 > +- (NSArray *)accessibilityElements > +{ I don't think we should add this. this is actually more expensive, because to just know how many children there are, we have to create the NSArray and return it, rather than just returning the size of the array in elementCount I also think that if we find that axElementAtIndex and friends are implemented we prefer that over accessibilityElements. > Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:1863 > + auto imageOverlayElements = self.axBackingObject->imageOverlayElements(); I feel like if the count is empty here, we should return nil. it will be a more efficient operation to return nil (which will be the common case( > Source/WebCore/platform/Logging.cpp:93 > + LogAccessibility.state = WTFLogChannelState::On; this should probably be off right > LayoutTests/ChangeLog:8 > + * accessibility/image-link-expected.txt: we'll probably need to skip these on the non supported platforms
Andres Gonzalez
Comment 14 2021-05-19 13:04:09 PDT
Andres Gonzalez
Comment 15 2021-05-19 13:25:21 PDT
(In reply to chris fleizach from comment #13) > Comment on attachment 426170 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=426170&action=review > > > Source/WebCore/accessibility/AXImage.cpp:62 > > + if (m_imageOverlayHost) > > should this be !m_imageoverlayHost? > and second, do we want to return an empty array here in that case? The purpose of the block should be clearer in this revision. The return value of the function is now an Optional. > > > Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:436 > > +- (NSArray *)accessibilityElements > > +{ > > I don't think we should add this. this is actually more expensive, because > to just know how many children there are, we have to create the NSArray and > return it, rather than just returning the size of the array in elementCount > > I also think that if we find that axElementAtIndex and friends are > implemented we prefer that over accessibilityElements. I removed the comment saying that this is preferable. I'd like to keep the method if possible cause it makes writing scripts clearer. As for what is more efficient, I'm not convinced that neither one is preferable. I believe the critical path is in retrieving the CoreObject children, and in the by index methods that has to happen multiple times to just iterate over the array. In any case, this is not taking away the by index/count methods. > > > Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:1863 > > + auto imageOverlayElements = self.axBackingObject->imageOverlayElements(); > > I feel like if the count is empty here, we should return nil. it will be a > more efficient operation to return nil (which will be the common case( Fixed with imageOverlayElements() returning an Optional. > > > Source/WebCore/platform/Logging.cpp:93 > > + LogAccessibility.state = WTFLogChannelState::On; > > this should probably be off right Yes. > > > LayoutTests/ChangeLog:8 > > + * accessibility/image-link-expected.txt: > > we'll probably need to skip these on the non supported platforms Yes.
chris fleizach
Comment 16 2021-05-19 15:50:29 PDT
Comment on attachment 429088 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=429088&action=review > Source/WebCore/accessibility/AXImage.cpp:68 > + auto* axImage = axObjectCache->getOrCreate(m_imageOverlayHost.get()); this can be done in one line > Source/WebCore/accessibility/AXImage.cpp:79 > + WTFLogAlways("aqui estoy %p %p", this, imageOverlayHost.get()); remove this log > Source/WebCore/accessibility/AXImage.cpp:82 > + // FIXME: post notification. what notification do we need here? > Source/WebCore/accessibility/AXImage.cpp:86 > + return children(); // FIXME: once notification is added, this should be return WTF::nullopt; we need to return the image overlay again right? > Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:433 > +- (NSArray *)accessibilityElements is this necessary to implement? isn't this handled by accessibilityElementAtIndex? > Source/WebCore/platform/Logging.cpp:93 > + LogAccessibility.state = WTFLogChannelState::On; undo > Source/WebKit/UIProcess/ios/PageClientImplIOS.mm:471 > + WTFLogAlways("PageClientImpl::requestImageExtraction {"); probably remove these logs in this method > Source/WebKit/WebProcess/WebPage/WebPage.cpp:7348 > + WTFLogAlways("WebPage::requestImageExtraction {"); remove logging
Andres Gonzalez
Comment 17 2021-06-17 16:53:46 PDT
Andres Gonzalez
Comment 18 2021-06-18 06:54:09 PDT
Created attachment 431774 [details] Patch Rebasing on master.
Andres Gonzalez
Comment 19 2021-06-18 07:32:03 PDT
Created attachment 431776 [details] Patch Build fix for non-Cocoa platforms.
Andres Gonzalez
Comment 20 2021-06-21 08:22:51 PDT
Andres Gonzalez
Comment 21 2021-06-21 10:54:56 PDT
Created attachment 431878 [details] Patch Fixes accessibility/image-link.html since imageOverlayElements returns nil instead of a 0-element array.
Andres Gonzalez
Comment 22 2021-06-22 11:40:37 PDT
Created attachment 431982 [details] Patch Uses new format for internals.installImageOverlay.
Andres Gonzalez
Comment 23 2021-06-23 08:28:30 PDT
Created attachment 432045 [details] Patch Skip test on iOS 14.
EWS
Comment 24 2021-06-23 09:59:41 PDT
Committed r279171 (239068@main): <https://commits.webkit.org/239068@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 432045 [details].
Note You need to log in before you can comment on or make changes to this bug.