single-file-core 1.0.32 → 1.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
const screen = globalThis.screen;
|
|
65
65
|
const Element = globalThis.Element;
|
|
66
66
|
const UIEvent = globalThis.UIEvent;
|
|
67
|
+
const Event = globalThis.Event;
|
|
67
68
|
const FileReader = globalThis.FileReader;
|
|
68
69
|
const Blob = globalThis.Blob;
|
|
69
70
|
const console = globalThis.console;
|
|
@@ -130,12 +131,13 @@
|
|
|
130
131
|
result.__defineGetter__("srcset", function () {
|
|
131
132
|
return image.srcset;
|
|
132
133
|
});
|
|
134
|
+
result.__defineGetter__("height", () => image.height);
|
|
135
|
+
result.__defineGetter__("width", () => image.width);
|
|
136
|
+
result.__defineGetter__("naturalHeight", () => image.naturalHeight);
|
|
137
|
+
result.__defineGetter__("naturalWidth", () => image.naturalWidth);
|
|
133
138
|
image.onload = image.onloadend = image.onerror = event => {
|
|
134
139
|
dispatchEvent(new CustomEvent(IMAGE_LOADED_EVENT, { detail: image.src }));
|
|
135
|
-
|
|
136
|
-
event.__defineGetter__("target", () => result);
|
|
137
|
-
event.__defineGetter__("srcElement", () => result);
|
|
138
|
-
result.dispatchEvent(event);
|
|
140
|
+
result.dispatchEvent(new Event(event.type, event));
|
|
139
141
|
};
|
|
140
142
|
if (image.decode) {
|
|
141
143
|
result.decode = () => image.decode();
|