diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-04-20 07:16:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-20 07:16:14 +0800 |
commit | a438e2fca9a9bf014796768d06aba908d1348e16 (patch) | |
tree | 6553268be071bf7654a6376a6b04fc208c568c04 /tools/props.html | |
parent | 00833e893a3d21745fc6a66d9d43e0e988b0d72b (diff) | |
download | tracifyjs-a438e2fca9a9bf014796768d06aba908d1348e16.tar.gz tracifyjs-a438e2fca9a9bf014796768d06aba908d1348e16.zip |
update `domprops` (#3369)
fixes #2343
fixes #3037
Diffstat (limited to 'tools/props.html')
-rw-r--r-- | tools/props.html | 591 |
1 files changed, 535 insertions, 56 deletions
diff --git a/tools/props.html b/tools/props.html index f7c777aa..ce2e7e6b 100644 --- a/tools/props.html +++ b/tools/props.html @@ -1,61 +1,540 @@ +<!doctype html> <html> - <head> - </head> - <body> - <script>(function(){ - var props = {}; +<body> + <script> + !function() { + var names = []; + var scanned = []; + var to_scan = []; - function addObject(obj) { - if (obj == null) return; - try { - Object.getOwnPropertyNames(obj).forEach(add); - } catch(ex) {} - if (obj.prototype) { - Object.getOwnPropertyNames(obj.prototype).forEach(add); - } - if (typeof obj == "function") { - try { - Object.getOwnPropertyNames(new obj).forEach(add); - } catch(ex) {} - } - } + function scan(obj) { + if (obj && typeof obj == "object" && !~scanned.indexOf(obj)) { + scanned.push(obj); + to_scan.push(obj); + } + } - function add(name) { - props[name] = true; - } + scan(self); + [ + "a", + "abbr", + "acronym", + "address", + "applet", + "area", + "article", + "aside", + "audio", + "b", + "base", + "basefont", + "bdi", + "bdo", + "bgsound", + "big", + "blink", + "blockquote", + "body", + "br", + "button", + "canvas", + "caption", + "center", + "checked", + "cite", + "code", + "col", + "colgroup", + "command", + "comment", + "compact", + "content", + "data", + "datalist", + "dd", + "declare", + "defer", + "del", + "details", + "dfn", + "dialog", + "dir", + "disabled", + "div", + "dl", + "dt", + "element", + "em", + "embed", + "fieldset", + "figcaption", + "figure", + "font", + "footer", + "form", + "frame", + "frameset", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "head", + "header", + "hgroup", + "hr", + "html", + "i", + "iframe", + "image", + "img", + "input", + "ins", + "isindex", + "ismap", + "kbd", + "keygen", + "label", + "legend", + "li", + "link", + "listing", + "main", + "map", + "mark", + "marquee", + "math", + "menu", + "menuitem", + "meta", + "meter", + "multicol", + "multiple", + "nav", + "nobr", + "noembed", + "noframes", + "nohref", + "noresize", + "noscript", + "noshade", + "nowrap", + "object", + "ol", + "optgroup", + "option", + "output", + "p", + "param", + "picture", + "plaintext", + "pre", + "progress", + "q", + "rb", + "readonly", + "rp", + "rt", + "rtc", + "ruby", + "s", + "samp", + "script", + "section", + "select", + "selected", + "shadow", + "small", + "source", + "spacer", + "span", + "strike", + "strong", + "style", + "sub", + "summary", + "sup", + "svg", + "table", + "tbody", + "td", + "template", + "textarea", + "tfoot", + "th", + "thead", + "time", + "title", + "tr", + "track", + "tt", + "u", + "ul", + "var", + "video", + "wbr", + "xmp", + "XXX", + ].forEach(function(tag) { + scan(document.createElement(tag)); + }); + [ + "abort", + "absolutedeviceorientation", + "activate", + "active", + "addsourcebuffer", + "addstream", + "addtrack", + "afterprint", + "afterscriptexecute", + "afterupdate", + "animationcancel", + "animationend", + "animationiteration", + "animationstart", + "appinstalled", + "audioend", + "audioprocess", + "audiostart", + "autocomplete", + "autocompleteerror", + "auxclick", + "beforeactivate", + "beforecopy", + "beforecut", + "beforedeactivate", + "beforeeditfocus", + "beforeinstallprompt", + "beforepaste", + "beforeprint", + "beforescriptexecute", + "beforeunload", + "beforeupdate", + "blocked", + "blur", + "bounce", + "boundary", + "cached", + "cancel", + "candidatewindowhide", + "candidatewindowshow", + "candidatewindowupdate", + "canplay", + "canplaythrough", + "cellchange", + "change", + "chargingchange", + "chargingtimechange", + "checking", + "click", + "close", + "compassneedscalibration", + "complete", + "connect", + "connecting", + "connectionstatechange", + "contextmenu", + "controllerchange", + "controlselect", + "copy", + "cuechange", + "cut", + "dataavailable", + "datachannel", + "datasetchanged", + "datasetcomplete", + "dblclick", + "deactivate", + "devicechange", + "devicelight", + "devicemotion", + "deviceorientation", + "deviceorientationabsolute", + "deviceproximity", + "dischargingtimechange", + "disconnect", + "display", + "downloading", + "drag", + "dragend", + "dragenter", + "dragexit", + "dragleave", + "dragover", + "dragstart", + "drop", + "durationchange", + "emptied", + "encrypted", + "end", + "ended", + "enter", + "enterpictureinpicture", + "error", + "errorupdate", + "exit", + "filterchange", + "finish", + "focus", + "focusin", + "focusout", + "freeze", + "fullscreenchange", + "fullscreenerror", + "gesturechange", + "gestureend", + "gesturestart", + "gotpointercapture", + "hashchange", + "help", + "icecandidate", + "iceconnectionstatechange", + "icegatheringstatechange", + "inactive", + "input", + "invalid", + "keydown", + "keypress", + "keyup", + "languagechange", + "layoutcomplete", + "leavepictureinpicture", + "levelchange", + "load", + "loadeddata", + "loadedmetadata", + "loadend", + "loading", + "loadingdone", + "loadingerror", + "loadstart", + "losecapture", + "lostpointercapture", + "mark", + "message", + "messageerror", + "mousedown", + "mouseenter", + "mouseleave", + "mousemove", + "mouseout", + "mouseover", + "mouseup", + "mousewheel", + "move", + "moveend", + "movestart", + "mozfullscreenchange", + "mozfullscreenerror", + "mozorientationchange", + "mozpointerlockchange", + "mozpointerlockerror", + "mscontentzoom", + "msfullscreenchange", + "msfullscreenerror", + "msgesturechange", + "msgesturedoubletap", + "msgestureend", + "msgesturehold", + "msgesturestart", + "msgesturetap", + "msgotpointercapture", + "msinertiastart", + "mslostpointercapture", + "msmanipulationstatechanged", + "msneedkey", + "msorientationchange", + "mspointercancel", + "mspointerdown", + "mspointerenter", + "mspointerhover", + "mspointerleave", + "mspointermove", + "mspointerout", + "mspointerover", + "mspointerup", + "mssitemodejumplistitemremoved", + "msthumbnailclick", + "negotiationneeded", + "nomatch", + "noupdate", + "obsolete", + "offline", + "online", + "open", + "orientationchange", + "pagechange", + "pagehide", + "pageshow", + "paste", + "pause", + "play", + "playing", + "pluginstreamstart", + "pointercancel", + "pointerdown", + "pointerenter", + "pointerleave", + "pointerlockchange", + "pointerlockerror", + "pointermove", + "pointerout", + "pointerover", + "pointerup", + "popstate", + "progress", + "propertychange", + "ratechange", + "reading", + "readystatechange", + "rejectionhandled", + "removesourcebuffer", + "removestream", + "removetrack", + "reset", + "resize", + "resizeend", + "resizestart", + "resourcetimingbufferfull", + "result", + "resume", + "rowenter", + "rowexit", + "rowsdelete", + "rowsinserted", + "scroll", + "search", + "seeked", + "seeking", + "select", + "selectionchange", + "selectstart", + "show", + "signalingstatechange", + "soundend", + "soundstart", + "sourceclose", + "sourceclosed", + "sourceended", + "sourceopen", + "speechend", + "speechstart", + "stalled", + "start", + "statechange", + "stop", + "storage", + "storagecommit", + "submit", + "success", + "suspend", + "textinput", + "timeout", + "timeupdate", + "toggle", + "touchcancel", + "touchend", + "touchmove", + "touchstart", + "track", + "transitioncancel", + "transitionend", + "transitionrun", + "transitionstart", + "unhandledrejection", + "unload", + "updateready", + "upgradeneeded", + "userproximity", + "versionchange", + "visibilitychange", + "voiceschanged", + "volumechange", + "vrdisplayactivate", + "vrdisplayconnect", + "vrdisplaydeactivate", + "vrdisplaydisconnect", + "vrdisplaypresentchange", + "waiting", + "waitingforkey", + "warning", + "webkitanimationend", + "webkitanimationiteration", + "webkitanimationstart", + "webkitcurrentplaybacktargetiswirelesschanged", + "webkitfullscreenchange", + "webkitfullscreenerror", + "webkitkeyadded", + "webkitkeyerror", + "webkitkeymessage", + "webkitneedkey", + "webkitorientationchange", + "webkitplaybacktargetavailabilitychanged", + "webkitpointerlockchange", + "webkitpointerlockerror", + "webkitresourcetimingbufferfull", + "webkittransitionend", + "wheel", + "zoom", + ].forEach(function(type) { + [ + "beforeunloadevent", + "compositionevent", + "customevent", + "devicemotionevent", + "deviceorientationevent", + "dragevent", + "event", + "events", + "focusevent", + "hashchangeevent", + "htmlevents", + "keyboardevent", + "messageevent", + "mouseevent", + "mouseevents", + "storageevent", + "svgevents", + "textevent", + "touchevent", + "uievent", + "uievents", + ].forEach(function(interface) { + try { + var event = document.createEvent(interface); + event.initEvent(type, true, true); + scan(event); + } catch (e) {} + }); + }); - Object.getOwnPropertyNames(window).forEach(function(thing){ - addObject(window[thing]); - }); - - try { - addObject(new Event("click")); - addObject(new Event("contextmenu")); - addObject(new Event("mouseup")); - addObject(new Event("mousedown")); - addObject(new Event("keydown")); - addObject(new Event("keypress")); - addObject(new Event("keyup")); - } catch(ex) {} - - var ta = document.createElement("textarea"); - ta.style.width = "100%"; - ta.style.height = "20em"; - ta.style.boxSizing = "border-box"; - <!-- ta.value = Object.keys(props).sort(cmp).map(function(name){ --> - <!-- return JSON.stringify(name); --> - <!-- }).join(",\n"); --> - ta.value = JSON.stringify({ - vars: [], - props: Object.keys(props).sort(cmp) - }, null, 2); - document.body.appendChild(ta); - - function cmp(a, b) { - a = a.toLowerCase(); - b = b.toLowerCase(); - return a < b ? -1 : a > b ? 1 : 0; - } - })();</script> - </body> + var obj; + while (obj = to_scan.shift()) { + var proto = obj; + do { + Object.getOwnPropertyNames(proto).forEach(function(name) { + var visited = ~names.indexOf(name); + if (!visited) names.push(name); + try { + scan(obj[name]); + if (visited) return; + if (/^create/.test(name)) { + scan(obj[name]()); + } + if (/^[A-Z]/.test(name)) { + scan(new obj[name]()); + } + } catch (e) {} + }); + } while (proto = Object.getPrototypeOf(proto)); + } + names.sort(); + document.write('<pre>[\n "'); + document.write(names.join('",\n "')); + document.write('"\n]</pre>'); + }(); + </script> +</body> </html> |