Closed Bug 47522 Opened 20 years ago Closed 15 years ago

</>, <> should close/open the most recently opened tag in HTML

Categories

(Core :: DOM: HTML Parser, defect, P4, trivial)

defect

Tracking

()

RESOLVED WONTFIX
Future

People

(Reporter: dpotter, Assigned: mrbkap)

References

()

Details

(Keywords: html4)

</> can be used to close SGML tags, and according to the W3C, it can be used to 
do so in HTML 4.0 too.  (It is, however, ILLEGAL to do so in XML/XHTML.)  In 
other words, <font color="red">this text would be rendered in red</> while this 
text wouldn't.

Most web pages don't use this construct, so it's really very trivial, but it is 
part of the HTML 4.01 standard.  (A list of features not widely supported, 
including this one, is given at this 
URL: <http://www.w3.org/TR/html4/appendix/notes.html#sgmlfeatures>.)  I haven't 
actually tried some of the other "commonly not supported" SGML features, though.  
Unfortunately, they seem to have removed the section that actually explains what 
the various things do.  (I'm not sure exactly what <> does - but it has meaning 
in SGML.)

Keep in mind that XML was a stricter set of rules than HTML, so that </> is NOT 
legal in XML.
confirming
Status: UNCONFIRMED → NEW
Ever confirmed: true
confirming
Not a high priority issue. Marking FUTURE.
Target Milestone: --- → Future
Marking future, as navigator has never supported this capability.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → REMIND
Whiteboard: future
reopening and marking Future...
Status: RESOLVED → REOPENED
Resolution: REMIND → ---
updated qa contact.
QA Contact: janc → bsharma
cc'ing Clarence, who's implementing all kinds of nifty SGML pedantry.
Clarence, do you want to take this?  I understand rickg isn't working on parsing
stuff anymore...
I think harishd should at least be cc'd on this bug, or any similar bug.

/be
This isn't easy to implement if it should work in all cases. Basically the
tokenizer would need its own stack of open elements. But it would be easy to do
in CNavDTD, using its element stack. Same for "<>".

Taking bug, but leaving futured until I know if the DTD method works reliably
for valid documents.
Assignee: rickg → c
Status: REOPENED → NEW
OS: Windows NT → All
Priority: P3 → P4
Hardware: PC → All
Summary: </> should close the most recently opened tags in HTML → </>, <> should close/open the most recently opened tag in HTML
Whiteboard: future
QA Contact: bsharma → moied
This bug is an instance of missing SHORTTAG support.  The case here is the
parsing of Empty Tags.  There are other things that the parser must support in
order to properly parse HTML 4.0.

Most are detailed at <http://www.best.com/~sem/dark_side/>.  The information in
the document is accurate, notwithstanding the author mentioning at the bottom
that the document is considered dead.

Others SHORTTAG special cases to parse include::

- Null End Tags: <H1/Header with null-end tag/
- Unclosed Tags:   <b<i>bold and italic at once</b</i>

I've collected example files and links to the  W3C's validator for the example
files at <http://www.math.berkeley.edu/%7Eroconnor/dark_side/>

Feel free to add these examples as attachements to this bug if you want to.
Blocks: html4.01
I'm not totally sure if this is the same problem.

I get blank/empty tags when there are two like tags next to each other, and I
press delete while i'm between the two tags. It looks like this:

<>this was a div tag before delete was pressed</>


Here is an example:

I have an editable document in an iframe for a rtf editor.  If I have content in
the editable document like so:


Html - User View
------------------------------------------------------------------------------
The next word is formatted. This is not formatted but in the same h1.
This is in a new h1 and has a class applied to it.
------------------------------------------------------------------------------

Html - Code View
 ------------------------------------------------------------------------------
<h1 class="style1">The next word is <span
style="font-weight:bold;">formatted</span>. This is not formatted but in the
same h1.</h1><h1 class="style2">This is in a new h1 and has a class applied to
it.</h1>
-------------------------------------------------------------------------------


In the user view if you go to the end of a line with the cursor:

"The next word is formatted. This is not formatted but in the same h1.|cursor|"

And press delete mozilla's editor does this:

Html - Code View
 ------------------------------------------------------------------------------
<>The next word is <span style="font-weight:bold;">formatted</span>. This is not
formatted but in the same h1.This is in a new h1 and has a class applied to it.</>
-------------------------------------------------------------------------------

Once this has happened, I have to then check from the current node back up to
the body tag to makes sure the mozilla editor hasn't left <> blank tags behind it.

Is this the way the mozilla is suppose to function when joining like tags in an
editable document?
tyson@mcmds.com: for now please see bug 251466
Keywords: html4
*** Bug 206832 has been marked as a duplicate of this bug. ***
This feature is basically obsolete per HTML 5. Mozilla should probably WONTFIX
this on basis of HTML 4 or INVALID it on the basis Mozilla is going to implement
HTML 5. (And Mozilla is working on support.)
Assignee: c → mrbkap
QA Contact: moied → parser
This won't be implemented (we're not really a SGML browser).
Status: NEW → RESOLVED
Closed: 20 years ago15 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.