Closed Bug 1258108 Opened 10 years ago Closed 10 years ago

[quirks mode] first absolute positioned element has different default margin-top, comparing to second element

Categories

(Core :: Layout, defect)

x86_64
macOS
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: zhourenjian, Unassigned)

Details

(Keywords: testcase)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36 Steps to reproduce: Use Firefox to visit a page with following HTML (or open the attached file) will get an unexpected page layout: <html> <head></head> <body> <!--<span></span>--><!-- any HTML element here will fix the following incorrect margin, uncomment to see following 2 os joining as 1 o. --> <p style="position: absolute; left: 239.067px; top: 74.8749px; color: red;">o</p><!-- BUG line here: wrong layout with incorrect margin --> <p style="position: absolute; left: 239.067px; top: 74.8749px; color: blue;">o</p><!-- should be on exactly the same position of the above o. --> <p style="position: absolute; left: 221.831px; top: 86.8042px;">o</p> <p style="position: absolute; left: 208.957px; top: 99.6888px;">o</p> <p style="position: absolute; left: 199.811px; top: 112.004px;">o</p> </body> </html> Actual results: The first P element and the second P element are not in the same position. From Inspector, the first P element has default "margin-top:0; margin-bottom:16px;", the second and following P elements have default "margin-top:16px; margin-bottom:16px;". This margin-top differences makes two P elements located in two places. Insert other elements in between BODY and first P element will make first P element having default "margin-top:16px; margin-bottom:16px;". Expected results: The first P element and the second P element, which are absolute positioned with same left and top value should be in the same position. And they should have same default margin values, especially for absolute positioned elements.
This attached page (without other element in between BODY and first P element) show incorrect layout.
Component: Untriaged → Layout
Product: Firefox → Core
Keywords: css1
OS: Unspecified → Mac OS X
Hardware: Unspecified → x86_64
The testcases are missing a <!DOCTYPE HTML> so we render them in "quirks mode", which has this rule: http://mxr.mozilla.org/mozilla-central/source/layout/style/res/quirk.css#72 I don't think we want to mess with this stuff at this point due to the web compat risk of doing changes in this area. You can easily workaround the issue by adding a DOCTYPE.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Keywords: css1testcase
Resolution: --- → WONTFIX
Summary: CSS layout: first absolute positioned element has different default margin-top, comparing to second element → [quirks mode] first absolute positioned element has different default margin-top, comparing to second element
OK. Different browsers has different quirks modes. Webkit based browsers, Google Chrome, Safari and Mobile Safari, get things correct.
If you want compatible cross-browser rendering then you should definitely use a DOCTYPE to trigger Standards Mode rendering.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: