docs: private void updateParent(ElementBase newParent) {
          ElementBase oldParent = this.parent;
          
          if (oldParent != newParent) {
              beforeParentChanged(newParent);
              this.parent = newParent;
              
              if (oldParent != null) {
                  oldParent.updateState();
              }
              
              if (newParent != null) {
                  afterParentChanged(oldParent);
                  newParent.updateState();
              }
          }
      }