<?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>129643</bug_id>
          
          <creation_ts>2014-03-03 17:00:15 -0800</creation_ts>
          <short_desc>AX: Refactor code in WKAccessibilityWebPageObjectMac to use existing viewToScreenMethods</short_desc>
          <delta_ts>2014-03-03 17:01:00 -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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="chris fleizach">cfleizach</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>986592</commentid>
    <comment_count>0</comment_count>
    <who name="chris fleizach">cfleizach</who>
    <bug_when>2014-03-03 17:00:15 -0800</bug_when>
    <thetext>There&apos;s a bunch of code in the hit-testing that could probably be reduced by moving to a viewToScreen method

//#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
- (id)accessibilityHitTest:(NSPoint)point
{
    // Hit-test point comes in as bottom-screen coordinates. Needs to be normalized to the frame of the web page.
    NSPoint remotePosition = [[self accessibilityAttributeValue:NSAccessibilityPositionAttribute] pointValue];
    NSSize remoteSize = [[self accessibilityAttributeValue:NSAccessibilitySizeAttribute] sizeValue];
    
    // Get the y position of the WKView (we have to screen-flip and go from bottom left to top left).
    CGFloat screenHeight = [(NSScreen *)[[NSScreen screens] objectAtIndex:0] frame].size.height;
    remotePosition.y = (screenHeight - remotePosition.y) - remoteSize.height;
    
    point.y = screenHeight - point.y;
    
    // Re-center point into the web page&apos;s frame.
    point.y -= remotePosition.y;
    point.x -= remotePosition.x;
    
    WebCore::FrameView* frameView = m_page ? m_page-&gt;mainFrameView() : 0;
    if (frameView) {
        point.y += frameView-&gt;scrollPosition().y();
        point.x += frameView-&gt;scrollPosition().x();
    }
    
    return [[self accessibilityRootObjectWrapper] accessibilityHitTest:point];
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>986594</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2014-03-03 17:01:00 -0800</bug_when>
    <thetext>&lt;rdar://problem/16217817&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>