Opened 7 years ago

Last modified 7 years ago

#1573 new defect

IE8 + doctype adds extra style attribute

Reported by: guest Owned by: gogo
Priority: normal Milestone:
Component: Xinha Core Version: trunk
Severity: normal Keywords: doctype, ie8, internet exporer 8, style attribute
Cc:

Description

I noticed that a fresh Xinha implementation displays some odd behaviour.

When loading Xinha on the following element:

<textarea id="textareaId" name="textareaId" style="width: 400px; height: 400px;">

<a href="/my/link.html" id="player" style="width: 200px; height: 200px;">Link text</a>

</textarea>

And then toggling the HTML source via the Xinha button, the html had been transformed into the following:

<a id="player" style="player" href="/my/link.html" style="width: 200px; height: 200px">Link text</a>

As you can see, an extra style attribute has been added with a value of the elements ID, effectively rendering the already present style attribute useless.

This behaviour is only present in IE8 when there is a doctype present. Remove the doctype and all works fine.

Works correctly in: IE6, IE7, FF3.5.8, IE8 (without doctype)\

Broken in: IE8 + doctype

Xinha version: Xinha 0.96.1 (2010-05-12)

Used code: Taken from http://trac.xinha.org/wiki/NewbieGuide (see attached file)

Attachments (2)

index2.html (6.1 KB) - added by guest 7 years ago.
Reproduce code
xinha.html (6.1 KB) - added by guest 7 years ago.
Reproduce code

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by guest

Reproduce code

comment:1 Changed 7 years ago by guest

  • Summary changed from IE8 + doctype add extra style attribute to IE8 + doctype adds extra style attribute

comment:2 Changed 7 years ago by gogo

Your HTML is invalid, this may or may not affect the problem at hand.

Please read this...

http://trac.xinha.org/wiki/Entize

and then fix your testcase/code and see if it makes a difference to this particular problem for you.

Changed 7 years ago by guest

Reproduce code

comment:3 Changed 7 years ago by guest

Thanks Gogo,

I applied the suggested changes and tested again.
Still no dice.
The same symptoms, works in IE8 without doctype, but is still broken with a doctype.

Uploaded the new testcase with the entitized textarea contents.

comment:4 Changed 7 years ago by gogo

In XinhaCore? try switching between the two different getHtmlMethod options

Search for this.getHtmlMethod = 'DOMwalk'; or this.getHtmlMethod = 'TransformInnerHTML'; and change appropriately.

Also, from memory IE 8 has two modes "Standards" and "Compatability", try switching between them (button in the IE address bar from memory) and see if it makes a difference.

If you are seeing this in DOMWalk, there is some special case for IE8 there, but I don't see how it would produce this problem.

Note: See TracTickets for help on using tickets.