[FIX]Background set on "body" element does not work in XML if "html" background not set

RESOLVED FIXED in mozilla1.0

Status

()

Core
Layout
P2
normal
RESOLVED FIXED
16 years ago
16 years ago

People

(Reporter: bz, Assigned: bz)

Tracking

Trunk
mozilla1.0
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

BUILD: 2002-02-22-08

STEPS TO REPRODUCE:
1)  Load first attachment
2 [details] [diff] [review])  Observe lack of green background where it should be
3)  Load second attachment
4 [details] [diff] [review])  Observe background is correct

This has the smell of bodyfixuprule stuff to it.  :(
Created attachment 71030 [details]
Testcase with background on <body>
Created attachment 71032 [details]
Testcase with background on <body> and on <html>
Created attachment 71033 [details]
Same as first attachment, but as text/html
I vaguely remember that the HTML working group doesn't want the "For HTML"
special cases in CSS to apply to XHTML, although I'm not sure.  In that case,
it's the BODY node that we're handling wrong rather than the HTML node.  I
suspect the asymmetry between FindCanvasBackground and FindElementBackground
that's causing this bug is something like the BODY element in XHTML documents
being an nsIDOMHTMLBodyElement, but the document not being an nsIHTMLDocument.
Created attachment 71039 [details] [diff] [review]
Possible patch

Indeed.  Bailing from FindElementBackground if we're not in an HTML document
works... (the patch fixes this bug).  Tested this on the three testcases here
and on some XHTML served as text/html pages with and without backgrounds
defined on <html>.  Seems to do the right thing everywhere.

This fix will work for now, and is needed in general for XHTML as text/xml. 
Eventually I think we plan to make XHTML as application/xhtml+xml create an
nsIHTMLDocument, so at that point we'll need to rethink this code...  But
that's not happening any time in the near future, if at all.
Comment on attachment 71039 [details] [diff] [review]
Possible patch

r=dbaron
Attachment #71039 - Flags: review+
taking bug
Assignee: dbaron → bzbarsky
Priority: -- → P2
Summary: Background set on "body" element does not work in XML if "html" background not set → [FIX]Background set on "body" element does not work in XML if "html" background not set
Target Milestone: --- → mozilla1.0

Comment 8

16 years ago
Comment on attachment 71039 [details] [diff] [review]
Possible patch

sr=attinasi
Attachment #71039 - Flags: superreview+
Comment on attachment 71039 [details] [diff] [review]
Possible patch

a=shaver for 0.9.9
Attachment #71039 - Flags: approval+
checked into trunk for 0.9.9
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.