Ejemplo n.º 1
0
        static EventListeners GetEventListeners(mdr.DObject obj, EventTypes eventType)
        {
            var targetElement  = obj.FirstInPrototypeChainAs <EventTarget>();
            var eventListeners = targetElement.GetEventListeners(eventType, true);

            return(eventListeners);
        }
Ejemplo n.º 2
0
        public static void SetEventHandlerAttr(mdr.DObject obj, EventTypes type,
                                               string name, string script)
        {
            var targetElement = obj.FirstInPrototypeChainAs <HTMLElement>();

            targetElement.PrimSetEventHandlerAttr(type, script);
            var prgFunc = HTMLRuntime.Instance.PrepareScript(script);
            var pd      = obj.GetPropertyDescriptor(name);

            pd.Set(obj, prgFunc);
        }
Ejemplo n.º 3
0
        // all event handler attribute accessors should eventually call these
        public static string GetEventHandlerAttr(mdr.DObject obj, EventTypes type, string name)
        {
#if ENABLE_RR
            if (RecordReplayManager.Instance != null && RecordReplayManager.Instance.RecordEnabled)
            {
                mwr.RecordReplayManager.Instance.Record("Element", null, "GetEventHandlerAttr", false, obj, type, name);
            }
#endif
            var targetElement = obj.FirstInPrototypeChainAs <HTMLElement>();
            var s             = targetElement.PrimGetEventHandlerAttr(type);
            Debug.WriteLine("GetEventHandlerAttr({0}) = '{1}'", name, s);
            return(s);
        }