Closed Bug 334552 Opened 18 years ago Closed 16 years ago

non-opaque rgba background on root element doesn't paint correctly

Categories

(Core :: Layout, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: sharparrow1, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: testcase)

To reproduce:

1. Load data:text/html,<style>html{background:red}</style>
2. Then, in the same tab, load data:text/html,<style>html{background:rgba(0,0,0,0)}</style>
3. Drag offscreen/switch tabs/refresh

Expected results:
The page should not initially be red, and the color shouldn't change.

Actual results:
The color changes from red to black.

Of course, there is the question of what color we should be compositing against.  We could paint the page black intially, ignoring the alpha value.  Or, we could initially paint the page white, as a base color.  In any case, the current behavior is obviously wrong.

Tested with trunk cairo-windows Firefox build (or should I say Minefield build?  Whatever, doesn't matter).

Not sure who else to CC.
http://www.w3.org/TR/css3-background/#the-background0 says:

If the root's background-color value is 'transparent', the color is UA dependent.

That doesn't address alpha, though.

I propose we assume that the user's default background color is behind it.  Although roc might want us to make it actually transparent (which would mean we'd have to put the user's default background as the default background of the browser element).
> I propose we assume that the user's default background color is behind it.

This seems most sensible to me.
So, roc, I'm sort of wondering why this doesn't just work.  I couldn't find any nsStyleBackground::IsTransparent checks that need to be changed to !IsOpaque() (which doesn't exist yet, but may need to).  What makes us decide to paint some other background when the root has background:transparent that doesn't work here?
We probably need to audit everybody who checks mBackgroundFlags:
http://lxr.mozilla.org/seamonkey/search?string=mBackgroundFlags

...and we should also make nsStyleBackground::IsTransparent check for the A channel being 0.  (And perhaps add an IsOpaque that checks for non-transparent and A==255.)
Blocks: 326624
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b1pre) Gecko/20080914034157 Minefield/3.1b1pre

This works for me. (Bug 453916 ?)
Yeah, zwol fixed this.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.