void RenderLayerStackingNode::updateStackingNodesAfterStyleChange(const RenderStyle* oldStyle)
{
    bool wasStackingContext = oldStyle ? !oldStyle->hasAutoZIndex() : false;
    int oldZIndex = oldStyle ? oldStyle->zIndex() : 0;

    bool isStackingContext = this->isStackingContext();
    if (isStackingContext == wasStackingContext && oldZIndex == zIndex())
        return;

    dirtyStackingContextZOrderLists();

    if (isStackingContext)
        dirtyZOrderLists();
    else
        clearZOrderLists();
}
void RenderLayerStackingNode::updateStackingNodesAfterStyleChange(const RenderStyle* oldStyle)
{
    bool wasStackingContext = oldStyle ? isStackingContext(oldStyle) : false;
    EVisibility oldVisibility = oldStyle ? oldStyle->visibility() : VISIBLE;
    int oldZIndex = oldStyle ? oldStyle->zIndex() : 0;

    // FIXME: RenderLayer already handles visibility changes through our visiblity dirty bits. This logic could
    // likely be folded along with the rest.
    bool isStackingContext = this->isStackingContext();
    if (isStackingContext == wasStackingContext && oldVisibility == renderer()->style()->visibility() && oldZIndex == zIndex())
        return;

    dirtyStackingContainerZOrderLists();

    if (isStackingContainer())
        dirtyZOrderLists();
    else
        clearZOrderLists();

    compositor()->setNeedsUpdateCompositingRequirementsState();
}
void PaintLayerStackingNode::styleDidChange(const ComputedStyle* oldStyle) {
  bool wasStackingContext = oldStyle ? oldStyle->isStackingContext() : false;
  int oldZIndex = oldStyle ? oldStyle->zIndex() : 0;

  bool isStackingContext = this->isStackingContext();
  bool shouldBeStacked = layoutObject()->styleRef().isStacked();
  if (isStackingContext == wasStackingContext &&
      m_isStacked == shouldBeStacked && oldZIndex == zIndex())
    return;

  dirtyStackingContextZOrderLists();

  if (isStackingContext)
    dirtyZOrderLists();
  else
    clearZOrderLists();

  if (m_isStacked != shouldBeStacked) {
    m_isStacked = shouldBeStacked;
    if (!layoutObject()->documentBeingDestroyed() && !layer()->isRootLayer())
      compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree);
  }
}