p in td has usual margins in standards mode

RESOLVED WONTFIX

Status

--
minor
RESOLVED WONTFIX
16 years ago
4 years ago

People

(Reporter: kevinar18, Assigned: susiew)

Tracking

Details

(URL)

Attachments

(2 attachments)

(Reporter)

Description

16 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3a) Gecko/20021212

http://www.ntfs.org/ defines their DOCTYPE as "DTD XHTML 1.0 Transitional."
One of the requirements of XHTML is that all tags be closed.  For example, 
<p></p>
However, NTFS.org contains several tags that are open, which are causing 
rendering problems in Mozilla as a result.  I understand that this is 
incorrect coding; however, is there a reason for Mozilla displaying the page 
differently just because of the DOCTYPE being different?
Before answering, consider the following code below:


Reproducible: Always

Steps to Reproduce:
Based off of NTFS.org:

1. They Declared a doctype as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

2. The did not close several <p> tags as evidenced by the following code:
      <table border="0" cellpadding="0" cellspacing="0" width="100%" 
background="ekkoimages/linebg.gif">

        <tr>
          <td width="75%" background="ekkoimages/ltgraybg.gif">
          <p align="right">
          <img border="0" alt="edge" src="ekkoimages/edge.gif" width="24" 
height="30"></td>
          <td width="25%">
          <p align="right">
          <a href="forum/index.php">
          <img alt="NTFS.org" border="0" src="ekkoimages/nav_forums.gif" 
width="89" height="30"></a></td>
        </tr>

      </table>

Actual Results:  
The results of doing this can be seen by comparing IE and Mozilla.
In Mozilla, there are noticeable problems in the menu at the top.

Expected Results:  
As for expected results, I am unsure.  I realize this is incorrect coding.  
However, is there something else in the W3C specs that says that Mozilla 
should be rendering the page in this manner?

I've noticed that if you remove the DOCTYPE, Mozilla renders the page fine.  
Thus, perhaps there is something in the W3C specs I am not aware of.
(Reporter)

Comment 1

16 years ago
BTW, I will upload some testcases as soon as I can get my computer fixed to 
allow it.

Anyways, I did a little searching and I'm still unsure of what the W3C 
recommendations are in regards to when it encounters bad XHTML/XML.  Could 
someone refer me to it if it's in there?
(Reporter)

Comment 2

16 years ago
Created attachment 111743 [details]
Example of Issue

Shows what happens when the DTD is included.
(Reporter)

Comment 3

16 years ago
Created attachment 111744 [details]
Example without DTD
(Reporter)

Updated

16 years ago
Component: DOM Abstract Schemas → XML
Summary: Issue rendering erroneous <p> tag using XHTML DOCTYPE → Issue rendering open <p> tag using XHTML DOCTYPE
(Reporter)

Comment 4

16 years ago
Adding XML Component owner to CC since I don't have rights to reassign owners.
This is not an XML problem, it's a quirks vs. strict mode problem. XML would
only apply if they served it with a correct content-type (text/xml,
application/xml, application/xhtml+xml). Sending to layout. (heikki, I hope you
don't remind my removing your cc, but afaict this isn't something you need to
worry about)
Assignee: jst → other
Component: XML → Layout
Keywords: qawanted
QA Contact: stummala → ian
Christopher, you are correct, and I don't mind :)

If anyone is interested in the quirks, standards, and almost standards modes
Mozilla has, you can read about it in here:
http://www.mozilla.org/docs/web-developer/quirks/doctypes.html
In the standards mode, <p> has the usual margins from the UA style sheet. In the
quirks mode, there are additional UA style sheet rules for suppressing the top
margin of a <p> that is the first node in a <td> and the bottom margin of a <p>
that is the last node in a <td>.

This is not a bug as far as the specs go, since Mozilla is free to have those
margins in the UA style sheet. Because the standards mode UA style sheet should
work in a predictable way, I'm pretty sure the special margin suppressing rules
are not wanted there.

So I'm pretty sure this is INVALID/WONTFIX, but I'm not the module owner.
Keywords: qawanted
Summary: Issue rendering open <p> tag using XHTML DOCTYPE → p in td has usual margins in standards mode
(Reporter)

Comment 8

16 years ago
Henri Sivonen, could explain that a little bit further?  I am not familiar 
with some of the things you referred to.  I'm not sure if it's appropriate to 
do so here, but maybe via email.

Comment 9

16 years ago
-> Tech Evangelism

<p align="right"> should be <div align="right">
Assignee: other → susiew
Status: UNCONFIRMED → NEW
Component: Layout → US General
Ever confirmed: true
Product: Browser → Tech Evangelism
QA Contact: ian → zach
Version: Trunk → unspecified
(Reporter)

Comment 10

16 years ago
Removing align="right" does not fix the issue.
Component: US General → Layout
Product: Tech Evangelism → Browser
Version: unspecified → 1.0 Branch
really reassign to tech evang
Component: Layout → US General
Product: Browser → Tech Evangelism
Version: 1.0 Branch → unspecified
(Reporter)

Comment 12

16 years ago
There is no need to contact the author of the site about the problem.  He 
already knows.  This report is not a question of getting the site fixed, but 
as to why Mozilla is set up to work in this manner.  If this is an issue for 
which the standards allow, then this bug should be closed and not moved to 
another area.
Mozilla works this way because <p> is an element for the representation of
*paragraphs*, and the margins given to the <p> element are consistent with the
usual typography of such material. Because they are often mis-used in "tag-soup"
and table-based layout, such as the type which appears in the sample below,
Mozilla's "quirks mode" contains additional rules to suppress the margins in
this situation. However, the DOCTYPE of the page is sufficiently new that it
triggers "standards mode", which assumes that <p> elements are actually used to
represent paragraphs and does not suppress these margins. I can only assume that
IE renders it in a way that continues to suppress the margins. Neither rendering
is inconsistent with the HTML specifications; however, because standards mode is
intended to promote meaningful, non-presentational markup, it is not expected
that standards mode behavior will be changed to match that of IE on this page.

I would suggest either changing the DOCTYPE to one more suitable for the current
design (I see no particular reason for the site to be XHTML) or adopting a
CSS-based layout rather than relying on tables and the various presentational
HTML attributes.
(Reporter)

Comment 14

16 years ago
Marking as WONTFIX.
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → WONTFIX
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.