Closed Bug 226099 Opened 21 years ago Closed 20 years ago

[RFE] Highlight "<![CDATA[" and matching "]]>" in View Source

Categories

(Core :: DOM: HTML Parser, enhancement)

x86
Windows 2000
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: levertond, Assigned: mrbkap)

References

Details

Attachments

(3 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007

The opening and closing markup of a CDATA section should be highlighted in the
View Source window.

Reproducible: Always

Steps to Reproduce:
1. Open XML/XHTML page containing a CDATA section.
2. View the source.

Actual Results:  
Source window opens, with the "<![CDATA[" and "]]>" markup in the same colour as
regular text, making it harder to distinguish.

Expected Results:  
"<![CDATA[" and "]]>" should be highlighted.
Can You give an example?
I see CDATA in different color than normal text.
Dup of the general "XML view source uses the HTML tokenizer" stuff.  The problem
is that the content of <script> tags is not tokenized as CDATA by the HTML
tokenizer.  Regular CDATA sections are.
Whiteboard: DUPEME

*** This bug has been marked as a duplicate of 91240 ***
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
Whiteboard: DUPEME
Reopening, since we've decided there is no reasonable way to use the expat
tokenizer, so we'll fix the XML bugs one at a time.
Blocks: 91240
Status: VERIFIED → UNCONFIRMED
Resolution: DUPLICATE → ---
bz, I'm not sure how possible this is. We could ignore <script> and <style> when
processing XML in the tokenzier (i.e., treat them as any other tags, as happens
in XML), but this sort of change scares me. Maybe restricting the behavior to
view-source + XML would be better.

Otherwise, this should be WONTFIX.
Blake, the only time XML should be going through the HTML tokenizer is for view
source.  So you could just treat them normally for XML and assert that we're in
view source, I think.
Confirming, taking and moving to Parser (as that is where the changes are going
to have to take place).
Assignee: doronr → mrbkap
Status: UNCONFIRMED → NEW
Component: ViewSource → HTML: Parser
Ever confirmed: true
Attached patch patch v1Splinter Review
While technically this doesn't fill the RFE (to only highlight the <![CDATA[
and the ]]>), this is as close as we're going to get until marked sections are
parsed properly.
Attachment #161725 - Flags: review?(bzbarsky)
Comment on attachment 161725 [details] [diff] [review]
patch v1

r=bzbarsky assuming you've tested the effect this has on <script>, <style>,
<textarea> in XML documents...
Attachment #161725 - Flags: review?(bzbarsky) → review+
Comment on attachment 161725 [details] [diff] [review]
patch v1

bz: I've just tested that they all still work. Of course, if this patch had
broken XML documents, something would have been seriously wrong (and the assert
would have told me).

rbs, could you sr?
Attachment #161725 - Flags: superreview?(rbs)
I meant on view-source of XML documents.  I agree that this should not affect
actual XML rendering in any way.  ;)
Comment on attachment 161725 [details] [diff] [review]
patch v1

sr=rbs
Attachment #161725 - Flags: superreview?(rbs) → superreview+
Marking fixed as timeless checked this in.
Status: NEW → RESOLVED
Closed: 21 years ago20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: