Closed
Bug 33557
Opened 24 years ago
Closed 24 years ago
background-color: inherit on html:input type="text" only appears to check for background color on parent node
Categories
(Core :: DOM: Editor, defect, P3)
Tracking
()
VERIFIED
FIXED
M15
People
(Reporter: bugs, Assigned: pierre)
Details
Attachments
(2 files)
e.g. <html> <head> <style type="text/css"> #boo { background-color: blue; } #foo { border: 1px solid red; background-color: inherit; color: white; } </style> </head> <body> <div id="boo"> <div> <input type="text" id="foo"/> </div> </div> </body> </html> Note the extra div separating foo from boo. When you try this example, you'll notice that the initial display is /correct/, however when the widget is focussed, it defaults to white. Now remove the extra div, so that boo is the direct parent of foo. Try the example again and you'll find that when you focus the widget, the background colour is maintained. What this appears to be doing is only looking for bgcolors to inherit on the parent node, and if one is not specified, giving up and not going any further.
Comment 2•24 years ago
|
||
Simon--can you look into this?
Assignee: brade → sfraser
Target Milestone: --- → M15
Comment 3•24 years ago
|
||
Is this the same as 20572?
Comment 4•24 years ago
|
||
OK, this is too hard for my little brain. Before we instantiate the editor, the background of the text field is painted by a container frame (the DIV frame, I presume), so the text field never actually gets that background color. When we instantiate the editor, nsGfxTextControlFrame::InitializeTextControl() gets the background color from a call to mStyleContext->GetStyleData(), which returns gray for the background color of the text field. So I've no idea how to fix this. Should nsGfxTextControlFrame::InitializeTextControl() walk up the frame container hierarchy, looking for a parent frame that sets the background color?
Status: NEW → ASSIGNED
Assignee | ||
Comment 5•24 years ago
|
||
Assignee | ||
Comment 6•24 years ago
|
||
Assignee | ||
Comment 7•24 years ago
|
||
The problem is possibly coming from the code that propogates the background color from a text control to its embedded webshell (see bug 22926). IMO, the thing which is happening is that we propagate to the webshell the background-color from the parent, and if the parent's color has not been set, we propagate the default value which is 'transparent'. The bug doesn't happen if the background is 'inherited' certainly because then we inherit from the grand-parent's color. Maybe the style system should interpret "background: transparent" as "background: inherit". I don't understand the difference between a transparent and an inherited background anyhow. It is interesting to note that 'inherit' was not legal in CSS1. It came with CSS2.
Assignee | ||
Comment 8•24 years ago
|
||
I have a fix: reassigned to myself.
Assignee: sfraser → pierre
Status: ASSIGNED → NEW
Assignee | ||
Comment 9•24 years ago
|
||
Fix checked in nsCSSStyleRule.cpp
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 10•24 years ago
|
||
rock! thanks, pierre!
Comment 11•24 years ago
|
||
Thanks pierre!
You need to log in
before you can comment on or make changes to this bug.
Description
•