BGCOLOR does not work without a # char in the color code on table which is output dynamically using getElementByID function and innerHTML property

RESOLVED FIXED in mozilla1.5alpha

Status

()

P1
trivial
RESOLVED FIXED
16 years ago
10 years ago

People

(Reporter: madwent, Assigned: bzbarsky)

Tracking

Trunk
mozilla1.5alpha
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

16 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624

In the page at http://noby.cubicproductions.com/bugzillatest/, all three tables
should appear in green. Two of them are dynamically output, one is static. The
code for the first table and the third table are identical except that the first
is being output by javascript to a DIV tag. The only difference between the two
dynamically output tables is that one does not contain a # in the color code. In
Mozilla, the first table is displayed with no explicit background color (it
should be green).

Reproducible: Always

Steps to Reproduce:
1. Write a standard HTML table with one TD in it. Using BGCOLOR, set the
background color to, say, green 00FF00. Omit the # character from the color code.
2. Write this table to a div tag using getElementById and innerHTML.
3. Launch Mozilla, view the output. 
Actual Results:  
The table did not have a background color.

Expected Results:  
The table should have appeared as it does if it is statically output (versus
output by javascript). It should have appeared with a background color.

This happens on a couple other copies of Mozilla, all 1.4 and all on Windows XP
systems. Not sure about any other platforms/etc.
(Assignee)

Comment 1

16 years ago
Created attachment 126935 [details] [diff] [review]
patch

We have to pass the right document in; otherwise we get standards-mode parsing
for fragments....
(Assignee)

Updated

16 years ago
Attachment #126935 - Flags: superreview?(jst)
Attachment #126935 - Flags: review?(jkeiser)
(Assignee)

Comment 2

16 years ago
taking.
Assignee: dom_bugs → bzbarsky
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Priority: -- → P1
Hardware: PC → All
Target Milestone: --- → mozilla1.5alpha
Comment on attachment 126935 [details] [diff] [review]
patch

already_AddRefed<nsIDocument> nsGenericElement::GetOwnerDocument() would indeed
be useful :-)

sr=jst
Attachment #126935 - Flags: superreview?(jst) → superreview+

Comment 4

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

r=me, though I'd rather prefer that logic be in a helper function too ... r=me
as well if you want to do GetOwnerDocument()

Comment 5

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

r=me, though I'd rather prefer that logic be in a helper function too ... r=me
as well if you want to do GetOwnerDocument()
Attachment #126935 - Flags: review?(jkeiser) → review+
(Assignee)

Comment 6

16 years ago
Bug 211634 filed on the GetOwnerDocument thing -- I'd like to make that a
tree-wide sweep as I do it.

Patch checked in.
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED

Updated

10 years ago
Component: DOM: HTML → DOM: Core & HTML
QA Contact: desale → general
You need to log in before you can comment on or make changes to this bug.