<?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>23370</bug_id>
          
          <creation_ts>2009-01-15 17:15:16 -0800</creation_ts>
          <short_desc>Style removal can remove too much</short_desc>
          <delta_ts>2009-07-27 11:46:59 -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>HTML Editing</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>23496</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P3</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Justin Garcia">justin.garcia</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>eric</cc>
    
    <cc>harrison</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>105995</commentid>
    <comment_count>0</comment_count>
    <who name="Justin Garcia">justin.garcia</who>
    <bug_when>2009-01-15 17:15:16 -0800</bug_when>
    <thetext>Load attached reduction.html
Select the word &quot;one&quot;
Command-I to de-italicize  the word

&quot;one is de-italicized, but it&apos;s also de-underlined.

&lt;rdar://problem/4438963&gt; Style removal removes too much style</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105998</commentid>
    <comment_count>1</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-01-15 17:27:59 -0800</bug_when>
    <thetext>I&apos;ve not seen the test case yet.  But I assume this is just caused by this function:

void ApplyStyleCommand::removeHTMLStyleNode(HTMLElement *elem)
{
    // This node can be removed.
    // EDIT FIXME: This does not handle the case where the node
    // has attributes. But how often do people add attributes to &lt;B&gt; tags? 
    // Not so often I think.
    ASSERT(elem);
    removeNodePreservingChildren(elem);
}

The check which is made before calling that function is this one:
bool ApplyStyleCommand::isHTMLStyleNode(CSSMutableStyleDeclaration *style, HTMLElement *elem)
{
    CSSMutableStyleDeclaration::const_iterator end = style-&gt;end();
    for (CSSMutableStyleDeclaration::const_iterator it = style-&gt;begin(); it != end; ++it) {
        switch ((*it).id()) {
            case CSSPropertyFontWeight:
                if (elem-&gt;hasLocalName(bTag))
                    return true;
                break;
            case CSSPropertyFontStyle:
                if (elem-&gt;hasLocalName(iTag))
                    return true;
        }
    }

    return false;
}

(which I intend to expand to include other tag types soon)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>134972</commentid>
    <comment_count>2</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2009-07-27 11:46:59 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 23496 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>