Bug 112857 - AXObjectCache::postNotification should use an enum instead of a bool
Summary: AXObjectCache::postNotification should use an enum instead of a bool
Status: RESOLVED DUPLICATE of bug 121504
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-20 16:49 PDT by Eric Seidel (no email)
Modified: 2013-09-26 11:22 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2013-03-20 16:49:31 PDT
AXObjectCache::postNotification should use an enum instead of a bool (since it's a multi-argument function)

I'm slowly trying to rid WebKit of this pattern, as it leads to very difficult to understand callsites:
    axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, true);

At least:
    axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, PostToElement);

would be clearer.  Although it's not yet clear to me what the "postToElement" bool is supposed to do. :)

Once I figure out what postToElement means, I can come up with nice names for a replacement enum.  Any suggestions would be most welcome. :)
Comment 1 Samuel White 2013-09-26 11:22:28 PDT
(In reply to comment #0)
> AXObjectCache::postNotification should use an enum instead of a bool (since it's a multi-argument function)
> 
> I'm slowly trying to rid WebKit of this pattern, as it leads to very difficult to understand callsites:
>     axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, true);
> 
> At least:
>     axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, PostToElement);
> 
> would be clearer.  Although it's not yet clear to me what the "postToElement" bool is supposed to do. :)
> 
> Once I figure out what postToElement means, I can come up with nice names for a replacement enum.  Any suggestions would be most welcome. :)

I was given this same feedback (we should not use a bool) in response to another patch that I landed. I fixed this issue under:

https://bugs.webkit.org/show_bug.cgi?id=121504

before I saw this bug. Apologies.

Marking as dupe, but note that this bug was filed first. Not sure if there's a better way to indicate that. Thanks!

*** This bug has been marked as a duplicate of bug 121504 ***