<?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>73433</bug_id>
          
          <creation_ts>2011-11-30 04:59:19 -0800</creation_ts>
          <short_desc>[Gtk][WK2] atk_text_get_text_at_offset() fails to provide the correct line for text which is wrapped</short_desc>
          <delta_ts>2013-09-11 04:05:30 -0700</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>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Gtk</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>114872</dependson>
          <blocked>72588</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Joanmarie Diggs">jdiggs</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>mario</cc>
    
    <cc>mrobinson</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>511644</commentid>
    <comment_count>0</comment_count>
      <attachid>117169</attachid>
    <who name="Joanmarie Diggs">jdiggs</who>
    <bug_when>2011-11-30 04:59:19 -0800</bug_when>
    <thetext>Created attachment 117169
test case

Created an attachment (id=117170)
test script

Steps to reproduce:

1. View the attached test case in WK2
2. Resize the window so that the text wraps
3. Enable caret browsing
4. Launch the attached test script in a terminal
5. Arrow Up and Down amongst the lines of text

Expected results: The test script would always print the correct text for the current line.

Actual results: The test script always prints the entire text for the current object, rather than just the current line.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>872914</commentid>
    <comment_count>1</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2013-04-10 09:56:43 -0700</bug_when>
    <thetext>The problem, that only happens in WebKit2GTK+, seems to be related with this function:

  static PangoLayout* getPangoLayoutForAtk(AtkText* textObject)
  {
    AccessibilityObject* coreObject = core(textObject);

    Document* document = coreObject-&gt;document();
    if (!document)
        return 0;

    HostWindow* hostWindow = document-&gt;view()-&gt;hostWindow();
    if (!hostWindow)
        return 0;
    PlatformPageClient webView = hostWindow-&gt;platformPageClient();
    if (!webView)
        return 0;

    // Create a string with the layout as it appears on the screen
    PangoLayout* layout = gtk_widget_create_pango_layout(static_cast&lt;GtkWidget*&gt;(webView), textForObject(coreObject));
    return layout;
  }

As in WebKit2 this code is run from the WebProcess, webview there will be NULL, meaning that the PangoLayout returned here won&apos;t be associated to any widget as in the case of WebKit1, hence there&apos;s no way from GailUtil/Pango&apos;s perspective to realize whether the text is wrapped or not, and it will just see all the text in the paragraph as a whole.

So, I think that either we find a way to create a proper PangoLayout reflecting as well as possible the reality in the UI process or we just find a way to get the same result without using GailUtil + Pango at all, which is probably the best idea since we wanted to get rid of this APIs anyway, I think, and this might be a good reason to speed that up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>872928</commentid>
    <comment_count>2</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2013-04-10 10:20:22 -0700</bug_when>
    <thetext>(In reply to comment #1)

&gt; So, I think that either we find a way to create a proper PangoLayout reflecting as well as possible the reality in the UI process or we just find a way to get the same result without using GailUtil + Pango at all, which is probably the best idea since we wanted to get rid of this APIs anyway, I think, and this might be a good reason to speed that up.

Getting rid of the pango dependency here is a step in the right direction, I think. The accessibility code shouldn&apos;t depend on a GtkWidget.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>873645</commentid>
    <comment_count>3</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2013-04-11 02:36:07 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt;[...]
&gt; Getting rid of the pango dependency here is a step in the right direction,
&gt; I think. The accessibility code shouldn&apos;t depend on a GtkWidget.

Yes, I already started making some local experiments to explore that approach. Hope I&apos;ll manage to get something useful soon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>883885</commentid>
    <comment_count>4</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2013-05-02 12:22:00 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; (In reply to comment #1)
&gt; 
&gt; &gt; So, I think that either we find a way to create a proper PangoLayout reflecting as well as possible the reality in the UI process or we just find a way to get the same result without using GailUtil + Pango at all, which is probably the best idea since we wanted to get rid of this APIs anyway, I think, and this might be a good reason to speed that up.
&gt; 
&gt; Getting rid of the pango dependency here is a step in the right direction, I think. The accessibility code shouldn&apos;t depend on a GtkWidget.

Just realized I forgot to paste here the link to the metabug I filed to keep track of the efforts to remove pango dependency from a11y code:

https://bugs.webkit.org/show_bug.cgi?id=114867</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>908943</commentid>
    <comment_count>5</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2013-07-16 10:13:13 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #2)
&gt; &gt; (In reply to comment #1)
&gt; &gt; 
&gt; &gt; &gt; So, I think that either we find a way to create a proper PangoLayout reflecting as well as possible the reality in the UI process or we just find a way to get the same result without using GailUtil + Pango at all, which is probably the best idea since we wanted to get rid of this APIs anyway, I think, and this might be a good reason to speed that up.
&gt; &gt; 
&gt; &gt; Getting rid of the pango dependency here is a step in the right direction, I think. The accessibility code shouldn&apos;t depend on a GtkWidget.
&gt; 
&gt; Just realized I forgot to paste here the link to the metabug I filed to keep track of the efforts to remove pango dependency from a11y code:
&gt; 
&gt; https://bugs.webkit.org/show_bug.cgi?id=114867

Just to mention we are getting closer to fixing this bug :)
https://bugs.webkit.org/show_bug.cgi?id=114872#c1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>927716</commentid>
    <comment_count>6</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2013-09-11 04:05:30 -0700</bug_when>
    <thetext>This has been fixed along with patch for bug 114872, by getting rid of the pango/gail stuff.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>