Exemplo n.º 1
0
        protected override void OnElementChangedInIdleState(ElementChangeKind changeKind, DomAttribute attr)
        {
            //1.
            this.OwnerDocument.SetDocumentState(DocumentState.ChangedAfterIdle);
            if (this.OwnerDocument.IsDocFragment)
            {
                return;
            }
            //------------------------------------------------------------------
            //2. need box-evaluation again ?
            //we need to check that attr affect the dom or not
            //eg. font-color, bgcolor => not affect element size/layout
            //    custom attr => not affect element size/layout

            this.SkipPrincipalBoxEvalulation = false;



            ////-------------------
            //if (this.WellknownElementName == WellKnownDomNodeName.img)
            //{
            //    if (attr != null && attr.Name == "src")
            //    {
            //        //TODO: review this
            //        //has local effect
            //        //no propagation up
            //        return;
            //    }
            //}
            ////-------------------

            //3. propagate
            HtmlElement  cnode = (HtmlElement)this.ParentNode;
            HtmlDocument owner = this.OwnerDocument as HtmlDocument;

            while (cnode != null)
            {
                cnode.SkipPrincipalBoxEvalulation = false;
                if (cnode.ParentNode != null)
                {
                    cnode = (HtmlElement)cnode.ParentNode;
                }
                else
                {
                    if (cnode.SubParentNode != null)
                    {
                        cnode = (HtmlElement)cnode.SubParentNode;
                    }
                    else
                    {
                        cnode = null;
                    }
                }
            }

            owner.IncDomVersion();
        }
Exemplo n.º 2
0
        protected override void OnElementChangedInIdleState(ElementChangeKind changeKind)
        {
            //1.
            this.OwnerDocument.SetDocumentState(DocumentState.ChangedAfterIdle);
            if (this.OwnerDocument.IsDocFragment)
            {
                return;
            }
            //------------------------------------------------------------------
            //2. need box evaluation again
            this.SkipPrincipalBoxEvalulation = false;
            //3. propag

            HtmlElement  cnode = (HtmlElement)this.ParentNode;
            HtmlDocument owner = this.OwnerDocument as HtmlDocument;

            while (cnode != null)
            {
                cnode.SkipPrincipalBoxEvalulation = false;
                if (cnode.ParentNode != null)
                {
                    cnode = (HtmlElement)cnode.ParentNode;
                }
                else
                {
                    if (cnode.SubParentNode != null)
                    {
                        cnode = (HtmlElement)cnode.SubParentNode;
                    }
                    else
                    {
                        cnode = null;
                    }
                }
            }
            owner.IncDomVersion();
        }