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

VERIFIED FIXED in mozilla1.9beta4

Status

()

Core
CSS Parsing and Computation
VERIFIED FIXED
10 years ago
9 years ago

People

(Reporter: Simon Pieters, Assigned: dbaron)

Tracking

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

unspecified
mozilla1.9beta4
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(9 attachments, 2 obsolete attachments)

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
Mike Schroepfer
: approval1.9+
Details | Diff | Splinter Review
6.98 KB, patch
Details | Diff | Splinter Review
(Reporter)

Description

10 years ago
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.
(Reporter)

Comment 1

10 years ago
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.)
(Reporter)

Comment 2

10 years ago
Created attachment 263544 [details]
test case: background on body should fill the canvas
(Reporter)

Comment 3

10 years ago
Created attachment 263545 [details]
test case: background on body should fill the canvas even when it has bogus siblings
(Reporter)

Comment 4

10 years ago
Created attachment 263546 [details]
test case: background on body should not fill the canvas when root is not html:html
(Reporter)

Updated

10 years ago
Attachment #263546 - Attachment mime type: application/xhtml+xml → text/html
(Reporter)

Comment 5

10 years ago
Created attachment 263547 [details]
test case: when background on body is propagated to the canvas, it shouldn't have a background itself
(Reporter)

Comment 6

10 years ago
Created attachment 263549 [details]
test case: background on body when propagated to the canvas should be anchored at the root element

Comment 7

10 years ago
"but the plan is"...can we close that bug for now and open a new one when the spec has been changed for sure?
(Assignee)

Comment 8

10 years ago
What do other browsers that support XHTML do here?
(Reporter)

Comment 9

10 years ago
(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
(Reporter)

Comment 10

10 years ago
(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,
(Reporter)

Comment 11

10 years ago
Created attachment 264695 [details]
overflow/004.htm: overflow on non-HTML body not should propagate to the viewport

Found out that this overflow test actually fails... (also the equivalent .xht).
(Reporter)

Comment 12

10 years ago
Created attachment 264696 [details]
overflow/004.xht: overflow on non-HTML body not should propagate to the viewport

Comment 13

10 years ago
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.
(Assignee)

Comment 14

10 years ago
attachment 264695 [details] and attachment 264696 [details] work for me on trunk.
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 15

10 years ago
Created attachment 303605 [details] [diff] [review]
patch

Been meaning to get this in.
Assignee: nobody → dbaron
Status: NEW → ASSIGNED
(Assignee)

Comment 16

10 years ago
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+
(Assignee)

Comment 18

10 years ago
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?
(Assignee)

Comment 19

10 years ago
Created attachment 303674 [details] [diff] [review]
patch
Attachment #303605 - Attachment is obsolete: true
Attachment #303674 - Flags: approval1.9?
Attachment #303605 - Flags: approval1.9?
(Assignee)

Updated

10 years ago
Attachment #303674 - Flags: approval1.9?
(Assignee)

Comment 20

10 years ago
Created attachment 303676 [details] [diff] [review]
patch

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+
(Assignee)

Comment 21

10 years ago
Comment on attachment 303676 [details] [diff] [review]
patch

comment 18 still applies for this approval request
Attachment #303676 - Flags: approval1.9?

Updated

10 years ago
Attachment #303676 - Flags: approval1.9? → approval1.9+
(Assignee)

Comment 22

10 years ago
Created attachment 304291 [details] [diff] [review]
additional reftest adjustments

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.
(Assignee)

Comment 23

10 years ago
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
Last Resolved: 10 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
(Reporter)

Comment 25

10 years ago
FYI: Using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b4pre) Gecko/2008022714 Minefield/3.0b4pre these tests fail:

http://simon.html5.org/test/css/magic-body/background-color/006-declarative.xht
http://simon.html5.org/test/css/magic-body/background-color/006.htm
http://simon.html5.org/test/css/magic-body/background-color/006.xht
(same with background-image)

http://simon.html5.org/test/css/magic-body/overflow/004.htm
http://simon.html5.org/test/css/magic-body/overflow/004.xht
(the declarative equivalent passes)

http://simon.html5.org/test/css/magic-body/overflow/006-declarative.xht
http://simon.html5.org/test/css/magic-body/overflow/006.htm
http://simon.html5.org/test/css/magic-body/overflow/006.xht
(In reply to comment #25)

Can you file a new bug on these, please?
(Reporter)

Comment 27

10 years ago
Filed bug 421469.
(Assignee)

Updated

9 years ago
Depends on: 459808
(Assignee)

Updated

9 years ago
Blocks: 421469

Updated

9 years ago
Depends on: 477415
You need to log in before you can comment on or make changes to this bug.