document.createProcessingInstruction for XHTML not implemented

RESOLVED FIXED in mozilla1.7beta

Status

()

Core
DOM: Core & HTML
P3
normal
RESOLVED FIXED
17 years ago
10 years ago

People

(Reporter: Michael Hearn, Assigned: bz)

Tracking

({dom2})

Trunk
mozilla1.7beta
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Reporter)

Description

17 years ago
Hi, basically I need this command for an app I am writing with Mozilla. Please
can it be implemented, I doubt it's hard :)

thanks -mike
Creating processing instructions does work in XML document, are you trying to
create processing instructions in HTML? (that should not work so I wouldn't
count on that being implemented any time soon). Or did you try this in XUL?
Please give more details.
need a test case...
Keywords: dom2
Component: DOM Level 2 → DOM HTML
(Reporter)

Comment 3

17 years ago
I was trying it in XUL and got the error "Method not implemented" so I assumed
it had been futured or something. Am I wrong?
I just attached a fix for this, good ol' cut n' paste style fix for now :-).
r/sr= anyone?
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
OS: other → All
Priority: -- → P3
Hardware: PC → All
Whiteboard: [HAVE FIX]
Target Milestone: --- → mozilla0.9

Comment 6

17 years ago
r=jag
Fix cheked in, thanks for the reviews.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
(Reporter)

Comment 9

17 years ago
Wow, thanks guys, that was very fast :)
How on earth did I end up QA on this. -> desale@netscape.com
Component: DOM HTML → DOM Core
QA Contact: ian → desale

Comment 11

17 years ago
Updating QA contact to Shivakiran Tummala.
QA Contact: desale → stummala

Comment 12

17 years ago
Created attachment 40459 [details]
testcase attached

Comment 13

17 years ago
looks like it is not yet implemented...reopening bug...
This is what javascript console reads

Error: uncaught exception: [Exception... "Component returned failure code: 
0x80530009 [nsIDOMHTMLDocument.createProcessingInstruction]"  
nsresult: "0x80530009 (<unknown>)"  location: "JS frame :: 
file:///c|/kiran/test/69840.html :: <TOP_LEVEL> :: line 6"  data: no]

testcase shamelessly stolen from 
http://www.zvon.org/xxl/DOM1reference/Output/examples/Document_createProcessingI
nstruction.html 

testcase:
<html>
<body>
<script>

var pi = document.createProcessingInstruction('php', 'echo("another example")');
  var output1 = pi.target;
  var output2 = pi.data;
alert (output1);
alert (output2);
</script>
</body>
</html>
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Comment 14

17 years ago
You tried this on a html document.
Comments from jst on 2001-02-22:
"are you trying to create processing instructions in HTML? (that should not work
so I wouldn't count on that being implemented any time soon)"
I guess it depends whether there is another bug for createProcessingInstruction
for HTML.
As the current DOM HTML spec is written a HTML DOM should *not* implement this
method, so mozilla does the right thing.

However, for XHTML documents this should work, but we're not quite there yet.
Futuring.
Status: REOPENED → ASSIGNED
Target Milestone: mozilla0.9 → Future

Comment 16

17 years ago
Adding "for XHTML" to the summary so that we don't confuse with XUL or HTML.
Removing [HAVE FIX] from whiteboard. Sorry for the spam.
Summary: document.createProcessingInstruction not implemented → document.createProcessingInstruction for XHTML not implemented
Whiteboard: [HAVE FIX]

Updated

16 years ago
Priority: P3 → P5
Filed bug 166467 for a similar bustage in XUL (which has been touched on 
previously here, but apparently not investigated yet).
Mass-reassigning bugs to dom_bugs@netscape.com
Assignee: jst → dom_bugs
Status: ASSIGNED → NEW
Created attachment 142505 [details]
Useful testcase
Attachment #40459 - Attachment is obsolete: true
Created attachment 142506 [details] [diff] [review]
Patch

Just push the function up to nsDocument and make sure HTML doesn't call them.
Attachment #26137 - Attachment is obsolete: true
Attachment #142506 - Flags: superreview?(jst)
Attachment #142506 - Flags: review?(jst)
Comment on attachment 142506 [details] [diff] [review]
Patch

- In nsDocument::CreateCDATASection():

+  if (FindInReadable(NS_LITERAL_STRING("]]>"),begin,end))
+    return NS_ERROR_DOM_INVALID_CHARACTER_ERR;

This is not per the DOM spec, but I know you didn't write this now... At some
point we should allow this, and let people catch silly stuff like this in
normalizeDocument() or while serializing.

r+sr=jst
Attachment #142506 - Flags: superreview?(jst)
Attachment #142506 - Flags: superreview+
Attachment #142506 - Flags: review?(jst)
Attachment #142506 - Flags: review+
Assignee: general → bzbarsky
Priority: P5 → P3
Target Milestone: Future → mozilla1.7beta
Fixed.
Status: NEW → RESOLVED
Last Resolved: 17 years ago14 years ago
Resolution: --- → FIXED

Comment 23

14 years ago
bz:
Is it possible that this patch caused the OS/2 bustage (see
http://tinderbox.mozilla.org/showlog.cgi?log=SeaMonkey-Ports/1078267320.4475.gz) ?
That tbox is testing a beta compiler that was pretty clearly miscompiling
Mozilla (oragne and all) even before it went red.  The bustage seems to be that
it's just not linking the right things together (notice that it can't find nice
things like operator new for parts of the code that are nowhere near what this
patch touches).
I'm in the process of building the latest code on OS/2.  I've just gotten past
layout, and it built the DLL just fine (I am also using this beta compiler).  So
for the moment, it looks like it was a machine error.

Updated

10 years ago
Component: DOM: Core → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.