Bug #2998

node.textContent will not output contents of its children

Added by Wain . almost 4 years ago. Updated almost 4 years ago.

Status:FixedStart date:02/07/2016
Priority:NormalDue date:
Assignee:Andreas Smas% Done:

100%

Category:API
Target version:-
Found in version:4.10.37.g41bb3 Platform:Linux

Description

I don't really know whether this is a Movian or Gumbo issue, so I'll just leave it here.
According to W3 DOM textContent property specification: "This attribute returns the text content of this node and its descendants", and it really does in each and every browser.
However, in Movian this property returns only the element's text nodes, and doesn't include text nodes of its descendants.
Example:
Foo<span>Bar</span>
node.textContent should read: FooBar
In Movian that'll be only Foo

Easy to reproduce with the following snippet:

var test = "<div id='test'>Foo<span>Bar</span></div>",
            parsed = html.parse(test);
showtime.print(parsed.root.getElementById('test').textContent); //Foo

Associated revisions

Revision 65fd24ba
Added by Andreas Smas almost 4 years ago

ecmascript: Make element.textContent behave as it should

Fixes #2998

Change included in version 4.99.705

History

#1 Updated by Wain . almost 4 years ago

I have updated Movian to the latest build (4.99.704.g872d4), still this bug is present. It's quite hard to use new DOM parser because of this issue.

#2 Updated by Andreas Smas almost 4 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Also available in: Atom PDF