Bug 232755 - [GTK][a11y] Add implementation of document interface when building with ATSPI
Summary: [GTK][a11y] Add implementation of document interface when building with ATSPI
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on: 232749
Blocks: ATSPI 232782
  Show dependency treegraph
 
Reported: 2021-11-05 06:12 PDT by Carlos Garcia Campos
Modified: 2021-11-19 06:51 PST (History)
11 users (show)

See Also:


Attachments
Patch (19.95 KB, patch)
2021-11-05 06:17 PDT, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff
Patch (19.86 KB, patch)
2021-11-19 05:45 PST, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff
Patch (19.86 KB, patch)
2021-11-19 06:31 PST, Carlos Garcia Campos
aperez: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2021-11-05 06:12:56 PDT
Implement document
Comment 1 Carlos Garcia Campos 2021-11-05 06:17:29 PDT
Created attachment 443390 [details]
Patch

This won't apply because it depends on other bugs not fixed yet.
Comment 2 Carlos Garcia Campos 2021-11-19 05:45:40 PST
Created attachment 444809 [details]
Patch
Comment 3 Carlos Garcia Campos 2021-11-19 06:31:13 PST
Created attachment 444813 [details]
Patch
Comment 4 Adrian Perez 2021-11-19 06:42:01 PST
Comment on attachment 444813 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=444813&action=review

> Source/WebCore/accessibility/atspi/AccessibilityObjectDocumentAtspi.cpp:112
> +            return map;

I would first check m_coreObject and do the early return, after that we know
that it will not be null and avoid checking it again. I am thinking of this:

  if (!m_coreObject)
      return map;

  m_coreObject->updateBackingStore();
  auto* document = m_coreObject->document();
  // ...rest of the code as it was...

> Source/WebCore/accessibility/atspi/AccessibilityObjectDocumentAtspi.cpp:148
> +            return { };

Same here, there are two null-checks on m_coreObject one right after the other.
Comment 5 Carlos Garcia Campos 2021-11-19 06:46:20 PST
Comment on attachment 444813 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=444813&action=review

>> Source/WebCore/accessibility/atspi/AccessibilityObjectDocumentAtspi.cpp:112
>> +            return map;
> 
> I would first check m_coreObject and do the early return, after that we know
> that it will not be null and avoid checking it again. I am thinking of this:
> 
>   if (!m_coreObject)
>       return map;
> 
>   m_coreObject->updateBackingStore();
>   auto* document = m_coreObject->document();
>   // ...rest of the code as it was...

This is because updateBackingStore can make m_coreObject nullptr.

>> Source/WebCore/accessibility/atspi/AccessibilityObjectDocumentAtspi.cpp:148
>> +            return { };
> 
> Same here, there are two null-checks on m_coreObject one right after the other.

Same here, the pattern is repeated everywhere.
Comment 6 Adrian Perez 2021-11-19 06:49:46 PST
(In reply to Carlos Garcia Campos from comment #5)
> Comment on attachment 444813 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=444813&action=review
> 
> >> Source/WebCore/accessibility/atspi/AccessibilityObjectDocumentAtspi.cpp:112
> >> +            return map;
> > 
> > I would first check m_coreObject and do the early return, after that we know
> > that it will not be null and avoid checking it again. I am thinking of this:
> > 
> >   if (!m_coreObject)
> >       return map;
> > 
> >   m_coreObject->updateBackingStore();
> >   auto* document = m_coreObject->document();
> >   // ...rest of the code as it was...
> 
> This is because updateBackingStore can make m_coreObject nullptr.
> 
> >> Source/WebCore/accessibility/atspi/AccessibilityObjectDocumentAtspi.cpp:148
> >> +            return { };
> > 
> > Same here, there are two null-checks on m_coreObject one right after the other.
> 
> Same here, the pattern is repeated everywhere.

Right. Thanks for commenting on this :-)
Comment 7 Carlos Garcia Campos 2021-11-19 06:51:21 PST
Committed r286059 (244446@main): <https://commits.webkit.org/244446@main>