Closed
Bug 193634
Opened 22 years ago
Closed 22 years ago
Styles on self-closing elements applied until an explicit closing tag found
Categories
(Core :: DOM: HTML Parser, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 162653
People
(Reporter: tunah.bugzilla, Assigned: harishd)
References
()
Details
Attachments
(1 file)
(deleted),
application/xhtml+xml
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030210
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030210
If a tag that usually formats text, such as the <b> tag or the <a> tag has a css
style applied to it, then this style will be applied until an explicit closing
tag is given, even if the tag is self closing, as in <b />.
While an empty formatting tags may not make sense, they are allowed by the spec
and empty anchor tags are common. At any rate, <a /> should be treated the same
as <a></a>.
Reproducible: Always
Steps to Reproduce:
1. Load a document with styles applied to a text-formatting tag, in which there
is a self-closing form of this tag. Example:
http://tunah.net/~tunah/bugzilla/selfclosing.html
Actual Results:
The tag's style is applied to everything after the self-closing tag.
Expected Results:
The tag's style should not be applied to anything.
Reporter | ||
Comment 1•22 years ago
|
||
This validates as XHTML/1.1 strict.
Updated•22 years ago
|
Attachment #114628 -
Attachment mime type: text/html → application/xhtml+xml
Comment 2•22 years ago
|
||
Are you correctly serving the file as application/xhtml+xml, as required in
XHTML 1.1?
Reporter | ||
Comment 3•22 years ago
|
||
Probably not. I'll see if I can fix that.
But that's not the problem, I was testing this by loading this off hard disk.
BTW, IE6 does the same thing.
Reporter | ||
Comment 4•22 years ago
|
||
Okay, http://tunah.net/~tunah/bugzilla/selfclosing.html is served as text/html
and http://tunah.net/~tunah/bugzilla/selfclosing.xhtml is served as
text/xml+xhtml, which my Mozilla won't display. When told to open it in the
default application (mozilla) it displays the XML tree. Don't know why that is,
but the text/html is displayed in standards compliance mode and has the correct
xhtml strict identifying marks, so I, as a humble end-user, would expect it to
render correctly. Is there some reason why it shouldn't?
Comment 5•22 years ago
|
||
If you serve anything as text/html, it will be treated as HTML. Thus, you have
to be very careful if you want an XHTML file to be properly displayed as HTML.
>text/xml+xhtml
this should be xhtml+xml
Comment 6•22 years ago
|
||
This is invalid. <foo/> is _NOT_ a closed tag in HTML and we do not and will
not parse it that way in text/html content.
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
Updated•18 years ago
|
Resolution: INVALID → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•