WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
255076
Add PaintPhase::Accessibility and AccessibilityRegionContext to enable AX element bounding-box caching
https://bugs.webkit.org/show_bug.cgi?id=255076
Summary
Add PaintPhase::Accessibility and AccessibilityRegionContext to enable AX ele...
Tyler Wilcock
Reported
2023-04-05 21:54:54 PDT
Accessibility needs to cache the bounding box of non-accessibility-is-ignored elements on the secondary AX thread. We can use paint to get this geometry.
Attachments
Patch
(100.26 KB, patch)
2023-04-05 22:34 PDT
,
Tyler Wilcock
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(101.73 KB, patch)
2023-04-05 23:26 PDT
,
Tyler Wilcock
no flags
Details
Formatted Diff
Diff
Patch
(102.57 KB, patch)
2023-04-05 23:56 PDT
,
Tyler Wilcock
no flags
Details
Formatted Diff
Diff
Patch
(104.17 KB, patch)
2023-04-17 01:00 PDT
,
Tyler Wilcock
no flags
Details
Formatted Diff
Diff
Patch
(101.36 KB, patch)
2023-04-27 00:32 PDT
,
Tyler Wilcock
no flags
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2023-04-05 21:56:10 PDT
<
rdar://problem/107694492
>
Tyler Wilcock
Comment 2
2023-04-05 22:34:15 PDT
Created
attachment 465792
[details]
Patch
Tyler Wilcock
Comment 3
2023-04-05 23:26:50 PDT
Created
attachment 465793
[details]
Patch
Tyler Wilcock
Comment 4
2023-04-05 23:56:58 PDT
Created
attachment 465795
[details]
Patch
Simon Fraser (smfr)
Comment 5
2023-04-13 17:27:43 PDT
Comment on
attachment 465795
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=465795&action=review
The approach is good. Let’s get the naming right.
> Source/WebCore/page/LocalFrameView.cpp:4686 > + traverseForPaintInvalidation(NullGraphicsContext::PaintInvalidationReasons::InvalidatingAccessibilityObjectRects, &accessibilityPaintContext);
There’s a naming conflict here, and I think you’ve adopted the “invalidating” term too literally. This isn’t a “invalidate the accessibility rects” paint pass, it’s a “generate the accessibility rects”. So calling “traverseForPaintInvalidation” doesn’t make sense here, suggesting we rename “traverseForPaintInvalidation()” to something like “traverseForUtilityPaint”. PaintInvalidationReasons should also be renamed. “Utility paint” is not a great name. We should think of a better one.
> Source/WebCore/rendering/PaintContext.h:36 > +class PaintContext : public CanMakeCheckedPtr {
This would be a UtilityPaintContext or something (it’s explicitly *not* a paint context).
> Source/WebCore/rendering/RenderLayer.cpp:3176 > + bool isCollectingAccessibilityRects = context.invalidatingAccessibilityObjectRects();
This is where the mis-naming is obvious.
Simon Fraser (smfr)
Comment 6
2023-04-13 19:05:36 PDT
I see that the callers of LocalFrameView::traverseForPaintInvalidation() are LocalFrameView::invalidateControlTints() and LocalFrameView::invalidateImagesWithAsyncDecodes(). The non-invalidation one is ContentfulPaintChecker, which just calls paint() directly: NullGraphicsContext checkerContext(NullGraphicsContext::PaintInvalidationReasons::DetectingContentfulPaint); frameView.paint(checkerContext, frameView.renderView()->documentRect()); Maybe that’s the way to go for accessibility rects.
Tyler Wilcock
Comment 7
2023-04-17 01:00:11 PDT
Created
attachment 465945
[details]
Patch
Tyler Wilcock
Comment 8
2023-04-17 01:03:21 PDT
> The non-invalidation one is ContentfulPaintChecker, which just calls paint() > directly: > > NullGraphicsContext > checkerContext(NullGraphicsContext::PaintInvalidationReasons:: > DetectingContentfulPaint); > frameView.paint(checkerContext, frameView.renderView()->documentRect()); > > Maybe that’s the way to go for accessibility rects.
Thanks, implemented this. As far as the name for what is currently called "PaintContext". There are two consumers of this context — event regions and accessibility. And both do very similar things: use the paint traversal to get final geometry for use in a non-directly-graphical way. So maybe this type of paint is a "geometry traversal paint", making this a GeometryTraversalContext? Thoughts or other ideas? Latest patch uses GeometryTraversalContext in case seeing the name in context helps — happy to change further if needed.
chris fleizach
Comment 9
2023-04-26 11:01:47 PDT
(In reply to Tyler Wilcock from
comment #8
)
> > The non-invalidation one is ContentfulPaintChecker, which just calls paint() > > directly: > > > > NullGraphicsContext > > checkerContext(NullGraphicsContext::PaintInvalidationReasons:: > > DetectingContentfulPaint); > > frameView.paint(checkerContext, frameView.renderView()->documentRect()); > > > > Maybe that’s the way to go for accessibility rects. > Thanks, implemented this. > > As far as the name for what is currently called "PaintContext". There are > two consumers of this context — event regions and accessibility. And both do > very similar things: use the paint traversal to get final geometry for use > in a non-directly-graphical way. > > So maybe this type of paint is a "geometry traversal paint", making this a > GeometryTraversalContext? > > Thoughts or other ideas? > > Latest patch uses GeometryTraversalContext in case seeing the name in > context helps — happy to change further if needed.
Wonder if a better name would be RegionContext, which then can be either the existing EventRegionContext object or a new AccessibilityRegionContext.
Tyler Wilcock
Comment 10
2023-04-27 00:32:48 PDT
Created
attachment 466114
[details]
Patch
Tyler Wilcock
Comment 11
2023-04-27 15:23:00 PDT
(In reply to chris fleizach from
comment #9
)
> (In reply to Tyler Wilcock from
comment #8
) > > > The non-invalidation one is ContentfulPaintChecker, which just calls paint() > > > directly: > > > > > > NullGraphicsContext > > > checkerContext(NullGraphicsContext::PaintInvalidationReasons:: > > > DetectingContentfulPaint); > > > frameView.paint(checkerContext, frameView.renderView()->documentRect()); > > > > > > Maybe that’s the way to go for accessibility rects. > > Thanks, implemented this. > > > > As far as the name for what is currently called "PaintContext". There are > > two consumers of this context — event regions and accessibility. And both do > > very similar things: use the paint traversal to get final geometry for use > > in a non-directly-graphical way. > > > > So maybe this type of paint is a "geometry traversal paint", making this a > > GeometryTraversalContext? > > > > Thoughts or other ideas? > > > > Latest patch uses GeometryTraversalContext in case seeing the name in > > context helps — happy to change further if needed. > > Wonder if a better name would be > > RegionContext, > > which then can be either the existing EventRegionContext object or a new > AccessibilityRegionContext.
OK, made this change, so should be ready to review again.
chris fleizach
Comment 12
2023-04-27 15:39:27 PDT
(In reply to Tyler Wilcock from
comment #11
)
> (In reply to chris fleizach from
comment #9
) > > (In reply to Tyler Wilcock from
comment #8
) > > > > The non-invalidation one is ContentfulPaintChecker, which just calls paint() > > > > directly: > > > > > > > > NullGraphicsContext > > > > checkerContext(NullGraphicsContext::PaintInvalidationReasons:: > > > > DetectingContentfulPaint); > > > > frameView.paint(checkerContext, frameView.renderView()->documentRect()); > > > > > > > > Maybe that’s the way to go for accessibility rects. > > > Thanks, implemented this. > > > > > > As far as the name for what is currently called "PaintContext". There are > > > two consumers of this context — event regions and accessibility. And both do > > > very similar things: use the paint traversal to get final geometry for use > > > in a non-directly-graphical way. > > > > > > So maybe this type of paint is a "geometry traversal paint", making this a > > > GeometryTraversalContext? > > > > > > Thoughts or other ideas? > > > > > > Latest patch uses GeometryTraversalContext in case seeing the name in > > > context helps — happy to change further if needed. > > > > Wonder if a better name would be > > > > RegionContext, > > > > which then can be either the existing EventRegionContext object or a new > > AccessibilityRegionContext. > OK, made this change, so should be ready to review again.
Looks pretty good to me
EWS
Comment 13
2023-04-28 01:02:43 PDT
Committed
263493@main
(6fa5a22eeca9): <
https://commits.webkit.org/263493@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 466114
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug