|
| 1 | +namespace AngleSharp.Js |
| 2 | +{ |
| 3 | + using AngleSharp.Attributes; |
| 4 | + using AngleSharp.Dom; |
| 5 | + using System; |
| 6 | + |
| 7 | + /// <summary> |
| 8 | + /// A set of stub implementations. |
| 9 | + /// </summary> |
| 10 | + [DomExposed("Element")] |
| 11 | + public static class ElementPseudoExtensions |
| 12 | + { |
| 13 | + /// <summary> |
| 14 | + /// Getter for the scrollLeft property. |
| 15 | + /// </summary> |
| 16 | + [DomName("scrollLeft")] |
| 17 | + [DomAccessor(Accessors.Getter)] |
| 18 | + public static Double GetScrollLeft(this IElement element) => 0.0; |
| 19 | + |
| 20 | + /// <summary> |
| 21 | + /// Getter for the scrollTop property. |
| 22 | + /// </summary> |
| 23 | + [DomName("scrollTop")] |
| 24 | + [DomAccessor(Accessors.Getter)] |
| 25 | + public static Double GetScrollTop(this IElement element) => 0.0; |
| 26 | + |
| 27 | + /// <summary> |
| 28 | + /// Getter for the scrollWidth property. |
| 29 | + /// </summary> |
| 30 | + [DomName("scrollWidth")] |
| 31 | + [DomAccessor(Accessors.Getter)] |
| 32 | + public static Double GetScrollWidth(this IElement element) => 0.0; |
| 33 | + |
| 34 | + /// <summary> |
| 35 | + /// Getter for the scrollHeight property. |
| 36 | + /// </summary> |
| 37 | + [DomName("scrollHeight")] |
| 38 | + [DomAccessor(Accessors.Getter)] |
| 39 | + public static Double GetScrollHeight(this IElement element) => 0.0; |
| 40 | + |
| 41 | + /// <summary> |
| 42 | + /// Getter for the clientLeft property. |
| 43 | + /// </summary> |
| 44 | + [DomName("clientLeft")] |
| 45 | + [DomAccessor(Accessors.Getter)] |
| 46 | + public static Double GetClientLeft(this IElement element) => 0.0; |
| 47 | + |
| 48 | + /// <summary> |
| 49 | + /// Getter for the clientTop property. |
| 50 | + /// </summary> |
| 51 | + [DomName("clientTop")] |
| 52 | + [DomAccessor(Accessors.Getter)] |
| 53 | + public static Double GetClientTop(this IElement element) => 0.0; |
| 54 | + |
| 55 | + /// <summary> |
| 56 | + /// Getter for the clientWidth property. |
| 57 | + /// </summary> |
| 58 | + [DomName("clientWidth")] |
| 59 | + [DomAccessor(Accessors.Getter)] |
| 60 | + public static Double GetClientWidth(this IElement element) => 0.0; |
| 61 | + |
| 62 | + /// <summary> |
| 63 | + /// Getter for the clientHeight property. |
| 64 | + /// </summary> |
| 65 | + [DomName("clientHeight")] |
| 66 | + [DomAccessor(Accessors.Getter)] |
| 67 | + public static Double GetClientHeight(this IElement element) => 0.0; |
| 68 | + |
| 69 | + /// <summary> |
| 70 | + /// Getter for the offsetLeft property. |
| 71 | + /// </summary> |
| 72 | + [DomName("offsetLeft")] |
| 73 | + [DomAccessor(Accessors.Getter)] |
| 74 | + public static Double GetOffsetLeft(this IElement element) => 0.0; |
| 75 | + |
| 76 | + /// <summary> |
| 77 | + /// Getter for the offsetTop property. |
| 78 | + /// </summary> |
| 79 | + [DomName("offsetTop")] |
| 80 | + [DomAccessor(Accessors.Getter)] |
| 81 | + public static Double GetOffsetTop(this IElement element) => 0.0; |
| 82 | + |
| 83 | + /// <summary> |
| 84 | + /// Getter for the offsetWidth property. |
| 85 | + /// </summary> |
| 86 | + [DomName("offsetWidth")] |
| 87 | + [DomAccessor(Accessors.Getter)] |
| 88 | + public static Double GetOffsetWidth(this IElement element) => 0.0; |
| 89 | + |
| 90 | + /// <summary> |
| 91 | + /// Getter for the offsetHeight property. |
| 92 | + /// </summary> |
| 93 | + [DomName("offsetHeight")] |
| 94 | + [DomAccessor(Accessors.Getter)] |
| 95 | + public static Double GetOffsetHeight(this IElement element) => 0.0; |
| 96 | + |
| 97 | + /// <summary> |
| 98 | + /// Adds the focus in event. |
| 99 | + /// </summary> |
| 100 | + [DomName("focusin")] |
| 101 | + [DomEvent] |
| 102 | + [DomAccessor(Accessors.Setter)] |
| 103 | + public static void AddFocusIn(this IElement element, DomEventHandler handler) => |
| 104 | + element.AddEventListener("focusin", handler); |
| 105 | + |
| 106 | + /// <summary> |
| 107 | + /// Removes the focus in event. |
| 108 | + /// </summary> |
| 109 | + [DomName("focusin")] |
| 110 | + [DomEvent] |
| 111 | + [DomAccessor(Accessors.Deleter)] |
| 112 | + public static void RemoveFocusIn(this IElement element, DomEventHandler handler) => |
| 113 | + element.RemoveEventListener("focusin", handler); |
| 114 | + |
| 115 | + /// <summary> |
| 116 | + /// Adds the focus out event. |
| 117 | + /// </summary> |
| 118 | + [DomName("focusout")] |
| 119 | + [DomEvent] |
| 120 | + [DomAccessor(Accessors.Setter)] |
| 121 | + public static void AddFocusOut(this IElement element, DomEventHandler handler) => |
| 122 | + element.AddEventListener("focusout", handler); |
| 123 | + |
| 124 | + /// <summary> |
| 125 | + /// Removes the focus out event. |
| 126 | + /// </summary> |
| 127 | + [DomName("focusout")] |
| 128 | + [DomEvent] |
| 129 | + [DomAccessor(Accessors.Deleter)] |
| 130 | + public static void RemoveFocusOut(this IElement element, DomEventHandler handler) => |
| 131 | + element.RemoveEventListener("focusout", handler); |
| 132 | + |
| 133 | + /// <summary> |
| 134 | + /// Adds the unload event. |
| 135 | + /// </summary> |
| 136 | + [DomName("unload")] |
| 137 | + [DomEvent] |
| 138 | + [DomAccessor(Accessors.Setter)] |
| 139 | + public static void AddUnload(this IElement element, DomEventHandler handler) => |
| 140 | + element.AddEventListener("unload", handler); |
| 141 | + |
| 142 | + /// <summary> |
| 143 | + /// Removes the unload event. |
| 144 | + /// </summary> |
| 145 | + [DomName("unload")] |
| 146 | + [DomEvent] |
| 147 | + [DomAccessor(Accessors.Deleter)] |
| 148 | + public static void RemoveUnload(this IElement element, DomEventHandler handler) => |
| 149 | + element.RemoveEventListener("unload", handler); |
| 150 | + |
| 151 | + /// <summary> |
| 152 | + /// Adds the contextmenu event. |
| 153 | + /// </summary> |
| 154 | + [DomName("contextmenu")] |
| 155 | + [DomEvent] |
| 156 | + [DomAccessor(Accessors.Setter)] |
| 157 | + public static void AddContextMenu(this IElement element, DomEventHandler handler) => |
| 158 | + element.AddEventListener("contextmenu", handler); |
| 159 | + |
| 160 | + /// <summary> |
| 161 | + /// Removes the contextmenu event. |
| 162 | + /// </summary> |
| 163 | + [DomName("contextmenu")] |
| 164 | + [DomEvent] |
| 165 | + [DomAccessor(Accessors.Deleter)] |
| 166 | + public static void RemoveContextMenu(this IElement element, DomEventHandler handler) => |
| 167 | + element.RemoveEventListener("contextmenu", handler); |
| 168 | + } |
| 169 | +} |
0 commit comments