<?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>101682</bug_id>
          
          <creation_ts>2012-11-08 18:24:52 -0800</creation_ts>
          <short_desc>RemoveFormat command doesn&apos;t remove background color</short_desc>
          <delta_ts>2012-11-09 13:19:57 -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>HTML Editing</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>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ryosuke Niwa">rniwa</reporter>
          <assigned_to name="Ryosuke Niwa">rniwa</assigned_to>
          <cc>darin</cc>
    
    <cc>enrica</cc>
    
    <cc>mifenton</cc>
    
    <cc>ojan</cc>
    
    <cc>tony</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>762406</commentid>
    <comment_count>0</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-11-08 18:24:52 -0800</bug_when>
    <thetext>Steps to reproduce the problem:
1. create js node &apos;some &lt;span style=&quot;color: black; background-color: #ff0000;&quot;&gt;red text&lt;/span&gt; here&apos; element 
2. call execCommand with removeFormat on the created node

What is the expected behavior?
&apos;some &lt;span&gt;red text&lt;/span&gt; here&apos;
ie: Background colour is removed

What went wrong?
&apos;some &lt;span style=&quot;background-color: #ff0000;&quot;&gt;red text&lt;/span&gt; here&apos;
ie: Background colour is not removed

http://code.google.com/p/chromium/issues/detail?id=159407</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>762407</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2012-11-08 18:25:10 -0800</bug_when>
    <thetext>&lt;rdar://problem/12668350&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>762527</commentid>
    <comment_count>2</comment_count>
      <attachid>173196</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-11-08 21:25:24 -0800</bug_when>
    <thetext>Created attachment 173196
Fixes the bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>763108</commentid>
    <comment_count>3</comment_count>
      <attachid>173196</attachid>
    <who name="Tony Chang">tony</who>
    <bug_when>2012-11-09 09:52:27 -0800</bug_when>
    <thetext>Comment on attachment 173196
Fixes the bug

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

&gt; LayoutTests/editing/execCommand/remove-format-background-color-expected.txt:3
&gt; +This tests removing format on text that has background color. There should be no span or inline style below:
&gt; +
&gt; +hello world WebKit.

Should we use something other than a dumpAsText test?  I think a script test that uses getComputedStyle or a reftest would be better for checking the background color.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>763194</commentid>
    <comment_count>4</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-11-09 11:33:23 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (From update of attachment 173196 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=173196&amp;action=review
&gt; 
&gt; &gt; LayoutTests/editing/execCommand/remove-format-background-color-expected.txt:3
&gt; &gt; +This tests removing format on text that has background color. There should be no span or inline style below:
&gt; &gt; +
&gt; &gt; +hello world WebKit.
&gt; 
&gt; Should we use something other than a dumpAsText test?  I think a script test that uses getComputedStyle or a reftest would be better for checking the background color.

I’m dumping HTML here. We don’t want to leave a span. It’s important the markup we generate is as concise as possible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>763211</commentid>
    <comment_count>5</comment_count>
      <attachid>173196</attachid>
    <who name="Tony Chang">tony</who>
    <bug_when>2012-11-09 11:49:54 -0800</bug_when>
    <thetext>Comment on attachment 173196
Fixes the bug

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

&gt; Source/WebCore/editing/RemoveFormatCommand.cpp:92
&gt; +    defaultStyle-&gt;style()-&gt;setProperty(CSSPropertyBackgroundColor, &quot;transparent&quot;);

Can we pass in CSSValueTransparent instead of &quot;transparent&quot;?  Looks like that would avoid having to run the CSS parser.

&gt;&gt;&gt; LayoutTests/editing/execCommand/remove-format-background-color-expected.txt:3
&gt;&gt;&gt; +hello world WebKit.
&gt;&gt; 
&gt;&gt; Should we use something other than a dumpAsText test?  I think a script test that uses getComputedStyle or a reftest would be better for checking the background color.
&gt; 
&gt; I’m dumping HTML here. We don’t want to leave a span. It’s important the markup we generate is as concise as possible.

Ah, I see.  Using dump-as-markup.js would be more clear.  Should there be a test case with background-color: transparent?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>763216</commentid>
    <comment_count>6</comment_count>
      <attachid>173196</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-11-09 11:55:54 -0800</bug_when>
    <thetext>Comment on attachment 173196
Fixes the bug

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

&gt;&gt; Source/WebCore/editing/RemoveFormatCommand.cpp:92
&gt;&gt; +    defaultStyle-&gt;style()-&gt;setProperty(CSSPropertyBackgroundColor, &quot;transparent&quot;);
&gt; 
&gt; Can we pass in CSSValueTransparent instead of &quot;transparent&quot;?  Looks like that would avoid having to run the CSS parser.

Oh, you’re right. We’re talking to StylePropertySet here.

&gt;&gt;&gt;&gt; LayoutTests/editing/execCommand/remove-format-background-color-expected.txt:3
&gt;&gt;&gt;&gt; +hello world WebKit.
&gt;&gt;&gt; 
&gt;&gt;&gt; Should we use something other than a dumpAsText test?  I think a script test that uses getComputedStyle or a reftest would be better for checking the background color.
&gt;&gt; 
&gt;&gt; I’m dumping HTML here. We don’t want to leave a span. It’s important the markup we generate is as concise as possible.
&gt; 
&gt; Ah, I see.  Using dump-as-markup.js would be more clear.  Should there be a test case with background-color: transparent?

No… I think we should be removing background-color: transparent as well in the future. We just don’t have a way to tell ApplyStyleCommand that it should remove a property regardless of its value.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>763223</commentid>
    <comment_count>7</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-11-09 12:10:50 -0800</bug_when>
    <thetext>Committed r134096: &lt;http://trac.webkit.org/changeset/134096&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>763263</commentid>
    <comment_count>8</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2012-11-09 13:19:57 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; &gt; Should there be a test case with background-color: transparent?
&gt; 
&gt; No… I think we should be removing background-color: transparent as well in the future. We just don’t have a way to tell ApplyStyleCommand that it should remove a property regardless of its value.

That&apos;s fine, you could check in a failing test case for that.  It would make it clear what the desired result is.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>173196</attachid>
            <date>2012-11-08 21:25:24 -0800</date>
            <delta_ts>2012-11-09 11:55:54 -0800</delta_ts>
            <desc>Fixes the bug</desc>
            <filename>bug-101682-20121108212332.patch</filename>
            <type>text/plain</type>
            <size>3748</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb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NwYW4gc3R5bGU9ImNvbG9yOiBibGFj
azsgYmFja2dyb3VuZC1jb2xvcjogI2ZmMDAwMDsiPndvcmxkPC9zcGFuPiBXZWJLaXQuPC9kaXY+
Cis8c2NyaXB0IHR5cGU9InRleHQvamF2YXNjcmlwdCI+CisKK2lmICh3aW5kb3cudGVzdFJ1bm5l
cikKKyAgICB0ZXN0UnVubmVyLmR1bXBBc1RleHQoKTsKKwordmFyIGVkaXRvciA9IGRvY3VtZW50
LmdldEVsZW1lbnRCeUlkKCdlZGl0b3InKTsKK2VkaXRvci5mb2N1cygpOworZG9jdW1lbnQuZXhl
Y0NvbW1hbmQoJ1NlbGVjdEFsbCcsIGZhbHNlLCBudWxsKTsKK2RvY3VtZW50LmV4ZWNDb21tYW5k
KCdSZW1vdmVGb3JtYXQnLCBmYWxzZSwgbnVsbCk7CitlZGl0b3IuaW5uZXJUZXh0ID0gZWRpdG9y
LmlubmVySFRNTDsKKworPC9zY3JpcHQ+Cis8L2JvZHk+Cis8L2h0bWw+Cg==
</data>
<flag name="review"
          id="187801"
          type_id="1"
          status="+"
          setter="tony"
    />
          </attachment>
      

    </bug>

</bugzilla>