Bug 18220 - XHTML MIME type breaks layouts
Summary: XHTML MIME type breaks layouts
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-30 11:21 PDT by Kay Summers
Modified: 2008-04-18 22:30 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kay Summers 2008-03-30 11:21:22 PDT
If I send valid XHTML content as application/xhtml+xml rather than text/html, numerous things go horribly wrong with the layout, especially with the interpretation of the body tag.

A simple example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Test</title>
    </head>
    <body style="margin: 0px; width: 100%; height: 100%; background-color: #bbb;">  
        Test
    </body>
</html>

When sent as XHTML, WebKit refuses to paint the background color across the entire background. Additional content will evoke strange margin behavior all around and nothing will render as expected. When sent as HTML, it does the right thing.

The one and only reason I care about this is because sending documents as application/xhtml+xml is required in order to get inline SVG to work.
Comment 1 Alexey Proskuryakov 2008-03-31 23:09:54 PDT
The behavior seen on this test is correct: the body is only as high as its content is. See, for example, <http://www.xml.com/pub/a/2003/03/19/dive-into-xml.html> and <http://www.mozilla.org/docs/web-developer/faq.html#xhtmldiff>.

The other differences that you are seeing might be bugs or expected behavior, no way to tell without a test case.
Comment 2 Matt Lilek 2008-04-18 22:30:17 PDT
*** Bug 18503 has been marked as a duplicate of this bug. ***