mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
19 lines
685 B
JavaScript
19 lines
685 B
JavaScript
var NodeContainer = require('./nodecontainer');
|
|
|
|
function StackingContext(hasOwnStacking, opacity, element, parent) {
|
|
NodeContainer.call(this, element, parent);
|
|
this.ownStacking = hasOwnStacking;
|
|
this.contexts = [];
|
|
this.children = [];
|
|
this.opacity = (this.parent ? this.parent.stack.opacity : 1) * opacity;
|
|
}
|
|
|
|
StackingContext.prototype = Object.create(NodeContainer.prototype);
|
|
|
|
StackingContext.prototype.getParentStack = function(context) {
|
|
var parentStack = (this.parent) ? this.parent.stack : null;
|
|
return parentStack ? (parentStack.ownStacking ? parentStack : parentStack.getParentStack(context)) : context.stack;
|
|
};
|
|
|
|
module.exports = StackingContext;
|