WebIDL compilter doesn't support [Constructor(MutationCallback mutationCallback)]

Issue #153 new
hindlemail
created an issue

Which means MutationObserver can't be used.

Comments (3)

  1. geckofx repo owner
    [Constructor(MutationCallback mutationCallback)]
    interface MutationObserver {
      [Throws]
      void observe(Node target, optional MutationObserverInit options);
      void disconnect();
      sequence<MutationRecord> takeRecords();
    
      [ChromeOnly, Throws]
      sequence<MutationObservingInfo?> getObservingInfo();
      [ChromeOnly]
      readonly attribute MutationCallback mutationCallback;
      [ChromeOnly]
      attribute boolean mergeAttributeRecords;
    };
    

    Which currently generates the following:

    public class MutationObserver : WebIDLBase
        {
    
            public MutationObserver(nsIDOMWindow globalWindow, nsISupports thisObject) : 
                    base(globalWindow, thisObject)
            {
            }
    
            public bool MergeAttributeRecords
            {
                get
                {
                    return this.GetProperty<bool>("mergeAttributeRecords");
                }
                set
                {
                    this.SetProperty("mergeAttributeRecords", value);
                }
            }
    
            public void Observe(nsIDOMNode target)
            {
                this.CallVoidMethod("observe", target);
            }
    
            public void Observe(nsIDOMNode target, object options)
            {
                this.CallVoidMethod("observe", target, options);
            }
    
            public void Disconnect()
            {
                this.CallVoidMethod("disconnect");
            }
    
            public nsISupports[] TakeRecords()
            {
                return this.CallMethod<nsISupports[]>("takeRecords");
            }
    
            public object[] GetObservingInfo()
            {
                return this.CallMethod<object[]>("getObservingInfo");
            }
        }
    
  2. darbid

    Any chance someone can please show an example of how this works.

    Worked out observers for CookieServices and HTTPRequests but this is different right?

  3. Log in to comment