Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1713] iOS: Implement DOMNode.textContent property for better compatibility with browser JS code

GitHub Issuen/a
TypeNew Feature
PriorityTrivial
StatusClosed
ResolutionWon't Fix
Resolution Date2011-11-05T18:24:10.000+0000
Affected Version/sRelease 1.5.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterRalf Pfeiffer
AssigneeReggie Seagraves
Created2011-04-15T03:00:15.000+0000
Updated2012-03-10T15:01:09.000+0000

Description

DOM nodes in the Titanium Mobile iPhone and Android implementations have a 'text' property which pulls the text content of the node and any of its child nodes. While this is very handy, it's not compatible with WebKit and other browser DOM implementations, which complicates adapting code from Titanium Desktop or browser environments.

DOM level 3 specifies a textContent property for this, which is supported by most browsers. IE has an equivalent innerText property; existing cross-browser toolkits like jQuery check both so should start "just working" in this respect if textContent is added. (Of course any other remaining incompatibilities need to be fixed too!)

https://developer.mozilla.org/En/DOM/Node.textContent">https://developer.mozilla.org/En/DOM/Node.textContent

http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#Node3-textContent"> http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#N...

Adding a compatible getter should be a very easy patch.

Comments

  1. Stephen Tramer 2011-04-15

    We only guarantee support for DOM 2 features.

  2. Stephen Tramer 2011-04-15

    Actually going to TBS this. Why not.

  3. Don Thorp 2011-11-05

    We're supporting DOM2, not browsers.

JSON Source