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)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 162653

People

(Reporter: tunah.bugzilla, Assigned: harishd)

References

()

Details

Attachments

(1 file)

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.
This validates as XHTML/1.1 strict.
Attachment #114628 - Attachment mime type: text/html → application/xhtml+xml
Are you correctly serving the file as application/xhtml+xml, as required in XHTML 1.1?
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.
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?
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
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
Resolution: INVALID → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: