Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element.appendText can add BR elements with Internet Explorer #11180

Closed
DartBot opened this issue Jun 10, 2013 · 4 comments
Closed

Element.appendText can add BR elements with Internet Explorer #11180

DartBot opened this issue Jun 10, 2013 · 4 comments
Assignees
Labels
web-libraries Issues impacting dart:html, etc., libraries
Milestone

Comments

@DartBot
Copy link

DartBot commented Jun 10, 2013

This issue was originally filed by da...@altern.org


Try the sample code:

void main() {
  h.SpanElement span = new h.SpanElement();
  span.appendText('1\n2');
  for (h.Node testn in span.nodes) {
    print("${testn.nodeType} ${testn.$dom_localName} ${testn.nodeValue}");
  }
}

What is the expected output?
3 null 1
2

What do you see instead?
In Dartium or Firefox, I see the expected output. In IE9, I see:
3 null 1
1 br null
3 null 2

What version of the product are you using? On what operating system?
Dart SDK version 0.5.13.1_r23552
Windows 7 and IE9

Please provide any additional information below.
The API documentation for Element.appendText is "Adds the specified text as a text node after the last child of this element.". With IE9, dart2js is sometimes adding BR elements and text nodes instead of just using one text node as advertised...

@kasperl
Copy link

kasperl commented Jun 10, 2013

Added Area-HTML, Triaged labels.
Changed the title to: "Element.appendText can add BR elements with Internet Explorer".

@blois
Copy link
Contributor

blois commented Jun 10, 2013

Set owner to @blois.
Added this to the M5 milestone.
Added Accepted label.

@blois
Copy link
Contributor

blois commented Jun 10, 2013

Updated docs with https://codereview.chromium.org/16743004


Added Fixed label.

@DartBot
Copy link
Author

DartBot commented Jun 11, 2013

This comment was originally written by da...@altern.org


Changing the documentation is a way to fix it, but I would still be surprised at the behavior with the new spec "Adds the specified text after the last child of this element.". I would not expect BR elements to be used in some browsers. I would suggest hinting at possibly different implementations depending on the browser, potentially adding non-text nodes.

@DartBot DartBot added Type-Defect web-libraries Issues impacting dart:html, etc., libraries labels Jun 11, 2013
@DartBot DartBot added this to the M5 milestone Jun 11, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web-libraries Issues impacting dart:html, etc., libraries
Projects
None yet
Development

No branches or pull requests

3 participants