mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
passes z-index8 non-positioned element with opactiy < 1
The MDN article Understanding_z_index/Stacking_and_float is wrong about this
This commit is contained in:
parent
65746bd2e3
commit
02ab96dc5f
@ -331,6 +331,7 @@ _html2canvas.Parse = function (images, options) {
|
||||
stack.zIndex = newContext = h2czContext(zIndex);
|
||||
newContext.isPositioned = isPositioned;
|
||||
newContext.isFloated = isFloated;
|
||||
newContext.opacity = opacity;
|
||||
|
||||
if (zIndex !== 'auto' || opacity < 1) {
|
||||
newContext.ownStacking = true;
|
||||
|
@ -48,10 +48,12 @@ _html2canvas.Renderer = function(parseQueue, options){
|
||||
|
||||
// positioned after static
|
||||
context[zi].forEach(function(v) {
|
||||
if (v.node.zIndex.isFloated) {
|
||||
floated.push(v);
|
||||
} else if (v.node.zIndex.isPositioned) {
|
||||
if (v.node.zIndex.isPositioned || v.node.zIndex.opacity < 1) {
|
||||
// http://www.w3.org/TR/css3-color/#transparency
|
||||
// non-positioned element with opactiy < 1 should be stacked as if it were a positioned element with ‘z-index: 0’ and ‘opacity: 1’.
|
||||
positioned.push(v);
|
||||
} else if (v.node.zIndex.isFloated) {
|
||||
floated.push(v);
|
||||
} else {
|
||||
nonPositioned.push(v);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user