[Webkit-unassigned] [Bug 99295] removeAttribute('style') not working in certain circumstances

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 18 20:53:27 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=99295





--- Comment #6 from Darin Adler <darin at apple.com>  2012-10-18 20:54:23 PST ---
(From update of attachment 168872)
View in context: https://bugs.webkit.org/attachment.cgi?id=168872&action=review

>> Source/WebCore/dom/Element.cpp:1578
>> +        }
> 
> All the other code to special case the style attribute is in the StyledElement class. It’s not appropriate to put this mysterious code here in the Element class; the code to handle removal belongs in the StyledElement class with the rest of the code.
> 
> I suggest investigating whether this can be fixed in the StyledElement::attributeChanged function instead of here. I’m pretty sure it can be.
> 
> It’s incorrect for performance reasons to call style(), which will force a CSSStyleDeclaration to be created. The work should be done directly on the StylePropertySet. The function inlineStyle() should be called, and checked for null. Then if the style is non-empty, we should remove all the properties and call inlineStyleChanged.
> 
> It’s incorrect to call removeBlockProperties. We need to remove all the properties, not just the block properties. We may need to add a function to StylePropertySet that removes all properties.

I do think we will need to add some code to Element::removeAttribute, but it will be code something like this:

    if (UNLIKELY(name == styleAttr) && !isStyleAttributeValid())
        updateStyleAttribute();

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list