<?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>119523</bug_id>
          
          <creation_ts>2013-08-06 10:14:12 -0700</creation_ts>
          <short_desc>Improper Calculation of In-band Cue Colors</short_desc>
          <delta_ts>2013-08-06 11:38:57 -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>Media</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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brent Fulgham">bfulgham</reporter>
          <assigned_to name="Brent Fulgham">bfulgham</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>914889</commentid>
    <comment_count>0</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2013-08-06 10:14:12 -0700</bug_when>
    <thetext>The logic used to convert the attributed strings from In-band caption content was improperly converting from floating point values to byte values.

We are getting a directive to draw 100% opaque black background in TextTrackCueGenericBoxElement::applyCSSProperties.  This is coming from the cue&apos;s background color property.

It looks like the code in InbandTextTrackPrivateAVF.cpp (makeRGBA32FromARGBCFArray) is improperly converting from floating point values to bytes.

I see a 50% opacity value coming into the function, which is multiplied by 255 when being passed to the makeRGBA32FromFloats function.  That function calls &apos;colorFloatToRGBAByte&apos;, which performs a bounded multiplication by 255.

This means we have (0.5 * 255) * 255 -&gt; 125 * (255) -&gt; the max of 255.

If I take away the outer (redundant) multiplication by 255, I get correct behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>914891</commentid>
    <comment_count>1</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2013-08-06 10:14:36 -0700</bug_when>
    <thetext>&lt;rdar://problem/14627254&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>914892</commentid>
    <comment_count>2</comment_count>
      <attachid>208198</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2013-08-06 10:16:29 -0700</bug_when>
    <thetext>Created attachment 208198
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>914917</commentid>
    <comment_count>3</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2013-08-06 11:38:57 -0700</bug_when>
    <thetext>Committed r153758: &lt;http://trac.webkit.org/changeset/153758&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>208198</attachid>
            <date>2013-08-06 10:16:29 -0700</date>
            <delta_ts>2013-08-06 11:10:15 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-119523-20130806101627.patch</filename>
            <type>text/plain</type>
            <size>1454</size>
            <attacher name="Brent Fulgham">bfulgham</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDE1Mzc1NSkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE0IEBACisyMDEzLTA4LTA2ICBCcmVudCBG
dWxnaGFtICA8YmZ1bGdoYW1AYXBwbGUuY29tPgor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IGNvcHkpCkBAIC0xMjYs
NyArMTI2LDcgQEAgc3RhdGljIGJvb2wgbWFrZVJHQkEzMkZyb21BUkdCQ0ZBcnJheShDRgogICAg
ICAgICBjb21wb25lbnRBcnJheVtpXSA9IGNvbXBvbmVudDsKICAgICB9CiAKLSAgICBjb2xvciA9
IG1ha2VSR0JBMzJGcm9tRmxvYXRzKGNvbXBvbmVudEFycmF5WzFdICogMjU1LCBjb21wb25lbnRB
cnJheVsyXSAqIDI1NSwgY29tcG9uZW50QXJyYXlbM10gKiAyNTUsIGNvbXBvbmVudEFycmF5WzBd
ICogMjU1KTsKKyAgICBjb2xvciA9IG1ha2VSR0JBMzJGcm9tRmxvYXRzKGNvbXBvbmVudEFycmF5
WzFdLCBjb21wb25lbnRBcnJheVsyXSwgY29tcG9uZW50QXJyYXlbM10sIGNvbXBvbmVudEFycmF5
WzBdKTsKICAgICByZXR1cm4gdHJ1ZTsKIH0KIAo=
</data>
<flag name="review"
          id="230090"
          type_id="1"
          status="+"
          setter="eric.carlson"
    />
          </attachment>
      

    </bug>

</bugzilla>