[Webkit-unassigned] [Bug 15961] View source mode is missing the processing instruction line.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 12 16:31:39 PST 2007


http://bugs.webkit.org/show_bug.cgi?id=15961





------- Comment #1 from anyang.ren at gmail.com  2007-11-12 16:31 PDT -------
Created an attachment (id=17217)
 --> (http://bugs.webkit.org/attachment.cgi?id=17217&action=view)
Preliminary patch for discussion

This patch is intended to show where the problem is, even though
it is in the form of a fix.  I hope that the WebKit team can come up
with a better fix.

In HTMLTokenizer::write, after the call to parseProcessingInstruction
returns, we continue the while loop.  So we skip the processToken call
at the end of the switch statement, and the line is not added to the
HTMLViewSourceDocument by the addViewSourceToken call in
HTMLTokenizer::processToken.

I first tried removing the "continue" statement so that we fall through to
the processToken call after the switch statement.  But the parseTag call
after the processToken call caused an empty "<>" tag to be added after
the processing instruction line.  So I'm now calling processToken before
the continue statement.

The other changes in this patch add the characters of the processing
instruction line to 'buffer' (via the 'dest' pointer) so that they show up
in the output.  It is also necessary to remove the state.setDiscardLF(true)
statement so that we don't lose the LF after the processing instruction line
in the output.

Note that I mark the processing instruction line as a textAtom simply because
it is easier to work with HTMLTokenizer::processToken and
HTMLViewSourceDocument::addViewSourceToken to output a textAtom.
I believe the processing instruction line should be handled as a tag.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list