Menu

#57 CSS styles are ignored when using updateContentFromNode

open
nobody
Other (16)
5
2010-01-27
2010-01-27
No

When some xhtml data is inserted updateContentFromNode if it has styles they are lost...

The issue is the code from "updateContentFromNode" changed between cvs versions 1.18 and 1.19 where data is inserted using an importNode and appendChild (DOM way) instead the innerHTML(hacky way)

So i see two approaches as solution:

Solution A) change updateFromNode to use the innerHTML function as it did on cvs version 1.18 and previous
Solution B) As IE doesnt implement importNode there is a custom implementation on sarissa, that implementation could also be applyed atoozilla-like browsers adding Moz-Browsers to the condition that defines importNode function.

Discussion

  • Andres Ederra

    Andres Ederra - 2010-01-27

    TestCase of importNode ignoring CSS(not using sarissa, but it shows the point)

     
  • Andres Ederra

    Andres Ederra - 2010-01-27

    A patch that adds the custom importNode implementation when Firefox is used

     
  • Andres Ederra

    Andres Ederra - 2010-01-27

    Patch for Solution B attached to the bug

     
  • Andres Ederra

    Andres Ederra - 2010-01-28

    On a second though i think that solution A is the way to go, as at least in Moz-based browsers, Chrome(and probably any other webkit based browser) and IE, importNode ignores inline css styles.

     
  • Emmanuil Batsis (Manos)

    are classes applied as a workaround instead of inline style?

     

Log in to post a comment.