This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 501 - Whitespace handling in hc_textsplittext tests
Summary: Whitespace handling in hc_textsplittext tests
Status: RESOLVED INVALID
Alias: None
Product: DOM TS
Classification: Unclassified
Component: DOM Level 1 (show other bugs)
Version: unspecified
Hardware: Other Linux
: P2 normal
Target Milestone: ---
Assignee: Philippe Le Hegaret
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-23 10:06 UTC by David Faure
Modified: 2004-01-23 17:10 UTC (History)
0 users

See Also:


Attachments

Description David Faure 2004-01-23 10:06:38 UTC
hc_textsplittextone.html takes the element defined as 
<strong>Roger 
Jones</strong> 
and splits it at position 7. 
 
The above is parsed as "Roger Jones" or "Roger\nJones", so splitting at 
position 7 leaves "ones" as the second item instead of the expected "Jones". 
 
I guess the test says 7 because IE stores it with \r\n? I think it should be 6, 
or maybe the test needs to be changed to split a node whose text doesn't have a 
newline in it (I'm no parsing expert :).
Comment 1 David Faure 2004-01-23 10:13:38 UTC
Ah, hc_textwithnomarkup explained the reason for the off-by-one. 
The expected value is "Roger\n Jones". 
However whitespace is usually not kept when parsing HTML, is it? 
If "Roger Jones" is a valid parsing of that tag, then the tests need to be more 
flexible about this. Text splitting is properly working in KHTML, it's only 
that the parsing difference leads to off by ones in the results... 
Comment 2 David Faure 2004-01-23 12:10:33 UTC
After discussion with other KHTML developers, I have been told that this is 
really a KHTML bug, we should preserve whitespace in the DOM tree. 
We'll try to do that shortly, once 3.2 is out. Apologies.