Closed
Bug 512297
Opened 16 years ago
Closed 16 years ago
Opacity on element is inverse of underlying element when using negative margin-top
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
DUPLICATE
of bug 401682
People
(Reporter: mimecuvalo, Unassigned)
Details
Attachments
(1 file)
606 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)
Build Identifier:
We have an image (element A) that is overlaying a previous element (element B) using a negative margin-top. When the opacity of element B is changed in step increments from 0->1, element A changes opacity with it. Strangely though, the opacity is inverse of element B's, but only up to the value of 1. When element B's opacity is 1, of which the inverse would be 0, element A's opacity returns to 1.
For what it's worth, we're seeing this same bug in Webkit too.
Submitting testcase shortly.
Reproducible: Always
Reporter | ||
Comment 1•16 years ago
|
||
Another strange bug resulting from this testcase, dealing with basic addition. Adding 0.2 incrementally as this test case does the values go from:
0
0.2
0.4
0.6000000000000001
0.8
1
I'll file a separate bug for that crazy one :)
This behavior is as expected, since 'opacity' changes the z order rules (and has to, since everything with 'opacity' must be composited as a single layer). See http://www.w3.org/TR/css3-color/#transparency which says:
Since an element with opacity less than 1 is composited from a single offscreen image, content outside of it cannot be layered in z-order between pieces of content inside of it. For the same reason, implementations must create a new stacking context for any element with opacity less than 1. If an element with opacity less than 1 is not positioned, implementations must paint the layer it creates, within its parent stacking context, at the same stacking order that would be used if it were a positioned element with ‘z-index: 0’ and ‘opacity: 1’. If an element with opacity less than 1 is positioned, the ‘z-index’ property applies as described in [CSS21], except that ‘auto’ is treated as ‘0’ since a new stacking context is always created. See section 9.9 and Appendix E of [CSS21] for more information on stacking contexts. The rules in this paragraph do not apply to SVG elements, since SVG has its own rendering model [SVG11].
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → INVALID
Reporter | ||
Comment 3•16 years ago
|
||
Thanks for the quick clarification, David! That makes a lot of sense.
(as for the floating point bug, I see that would be a dup of bug 5856)
Resolution: INVALID → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•