Closed Bug 379461 Opened 15 years ago Closed 14 years ago

[CSS21] Make XHTML <body> magic just like HTML <body>

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.9beta4

People

(Reporter: zcorpan, Assigned: dbaron)

References

(Depends on 1 open bug, Blocks 1 open bug, )

Details

Attachments

(9 files, 2 obsolete files)

337 bytes, application/xhtml+xml
Details
379 bytes, application/xhtml+xml
Details
799 bytes, text/html
Details
564 bytes, application/xhtml+xml
Details
832 bytes, application/xhtml+xml
Details
1016 bytes, text/html
Details
1016 bytes, application/xhtml+xml
Details
9.86 KB, patch
bzbarsky
: review+
bzbarsky
: superreview+
mtschrep
: approval1.9+
Details | Diff | Splinter Review
6.98 KB, patch
Details | Diff | Splinter Review
User-Agent:       Opera/9.20 (Windows NT 5.1; U; en)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a5pre) Gecko/20070502 Minefield/3.0a5pre

<body> is magic in HTML but not in XHTML, and there are bugs in some edge cases. (Note that this bug is invalid per the current spec, but the plan is to change the spec: http://lists.w3.org/Archives/Public/www-style/2007Apr/0196.html )

Reproducible: Always

Steps to Reproduce:
1. Run the test cases.
2.
3.
Actual Results:  
'background-color', 'background-image' and 'overflow' is not handled equivalently between HTML and XHTML, and there are some bugs in the edge cases as well.

Expected Results:  
'background-color', 'background-image' and 'overflow' should work the same in both HTML and XHTML when applied to <body>. Edge cases should be handled as what the current spec says should happen for HTML.
Sorry, the Actual Results should say:

'background-color' and 'background-image' are not handled equivalently between HTML and XHTML, and there are some bugs in the edge cases as well.


(i.e., all tests on overflow pass already.)
Attachment #263546 - Attachment mime type: application/xhtml+xml → text/html
"but the plan is"...can we close that bug for now and open a new one when the spec has been changed for sure?
What do other browsers that support XHTML do here?
(In reply to comment #7)
> "but the plan is"...can we close that bug for now and open a new one when the
> spec has been changed for sure?

No, the spec won't change until implementors do this. The CSSWG said:

[[
This means that we reserve the possibility of making BODY in XHTML1 an 
exception, just like BODY in HTML, if we consider that the state of 
implementations makes it necessary. We'll make that decision no sooner 
than six months after publication of the document as a Candidate 
Recommendation.
]] -- http://lists.w3.org/Archives/Public/www-style/2007Apr/0196.html
(In reply to comment #8)
> What do other browsers that support XHTML do here?

Opera treats 'background-color' and 'background-image' the same between HTML and XHTML, but treats 'overflow' differently.

WebKit treats all of 'background-color', 'background-image' and 'overflow' differently.

Gecko treats 'background-color' and 'background-image' differently between HTML and XHTML, but treats 'overflow' equivalently.

I've added a table with the results at the bottom of http://simon.html5.org/test/css/magic-body/

HTH,
Found out that this overflow test actually fails... (also the equivalent .xht).
I can confirm the bug with body an background-color style.
In HTML mode firefox fills all the canvas with the body's bg-color, but in XHTML mode it fills only the body itself, and everything outside is white.
Opena and Konqueror do not have the problem.
attachment 264695 [details] and attachment 264696 [details] work for me on trunk.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached patch patch (obsolete) — Splinter Review
Been meaning to get this in.
Assignee: nobody → dbaron
Status: NEW → ASSIGNED
Comment on attachment 303605 [details] [diff] [review]
patch

An interdiff -w /dev/null this-patch shows:

@@ -3151,3 +3151,2 @@
         if (htmlDoc) {
-          if (!document->IsCaseSensitive()) { // HTML, not XHTML
             nsCOMPtr<nsIDOMHTMLElement> body;
@@ -3172,2 +3171 @@
         }
-      }
Attachment #303605 - Flags: superreview?(bzbarsky)
Attachment #303605 - Flags: review?(bzbarsky)
Comment on attachment 303605 [details] [diff] [review]
patch

r+sr=bzbarsky
Attachment #303605 - Flags: superreview?(bzbarsky)
Attachment #303605 - Flags: superreview+
Attachment #303605 - Flags: review?(bzbarsky)
Attachment #303605 - Flags: review+
Comment on attachment 303605 [details] [diff] [review]
patch

Very low risk patch to make it easier for authors to switch from HTML to XHTML.
Attachment #303605 - Flags: approval1.9?
Attached patch patch (obsolete) — Splinter Review
Attachment #303605 - Attachment is obsolete: true
Attachment #303674 - Flags: approval1.9?
Attachment #303605 - Flags: approval1.9?
Attachment #303674 - Flags: approval1.9?
Attached patch patchSplinter Review
Missed a case for backgrounds and another one relevant to scrollbars.  Added tests for both.
Attachment #303674 - Attachment is obsolete: true
Attachment #303676 - Flags: superreview?(bzbarsky)
Attachment #303676 - Flags: review?(bzbarsky)
Attachment #303676 - Flags: superreview?(bzbarsky)
Attachment #303676 - Flags: superreview+
Attachment #303676 - Flags: review?(bzbarsky)
Attachment #303676 - Flags: review+
Comment on attachment 303676 [details] [diff] [review]
patch

comment 18 still applies for this approval request
Attachment #303676 - Flags: approval1.9?
Attachment #303676 - Flags: approval1.9? → approval1.9+
I also needed to make these adjustments to existing reftests, plus run 379461-3  (added in attachment 303676 [details] [diff] [review]; diffs to adjust not included in this patch) inside an iframe so that the scrollbars would show up in the drawWindow.
Landed 2008-02-19 08:46/47 -0800, backed out 2008-02-19 09:28 -0800 due to reftest failures (See comment 22), and relanded 2008-02-19 10:46 -0800 with reftest fixes.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9beta4
verified fixed using  Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b4pre) Gecko/2008022005 Minefield/3.0b4pre. Also verified on 10.5 - I verified using all of the test cases in the bug.
Status: RESOLVED → VERIFIED
(In reply to comment #25)

Can you file a new bug on these, please?
Filed bug 421469.
Depends on: 459808
Blocks: 421469
Depends on: 477415
You need to log in before you can comment on or make changes to this bug.