Closed Bug 328524 Opened 19 years ago Closed 9 years ago

copy handles textnodes wrong

Categories

(Core Graveyard :: XForms, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: doronr, Unassigned)

Details

Attachments

(2 files)

We assume that text always goes into one textnode - however, Mozilla will split large textnodes into several.
You know anyone who can point us to an example of where this happens? Testcase?
Just create a really long string :)
(In reply to comment #0) > We assume that text always goes into one textnode - however, Mozilla will split > large textnodes into several. Where do we do this? Could you elaborate a bit? :)
Copy code assumes only one textnode can exist, and not a few one after each other.
Assignee: aaronr → xforms
(In reply to comment #4) > Copy code assumes only one textnode can exist, and not a few one after each > other. Problem is that, in XForms only the first text node is targeted by single node bindings. So we must not consider "following text nodes" -- unless they have been split. So unless it is possible to distinguish "text nodes that are split" from "normal text nodes", I guess this is impossible to fix. [http://www.w3.org/TR/2006/REC-xforms-20060314/slice8.html#ui-processing]
Summary: We handle textnodes wrong → copy handles textnodes wrong
> Problem is that, in XForms only the first text node is targeted by single node > bindings. So we must not consider "following text nodes" -- unless they have > been split. So unless it is possible to distinguish "text nodes that are split" > from "normal text nodes", I guess this is impossible to fix. > [http://www.w3.org/TR/2006/REC-xforms-20060314/slice8.html#ui-processing] > <foo>bla bli arh</foo> per the DOM spec should be one text node, but we would split it if it were long enough. So anytime you have multiple text nodes following eachother, I believe we can safely assume they were split up.
(In reply to comment #6) > > Problem is that, in XForms only the first text node is targeted by single node > > bindings. So we must not consider "following text nodes" -- unless they have > > been split. So unless it is possible to distinguish "text nodes that are split" > > from "normal text nodes", I guess this is impossible to fix. > > [http://www.w3.org/TR/2006/REC-xforms-20060314/slice8.html#ui-processing] > > > <foo>bla bli arh</foo> per the DOM spec should be one text node, but we would > split it if it were long enough. So anytime you have multiple text nodes > following eachother, I believe we can safely assume they were split up. No señor. Someone could be wicked enough to construct a document with text node siblings, like this form. Here the text nodes are not split, just because they are siblings.
This bug SHOULD be fixed by bug 357652. Keeping open to verify that fact.
> Created an attachment (id=223744) [details] > Form with text node siblings > > (In reply to comment #6) > > > Problem is that, in XForms only the first text node is targeted by single node > > > bindings. So we must not consider "following text nodes" -- unless they have > > > been split. So unless it is possible to distinguish "text nodes that are split" > > > from "normal text nodes", I guess this is impossible to fix. > > > [http://www.w3.org/TR/2006/REC-xforms-20060314/slice8.html#ui-processing] > > > > > <foo>bla bli arh</foo> per the DOM spec should be one text node, but we would > > split it if it were long enough. So anytime you have multiple text nodes > > following eachother, I believe we can safely assume they were split up. > > No señor. Someone could be wicked enough to construct a document with text > node siblings, like this form. Here the text nodes are not split, just because > they are siblings. > from comments to bug 357652: // XForms specs 8.1.1 (http://www.w3.org/TR/xforms/slice8.html#ui-processing) // says: 'if text child nodes are present, returns the string-value of the // first text child node. Otherwise, returns "" (the empty string)'. // The 'text child node' that is mentioned above is from the xforms // instance document which is, according to spec, is formed by // 'creating an XPath data model'. So we need to treat 'text node' in // this case as an XPath text node and not a DOM text node. // DOM XPath specs (http://www.w3.org/TR/2002/WD-DOM-Level-3-XPath-20020328/xpath.html#TextNodes) // says: // 'Applications using XPath in an environment with fragmented text nodes // must manually gather the text of a single logical text node possibly // from multiple nodes beginning with the first Text node or CDATASection // node returned by the implementation'. // Therefore we concatenate contiguous CDATA/DOM text nodes and return // as node value.
Attached file testcase2
RIP xforms
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: