Beispiel #1
0
 protected override void OnElementChangedInIdleState(ElementChangeKind changeKind)
 {
     //1. 
     this.OwnerDocument.SetDocumentState(DocumentState.ChangedAfterIdle);
     if (this.OwnerDocument.IsDocFragment) return;
     HtmlDocument owner = this.OwnerDocument as HtmlDocument;
     owner.DomUpdateVersion++;
 }
Beispiel #2
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();
        }
Beispiel #3
0
 /// <summary>
 /// when we change dom element, the change may affect some part of dom/ or entire document
 /// </summary>
 /// <param name="changeKind"></param>
 /// <param name="attr"></param>
 protected void NotifyChange(ElementChangeKind changeKind, DomAttribute attr)
 {
     switch (this.DocState)
     {
     case DocumentState.ChangedAfterIdle:
     case DocumentState.Idle:
         //notify parent
         OnElementChangedInIdleState(changeKind, attr);
         break;
     }
 }
Beispiel #4
0
        protected override void OnElementChangedInIdleState(ElementChangeKind changeKind, DomAttribute attr)
        {
            //1.
            this.OwnerDocument.SetDocumentState(DocumentState.ChangedAfterIdle);
            if (this.OwnerDocument.IsDocFragment)
            {
                return;
            }
            HtmlDocument owner = this.OwnerDocument as HtmlDocument;

            owner.IncDomVersion();
        }
Beispiel #5
0
 public void NotifyChange(ElementChangeKind changeKind)
 {
     switch (this.DocState)
     {
     case DocumentState.ChangedAfterIdle:
     case DocumentState.Idle:
     {
         //notify parent
         OnElementChangedInIdleState(changeKind);
     } break;
     }
 }
Beispiel #6
0
        protected override void OnElementChangedInIdleState(ElementChangeKind changeKind)
        {
            //1.
            this.OwnerDocument.SetDocumentState(DocumentState.ChangedAfterIdle);
            if (this.OwnerDocument.IsDocFragment)
            {
                return;
            }
            HtmlDocument owner = this.OwnerDocument as HtmlDocument;

            owner.DomUpdateVersion++;
        }
Beispiel #7
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
            var cnode = this.ParentNode;
            while (cnode != null)
            {
                ((HtmlElement)cnode).SkipPrincipalBoxEvalulation = false;
                cnode = cnode.ParentNode;
            }

            HtmlDocument owner = this.OwnerDocument as HtmlDocument;
            owner.DomUpdateVersion++;
        }
Beispiel #8
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();
        }
        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
            var cnode = this.ParentNode;

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

            HtmlDocument owner = this.OwnerDocument as HtmlDocument;

            owner.DomUpdateVersion++;
        }
Beispiel #10
0
 public static void InvokeNotifyChangeOnIdleState(HtmlElement elem, ElementChangeKind changeKind, DomAttribute attr)
 {
     elem.OnElementChangedInIdleState(changeKind, attr);
 }
Beispiel #11
0
 protected virtual void OnElementChangedInIdleState(ElementChangeKind changeKind)
 {
 }
Beispiel #12
0
 public static void InvokeNotifyChangeOnIdleState(HtmlElement elem, ElementChangeKind changeKind)
 {
     elem.OnElementChangedInIdleState(changeKind);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DW.CodedUI.Utilities.ElementChangedEventArgs" /> class.
 /// </summary>
 public ElementChangedEventArgs(ElementChangeKind elementChangeKind, ElementInfo oldElementInfo, ElementInfo newElementInfo)
 {
     ElementChangeKind = elementChangeKind;
     OldElementInfo    = oldElementInfo;
     NewElementInfo    = newElementInfo;
 }
Beispiel #14
0
 protected virtual void OnElementChangedInIdleState(ElementChangeKind changeKind, DomAttribute attr)
 {
 }
Beispiel #15
0
 protected virtual void OnElementChangedInIdleState(ElementChangeKind changeKind)
 {
 }
Beispiel #16
0
 public void NotifyChange(ElementChangeKind changeKind)
 {
     switch (this.DocState)
     {
         case DocumentState.ChangedAfterIdle:
         case DocumentState.Idle:
             {
                 //notify parent 
                 OnElementChangedInIdleState(changeKind);
             }
             break;
     }
 }
Beispiel #17
0
 public static void InvokeNotifyChangeOnIdleState(HtmlElement elem, ElementChangeKind changeKind)
 {
     elem.OnElementChangedInIdleState(changeKind);
 }