<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>109028</bug_id>
          
          <creation_ts>2013-02-06 01:31:18 -0800</creation_ts>
          <short_desc>mac-wk2 test runner returns null for accessibilityController.accessibleElementById</short_desc>
          <delta_ts>2013-02-07 11:55:58 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Accessibility</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="James Craig">jcraig</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cfleizach</cc>
    
    <cc>jcraig</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>826208</commentid>
    <comment_count>0</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2013-02-06 01:31:18 -0800</bug_when>
    <thetext>mac-wk2 test runner returns null for accessibilityController.accessibleElementById

* REPRO
role-subrole-decription.html layout test runs as expected when run as webkit1.
  run-webkit-tests LayoutTests/platform/mac/accessibility/role-subrole-roledescription.html

  The test ran as expected. 

But when run as wk2 (run-layout-tests -2), it throws the following error:
$ run-webkit-tests -2 LayoutTests/platform/mac/accessibility/role-subrole-roledescription.html

  CONSOLE MESSAGE: line 299: TypeError: &apos;null&apos; is not an object (evaluating &apos;axElement.role&apos;)
  FAIL successfullyParsed should be true (of type boolean). Was undefined (of type undefined).

It appears to me that accessibilityController.accessibleElementById is not returning the right value.

Note: the referenced layout test is in a patch for: http://webkit.org/b/109027</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>826470</commentid>
    <comment_count>1</comment_count>
    <who name="chris fleizach">cfleizach</who>
    <bug_when>2013-02-06 08:23:17 -0800</bug_when>
    <thetext>I think your problem is that

PASS: div[role=rowgroup]
 923      AXRole: 
 924 

has no role, and in WK2, it returns a null object instead of an empty string</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>827761</commentid>
    <comment_count>2</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2013-02-07 11:47:52 -0800</bug_when>
    <thetext>Not quite. The axElement actually returns null, not just the properties on the object. Nevertheless, I can work around it like this to normalize the behavior between wk1 and wk2. 

        if (axElement) {
            role = axElement.role;
            subrole = axElement.subrole;
            roleDescription = axElement.roleDescription;
        } else {
            role = &apos;AXRole: &apos;;
            subrole = &apos;AXSubrole: &apos;;
            roleDescription = &apos;AXRoleDescription: &apos;;
        }

If you think that&apos;s expected behavior, it&apos;s okay to close this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>827762</commentid>
    <comment_count>3</comment_count>
    <who name="chris fleizach">cfleizach</who>
    <bug_when>2013-02-07 11:50:31 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; Not quite. The axElement actually returns null, not just the properties on the object. Nevertheless, I can work around it like this to normalize the behavior between wk1 and wk2. 
&gt; 
&gt;         if (axElement) {
&gt;             role = axElement.role;
&gt;             subrole = axElement.subrole;
&gt;             roleDescription = axElement.roleDescription;
&gt;         } else {
&gt;             role = &apos;AXRole: &apos;;
&gt;             subrole = &apos;AXSubrole: &apos;;
&gt;             roleDescription = &apos;AXRoleDescription: &apos;;
&gt;         }
&gt; 
&gt; If you think that&apos;s expected behavior, it&apos;s okay to close this bug.

Ah yes, because this is not an AX element in the hierarchy. In WK1, you&apos;ll get an empty ax element, on WK2 you&apos;ll get a null element.

We could leave this out of the test

or do a check like
if (axElement &amp;&amp; axElement.role)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>827769</commentid>
    <comment_count>4</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2013-02-07 11:55:58 -0800</bug_when>
    <thetext>Closing</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>