code: @Override
      protected void updateStackingContexts()
      {
          super.updateStackingContexts();
          if (stackingParent != null)
          {
              if (formsStackingContext()) //all the positioned boxes are considered as separate stacking contexts
              {
                  stackingParent.getStackingContext().registerChildContext(this);
                  if (scontext != null) //clear this context if it exists (remove old children)
                      scontext.clear();
              }
          }
      }
docs: Updates the stacking parent values and registers the z-index for this parent.