RESOLVED DUPLICATE of bug 23496 23370
Style removal can remove too much
https://bugs.webkit.org/show_bug.cgi?id=23370
Summary Style removal can remove too much
Justin Garcia
Reported 2009-01-15 17:15:16 PST
Load attached reduction.html Select the word "one" Command-I to de-italicize the word "one is de-italicized, but it's also de-underlined. <rdar://problem/4438963> Style removal removes too much style
Attachments
Eric Seidel (no email)
Comment 1 2009-01-15 17:27:59 PST
I'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 <B> 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->end(); for (CSSMutableStyleDeclaration::const_iterator it = style->begin(); it != end; ++it) { switch ((*it).id()) { case CSSPropertyFontWeight: if (elem->hasLocalName(bTag)) return true; break; case CSSPropertyFontStyle: if (elem->hasLocalName(iTag)) return true; } } return false; } (which I intend to expand to include other tag types soon)
Ryosuke Niwa
Comment 2 2009-07-27 11:46:59 PDT
*** This bug has been marked as a duplicate of bug 23496 ***
Note You need to log in before you can comment on or make changes to this bug.