<?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>136291</bug_id>
          
          <creation_ts>2014-08-27 10:02:40 -0700</creation_ts>
          <short_desc>Style&apos;s &quot;altText&quot; field (webkit-alt property) is not properly managed.</short_desc>
          <delta_ts>2025-03-31 22:48:10 -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>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=62774</see_also>
          <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>
          
          <blocked>133359</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Javier Fernandez">jfernandez</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>cfleizach</cc>
    
    <cc>darin</cc>
    
    <cc>jdiggs</cc>
    
    <cc>jfernandez</cc>
    
    <cc>karlcow</cc>
    
    <cc>ntim</cc>
    
    <cc>syoichi</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1031675</commentid>
    <comment_count>0</comment_count>
    <who name="Javier Fernandez">jfernandez</who>
    <bug_when>2014-08-27 10:02:40 -0700</bug_when>
    <thetext>The recent support of -webkit-alt property for dealing with alternative text in IMG html tags is not properly managed by the RenderStyle (StyleNonInheritedData) and ContentData (ImageContentData) classes. 

As the rest of the fields defined in the RenderStyle class, via the XXXData classes, the constructor using an already instantiated object should copy the field value, in this case the altText and ContentData.altText fields. The bug is not easily reproduced, but its root cause comes from the fact that the StyleNonInheritedData (and the other XXData classes) is defined using the DataRef template, so it uses the access() method to handle its fields. The access() method creates a new instance the first time is called, and a copy reference otherwise. 

So, the bug consists of the altText String pointer being lost when accessing the StyleNonInheritedData fields during the CSS cascade, for instance. This seems to happen, at least during the testing I&apos;ve done so far, only when setting the webkit-alt string directly; I have not been able to reproduce the issue using the html attribute mechanisms.

This issue seems to affect only the LayoutTests/accessibility/webkit-alt-for-css-content.html tests, which on the other hand is the only one using/testing this new property. 

Finally, I wonder why the mentioned tests is mac specific; I think the test and the property are general enough to be cross platform. So, I&apos;d like to use this bug to define a new cross-platform test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1031677</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2014-08-27 10:03:04 -0700</bug_when>
    <thetext>&lt;rdar://problem/18149238&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1031683</commentid>
    <comment_count>2</comment_count>
      <attachid>237230</attachid>
    <who name="Javier Fernandez">jfernandez</who>
    <bug_when>2014-08-27 10:14:11 -0700</bug_when>
    <thetext>Created attachment 237230
Proposed patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1031686</commentid>
    <comment_count>3</comment_count>
    <who name="Javier Fernandez">jfernandez</who>
    <bug_when>2014-08-27 10:18:15 -0700</bug_when>
    <thetext>Chris, since the -webkit-alt property was originally added by your patch for bug #120188 , I&apos;d appreciate your opinion on this issue. Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1031687</commentid>
    <comment_count>4</comment_count>
      <attachid>237230</attachid>
    <who name="chris fleizach">cfleizach</who>
    <bug_when>2014-08-27 10:19:38 -0700</bug_when>
    <thetext>Comment on attachment 237230
Proposed patch.

this looks good to me
Test can be cross platform, should be easy to transition to that. Might be good to include that test change in this patch too

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1031696</commentid>
    <comment_count>5</comment_count>
      <attachid>237230</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2014-08-27 11:23:24 -0700</bug_when>
    <thetext>Comment on attachment 237230
Proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=237230&amp;action=review

&gt; Source/WebCore/rendering/style/ContentData.h:104
&gt; +        std::unique_ptr&lt;ContentData&gt; image = std::make_unique&lt;ImageContentData&gt;(m_image.get());

Local variable type should be ImageContentData, not ContentData. I suggest using auto to get that right.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1031697</commentid>
    <comment_count>6</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2014-08-27 11:24:02 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; So, I&apos;d like to use this bug to define a new cross-platform test.

I don’t think we need to tie the bug fix to the cross-platform test, but we do want both!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1031698</commentid>
    <comment_count>7</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2014-08-27 11:25:10 -0700</bug_when>
    <thetext>A good test would cover both of the code changes, not just one. In other words, we want a test that would fail if either of the changes would be omitted, possibly two tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1031710</commentid>
    <comment_count>8</comment_count>
    <who name="chris fleizach">cfleizach</who>
    <bug_when>2014-08-27 11:54:13 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; A good test would cover both of the code changes, not just one. In other words, we want a test that would fail if either of the changes would be omitted, possibly two tests.

Right. We should probably have a new test just to cover this. Then a new bug to make the tests cross platform. Thanks Darin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1031739</commentid>
    <comment_count>9</comment_count>
    <who name="Javier Fernandez">jfernandez</who>
    <bug_when>2014-08-27 12:42:51 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; A good test would cover both of the code changes, not just one. In other words, we want a test that would fail if either of the changes would be omitted, possibly two tests.

Agree.

&gt; 
&gt; Right. We should probably have a new test just to cover this. Then a new bug to make the tests cross platform. Thanks Darin

Filed bug #136300 for that.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>237230</attachid>
            <date>2014-08-27 10:14:11 -0700</date>
            <delta_ts>2014-08-27 11:23:24 -0700</delta_ts>
            <desc>Proposed patch.</desc>
            <filename>WIP.patch</filename>
            <type>text/plain</type>
            <size>1846</size>
            <attacher name="Javier Fernandez">jfernandez</attacher>
            
              <data encoding="base64">RnJvbSA2ZjZmNTZjMTEyMjNlM2YxYzcwODZjZjZiZjlkNjM1NjU2MTkzYmZiIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBKYXZpZXIgRmVybmFuZGV6IDxqZmVybmFuZGV6QGlnYWxpYS5j
b20+CkRhdGU6IFdlZCwgMjcgQXVnIDIwMTQgMTk6MTA6NDkgKzAyMDAKU3ViamVjdDogW1BBVENI
XSBQcmVsaW1pbmFyeSBhcHByb2FjaC4KCi0tLQogU291cmNlL1dlYkNvcmUvcmVuZGVyaW5nL3N0
eWxlL0NvbnRlbnREYXRhLmggICAgICAgICAgICAgICAgIHwgNCArKystCiBTb3VyY2UvV2ViQ29y
ZS9yZW5kZXJpbmcvc3R5bGUvU3R5bGVSYXJlTm9uSW5oZXJpdGVkRGF0YS5jcHAgfCAxICsKIDIg
ZmlsZXMgY2hhbmdlZCwgNCBpbnNlcnRpb25zKCspLCAxIGRlbGV0aW9uKC0pCgpkaWZmIC0tZ2l0
IGEvU291cmNlL1dlYkNvcmUvcmVuZGVyaW5nL3N0eWxlL0NvbnRlbnREYXRhLmggYi9Tb3VyY2Uv
V2ViQ29yZS9yZW5kZXJpbmcvc3R5bGUvQ29udGVudERhdGEuaAppbmRleCBjMDY1Y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