Closed Bug 283861 Opened 19 years ago Closed 16 years ago

Want Text3.isElementContentWhitespace

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.1b2

People

(Reporter: caillon, Assigned: WeirdAl)

References

()

Details

Attachments

(2 files, 2 obsolete files)

To make it easier to figure out what content is ignorable from apps.
Attachment #175668 - Flags: superreview?(jst)
Attachment #175668 - Flags: review?(jst)
Does this really not need to be done on character data nodes, etc?  Also, why
not implement getWholeText/replaceWholeText?  Those shouldn't be too hard,
should they?
Comment on attachment 175668 [details] [diff] [review]
nsIDOM3Text

r+sr=jst
Attachment #175668 - Flags: superreview?(jst)
Attachment #175668 - Flags: superreview+
Attachment #175668 - Flags: review?(jst)
Attachment #175668 - Flags: review+
*** Bug 343906 has been marked as a duplicate of this bug. ***
Comment on attachment 175668 [details] [diff] [review]
nsIDOM3Text

This is entirely new code, which has somehow sat around, not checked in, for a very long time...
Attachment #175668 - Flags: approval1.9?
That patch looks bitrotted to me.  For one thing, the tearoff needs to implement cycle collection.
And shipping something that will start throwing exceptions on enumeration at this stage in the game worries me in any case.
Comment on attachment 175668 [details] [diff] [review]
nsIDOM3Text

I agree with Boris here.  I don't want to approve this until we know such an old patch is still valid.  Please test and re-request approval when done.
Attachment #175668 - Flags: approval1.9? → approval1.9-
Reading current code in mozilla-central against the patch, it looks like most of the code is already in place - the one major difference being nsITextContent doesn't exist anymore, and various methods are using nsIContent's TextIsOnlyWhitespace().

Given that, I am crafting an updated patch for this bug, but I would love it if someone would write a mochitest for it.
Assignee: caillon → ajvincent
Attachment #175668 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #341580 - Flags: superreview?(jonas)
Attachment #341580 - Flags: review?(jonas)
Attachment #341580 - Flags: superreview?(jonas)
Attachment #341580 - Flags: superreview+
Attachment #341580 - Flags: review?(jonas)
Attachment #341580 - Flags: review+
Whoops, I almost repeated caillon's mistake of not looking to get this checked in.  ;-)
Keywords: checkin-needed
Would be great to get some tests here - to prevent regressions.
Flags: in-testsuite?
Attached file Possible mochitest (obsolete) —
Not quits sure if this is what you guys were looking for and I don't have a build system setup to test this stuff out. Feel free to modify as you see fit.
Ryan, the code returns true if the text node's whole contents are white space.
(In reply to comment #14)
> Ryan, the code returns true if the text node's whole contents are white space.

That should be simpler to test for then. I'll re-write the tests.
This should be better then. Would appreciate it is someone could test and see if it actually does what it should though!
Attachment #343251 - Attachment is obsolete: true
Comment on attachment 341580 [details] [diff] [review]
updated patch
[Checkin: Comment 17]

http://hg.mozilla.org/mozilla-central/rev/4755421bae8f
Attachment #341580 - Attachment description: updated patch → updated patch [Checkin: Comment 17]
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
OS: Linux → All
QA Contact: ian → general
Hardware: PC → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1b2
Our DOM doesn't have a way to distinguish ignorable whitespace from regular whitespace. I'd rather we didn't implement this instead of implementing it differently from what the specification defines.
peterv: do you mean we should back this patch out?
I've been thinking about this lately.  I think the gist of comment 18 is that because we're not a validating XML processor, there's no definition of ignorable white space as far as we're concerned:
http://www.w3.org/TR/REC-xml/#sec-white-space

I don't see any way to improve on what we've got, even with regular expressions work being done for bug 345512.
Flags: in-testsuite?
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: