Bug 26297 - Faulty logic in AccessibilityRenderObject::isSelected
Summary: Faulty logic in AccessibilityRenderObject::isSelected
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2009-06-10 13:45 PDT by Xan Lopez
Modified: 2014-02-19 09:28 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xan Lopez 2009-06-10 13:45:22 PDT
Code is:

bool AccessibilityRenderObject::isSelected() const
{
    if (!m_renderer)
        return false;
    
    Node* node = m_renderer->node();
    if (!node)
        return false;
    
    return false;
}

I'm not sure if the last 'false' was meant to be 'true', but in any case it seems to me the function can't be right. My naive implementation of this would be to get the VisibleSelection and check if isNone() is true, but I'm sure there's better ways of doing it.
Comment 1 chris fleizach 2009-06-12 23:51:58 PDT
i think the last false is OK, since we don't want to return true for default for isSelected

there's obviously something missing though that should return true for some state. 

This isSelected does not correspond to the selection (at least on the mac... that's represented by AXSelectedTextRange). it's used more in the context of a multi-select list where one of the list items is selected (i'm pretty sure that AccessibilityListBoxOption overrides this method)

So while this code does not necessarily look correct, I'm not sure what elements WebKit does want to return true for isSelected... if we identify those elements and their states, we would want to change that
Comment 2 James Craig 2013-09-30 12:05:29 PDT
<rdar://problem/15113521>
Comment 3 chris fleizach 2014-02-19 09:28:44 PST
isSelected() is not meant to be the TextSelection. It's for things like aria-selected=true