Closed
Bug 83221
Opened 24 years ago
Closed 20 years ago
<style>,<script> is automatically closed in view-source
Categories
(Core Graveyard :: View Source, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: megabyte, Assigned: doronr)
References
Details
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9+) Gecko/20010527
BuildID: 2001052720
<style> is automatically closed with </style> even if it doesn't exist in the
original document
Reproducible: Always
Steps to Reproduce:
1. Create a page with an unclosed <style> tag
2. Load it in Mozilla
3. View Source
Actual Results: You'll see <style></style>
Expected Results: It shouldn't have closed it automatically. Since when does
Mozilla ever fix people's web pages for them? There may be reasons to leave it
open.. we shouldn't assume.
I can't remember if I filed this bug before... many many months ago. I can't
seem to find it and since it still exists, I'm filing anyway.
Comment 1•24 years ago
|
||
Er... All the existing browsers have fairly error-tolerant parsing. Otherwise
90% of the pages out there will not display. Inserting a </style> upon
detecting </head> while processing content inside a <style> tag seems like a
reasonable thing to do....
Is the bug here just that view source shows the output of the parser instead of
the original source?
It's just a _demo_ of bug 55583.
Marking dupe.
*** This bug has been marked as a duplicate of 55583 ***
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
Clearing mis-attributed dup. This bug is because view-source appears to build a
well-formed content model. The other bug is about the document being re-fetched
from the server (rather than using the cached copy sitting in the client).
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
Confirming. I am also seing the problem with <script>.
Not sure about the severity tough.
Assignee: clayton → harishd
Status: UNCONFIRMED → NEW
Component: HTML Element → Parser
Ever confirmed: true
In viewsource we should try to preserve the original document AMAP. But, I
wouldn't sweat on this now. IMO, this a very low priority. Setting to
FUTURE...unless somebody is willing to work on this. Boris, rbs?? ;-)
Target Milestone: --- → Future
Reporter | ||
Comment 7•24 years ago
|
||
I should note that if the <style> (or <script>) is in the <body>, and then any
other tag comes after, it automatically closes the <style>, so it's not just a
</head> thing. Older browsers stop rendering upon an unclosed <style>, which I
think is a good thing-- makes designers fix their bad markup.
Reporter | ||
Updated•23 years ago
|
Comment 8•23 years ago
|
||
I guess harishd fixed this for <script/>, but not for an unclosed <script>, in
bug 44186.
Comment 9•23 years ago
|
||
*** This bug has been marked as a duplicate of 57724 ***
Status: NEW → RESOLVED
Closed: 24 years ago → 23 years ago
Resolution: --- → DUPLICATE
Comment 10•23 years ago
|
||
Reopening 57724 dependencies for independent resolution.
Reporter | ||
Updated•23 years ago
|
Summary: <style> is automatically closed with </style> even if it doesn't exist in the original document → <style>,<script> is automatically closed with </style>,</script> even if it doesn't exist in the original document
Reporter | ||
Comment 11•23 years ago
|
||
*** Bug 127043 has been marked as a duplicate of this bug. ***
Comment 12•23 years ago
|
||
Fixing mangled summary.
Summary: <style>,<script> is automatically closed with </style>,</script> even if it doesn't exist in the original document → <style> is automatically closed with </style> in view source even if it doesn't exist in the original document
Reporter | ||
Comment 13•23 years ago
|
||
remangling summary (see previous comments)
Summary: <style> is automatically closed with </style> in view source even if it doesn't exist in the original document → <style>,<script> is automatically closed with </style>,</script> in view source even if it doesn't exist in the original document
Comment 14•22 years ago
|
||
*** Bug 182420 has been marked as a duplicate of this bug. ***
Reporter | ||
Comment 15•21 years ago
|
||
Changing summary to what it really should be. The view-source part is just bug
57724, but the actual tag closing affects rendering.
Summary: <style>,<script> is automatically closed with </style>,</script> in view source even if it doesn't exist in the original document → <style>,<script> is automatically closed if another HTML tag is reached
Comment 16•21 years ago
|
||
Imo, the non-viewsource part should be WONTFIX.....
Comment 17•21 years ago
|
||
The fact that its actually modifying the source code causes other problems, take
this for example:
<textarea wrap="soft" name="fdata" cols="100" style="width: 90%"
rows="25">$banner .= "<script type='text/javascript'\n;
$banner .=" src=''>\n";
$ibforums->skin['template'];</textarea>
Mozilla modifies it to be like this:
<textarea wrap="soft" name="fdata" cols="100" style="width: 90%"
rows="25">$banner .= "<script type='text/javascript'\n;
$banner .=" src=''>\n";
$ibforums-></script>skin['template'];</textarea>
This means that including <script ... in a textarea without a closing tag is
basically impossible and creates all sorts of problems... this needs to be
resolved soon so people can include code like that in forms...
Comment 18•21 years ago
|
||
Including something like that in a textarea without escaping the '<' chars as
< is totally illegal in HTML in the first place.... We make it work as much
as painlessly possible, but it's not perfect by any means.
Comment 19•21 years ago
|
||
I'm implicitly wontfixing the non-view-source part of this bug.
Assignee: harishd → doronr
Status: REOPENED → NEW
Component: HTML: Parser → ViewSource
Summary: <style>,<script> is automatically closed if another HTML tag is reached → <style>,<script> is automatically closed in view-source
Target Milestone: Future → ---
Comment 20•20 years ago
|
||
bz fixed this bug in bug 64799, marking this one as such.
Status: NEW → RESOLVED
Closed: 23 years ago → 20 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 21•20 years ago
|
||
This had nothing to do with <textarea>. Reopening.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 22•20 years ago
|
||
Note that it would be trivial to modify the code I added in bug 64799 to fix
this, I think. Just add a check for view-source in addition to the one for
PRESERVE_CONTENT.
That said, it may not be worth wasting time on given the plans for a separate
tokenizer...
Comment 23•20 years ago
|
||
*sigh*, the <script> has to be opened in the <body>. There is no bug if there is
an unclosed <script> tag in the <head>. I'll leave this open until I fix bug
188609. Sorry for the confusion (and bugspam).
Comment 24•20 years ago
|
||
*** Bug 240636 has been marked as a duplicate of this bug. ***
Comment 25•20 years ago
|
||
This was really fixed by bug 258082.
Status: REOPENED → RESOLVED
Closed: 20 years ago → 20 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•