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++; }
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(); }
/// <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; } }
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(); }
public void NotifyChange(ElementChangeKind changeKind) { switch (this.DocState) { case DocumentState.ChangedAfterIdle: case DocumentState.Idle: { //notify parent OnElementChangedInIdleState(changeKind); } break; } }
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++; }
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++; }
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++; }
public static void InvokeNotifyChangeOnIdleState(HtmlElement elem, ElementChangeKind changeKind, DomAttribute attr) { elem.OnElementChangedInIdleState(changeKind, attr); }
protected virtual void OnElementChangedInIdleState(ElementChangeKind changeKind) { }
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; }
protected virtual void OnElementChangedInIdleState(ElementChangeKind changeKind, DomAttribute attr) { }