Closed Bug 19515 Opened 25 years ago Closed 25 years ago

[DOGFOOD] Content of a tag lost

Categories

(Core :: DOM: Editor, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: BenB, Assigned: akkzilla)

References

Details

(Whiteboard: [PDT+] will verify in 11/30 build.)

I entered the following msg: <html><head></head> <body> <div type="_moz">bla <a href="http://www.m.o/1">link</a> bla <a href="http://www.m.o /3">link1</a></div><div type="_moz"> <a href="http://www.m.o/3">link2</a> bla <a href="http://www.m.o/2">li<b>n</b>k< /a> bla <a href="ozuio">link </a>bla<a href="uiozp"> link</a> bla </div></body> </html> But only the following was passed to ScanHTMLForURLs (the function I'm working on): <html><head></head> <body> <div type="_moz">bla <a href="http://www.m.o/1"></a> bla <a href="http://www.m.o /3">link1</a></div><div type="_moz"> <a href="http://www.m.o/3">link2</a> bla <a href="http://www.m.o/2">li<b>n</b>k< /a> bla <a href="ozuio">link </a>bla<a href="uiozp"> </a> bla </div></body> </html> The content of the first and last a tag, "link", was lost.
Some easier msg failing: <html><head></head> <body> <div type="_moz">bla <a href="zzzztio"></a> bla <a href="zuizui"></a></div><div type="_moz"> <a href="zuizui"></a> bla <a href="zit">lin</a>k bla <a href="tziuuz"></a> bla</div></body> </html>
Assignee: beppe → akkana
Akkana, Ithink this may have something to do with saving, can you please check this one out - thanks
Target Milestone: M12
Status: NEW → ASSIGNED
Summary: Content of a tag lost → [DOGFOOD] Content of a tag lost
Yes, looks like there's a problem with the html sink stream. Losing the content of <a> tags on output seems pretty important -- I'd argue that this is a dogfood bug for the editor. Getting rid of the <div type="_moz"> doesn't help.
Interestingly, whatever is going wrong with handling these links also seems to confuse the plaintext sink -- "link" doesn't make it into plaintext output either. The fact that they're both confused suggests that it's a XIF problem -- but the XIF output looks fine, so perhaps it's a problem with parsing the XIF into content nodes.
Sure enough -- there's a content node in the XIF, but when the XIF is parsed, AddLeaf() in the sink is never called with the text node corresponding to "link". Adding Harish to the cc list -- Harish, can you take a look? This may be related to some of the recent changes to nsXIFDTD.cpp.
Whiteboard: [PDT+]
Putting on the PDT+ radar.
Whiteboard: [PDT+] → [PDT+] Rick will help look at it
Whiteboard: [PDT+] Rick will help look at it → [PDT+] [by 12/10] Rick will help look at it when he gets back
Blocks: 12658
during the PDT meeting on Monday, Akkana requested assistance from someone who knows the parser code. Rickg offered to help and will assist Akkana this coming week. Akkana, I left Rick a note and a voicemail reminding him to contact you.
For anyone wondering how to reproduce this: Take the first message Ben gives, and put it in a local file. Then run apprunner -edit file:[pathToLocalFile] Notice "link" inside the first link. Now select "Output HTML" from the Debug menu. Notice that "link" inside the first link is not there. Rick discovered something fascinating, though: edit the local file and change "link" to "rick" then do OutputHTML again, and now the text is there!
Assignee: akkana → rickg
Status: ASSIGNED → NEW
As long as Rick is looking at it, I'll assign it to him; Rick, pass it back if you run out of time or if the ball gets volleyed back to my side of the net.
Assignee: rickg → akkana
I've found the problem, and sent the patch to akkana. She will test with a larger set of pages.
Status: NEW → ASSIGNED
Accepting -- will test the patch and check it in.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
The fix works for all the cases I tested, and doesn't hurt any of the existing automated test cases. Checked in.
Whiteboard: [PDT+] [by 12/10] Rick will help look at it when he gets back → [PDT+] will verify in 11/30 build.
will verify in 11/30 build.
Status: RESOLVED → VERIFIED
sujay, I just case test it via akkana's reproduce proposal, because editor's dialog boxes seem broken. Does someone else see this: bash$ cat /usr/src/mozilla/dist/bin/test.html <html><head></head> <body> <div type="_moz">bla <a href="http://www.m.o/1">link</a> bla <a href="http://www.m.o /3">link1</a></div><div type="_moz"> <a href="http://www.m.o/3">link2</a> bla <a href="http://www.m.o/2">li<b>n</b>k</a> bla <a href="ozuio">link </a>bla<a href="uiozp"> link</a> bla </div></body> </html> but bash$ ./mozilla-apprunner.sh -edit file:/usr/src/mozilla/dist/bin/test.h [...] Getting HTML [Debug|Output HTML] <html><head></head> <body> <div type="_moz">bla <a href="http://www.m.o/1">link</a> bla <a href="http://www.m.o/3">link1</a></div><div type="_moz"> <a href="http://www.m.o/3">link2</a> bla <a href="http://www.m.o/2">li<b>n</b>k&lt; /a&gt; bla </a><a href="ozuio">link </a>bla<a href="uiozp"> link</a> bla </div></body> </html> (note the escaped "</a>")?
Blocks: 20870
No longer blocks: 20870
You need to log in before you can comment on or make changes to this bug.