innerHTML bug

Maciej Stachowiak mjs at apple.com
Sun Aug 19 01:34:00 BST 2007


On Aug 8, 2007, at 7:35 AM, Maksim Orlovich wrote:

>> I don't remember but I think someone worked on innerHTML recently?
>> It doesn't seem to reflect changes made to the render tree like it  
>> does
>> with other browsers,
>> I can't log into ingdirect.fr.
>>
>> Testcase attached.
>>
>> Basically foo.style.color = "#101065"; works but later on innerHTML
>> doesn't show that new color.
>> Any ideas? I'm not sure how CSS changes are applied to both trees...
>
> It's a super-weird quirk we don't really implement... When you do this
> construct it actually changes the style attribute (!). Unfortunately I
> can't think of a nice way of implementing this :( Obviously special- 
> casing
> access to ATTR_STYLE over the place would suck, since the attribute  
> code
> is way complex as-is, and updating the string form would be expensive.
> Urgh. This needs a notion of a special computed attribute type or
> something.

In WebCore we handle this through lazy updating of the style  
attribute. See WebCore/dom/StyledElement.cpp and related code in  
element.cpp. It might be useful to make this concept a bit more  
general in the future, since HTML5 classList may make it desirable to  
do similar lazy updating for the class attribute.

Regards,
Maciej





More information about the kfm-devel mailing list