mozilla :: #mdn

16 May 2017
14:36woodydan_could anyone tell how to HTMLELement in browser
14:38araiwhat do you mean by "how to HTMLELement" ?
14:39woodydan_I use firefox console, when type HTMLElement ,it respond it is a function
14:41woodydan_when I type this "var obj=new HTMLElement()", the browser give an error
14:42sheppystandups: Converted example on createDocumentFragment() page into live sample.
14:42standupsOk, submitted #46211 for https://www.standu.ps/user/sheppy/
14:42araiwoodydan_: what are you trying to do?
14:44araiif you want to create an element, you can do document.createElement("...")
14:45woodydan_I Know it is a DOM type, but I don t know how to use the type
14:46araiyou can use it like `document.body instanceof HTMLElement`
14:46araiit's not for constructing element instance, iiuc
14:49sheppystandups: Completed copy-edit and standardization of https://developer.mozilla.org/en-US/Firefox/Performance_best_practices_for_Firefox_fe_engineers
14:49standupsOk, submitted #46213 for https://www.standu.ps/user/sheppy/
14:52jwhitlockwoodydan_: what problem are you trying to solve?
14:54jwhitlockwoodydan_ says - i just dont understand why browser forbidden us to use this type like other constructor
14:56woodydan_ I am till confused that why browser build this DOM type ,but forbidden us to use it like other type
14:58jwhitlockIf you are curious "Why do I have to use document.createElement()", then it may help to read the DOM spec for what happens when you run that function: https://dom.spec.whatwg.org/#concept-create-element
14:58jwhitlockor maybe start from here https://dom.spec.whatwg.org/#dom-document-createelement
15:01jwhitlockbut most people aren't curious about that. They need to update a webpage with new elements, so they use document.createElement, and don't ask why - https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement
15:01sheppy:)
15:02woodydan_so I am we weird:grin:
15:02* sheppy would never ever say such a thing. :)
15:03woodydan_0,0
15:04jwhitlockwell, you are in the right place for that kind of weirdness
15:04jwhitlockthis is where the spec-obsessed folks are. Well, that, and whatever W3C uses for chat
15:05sheppyYeah, those of us who document this stuff spend a lot of time buried in the spec. :)
15:08jwhitlockalso, you can do strange things by extending HTMLElement, but it looks like you still use document.createElement - https://developers.google.com/web/fundamentals/getting-started/primers/customelements
15:08jwhitlockI'm not sure if we have the MDN equivalent of that page
15:09sheppyI don't think so. I don't think we've gotten into custom elements yet.
15:11woodydan_well, I know , I shouldn't waste time on this kind of things
21:18marcosomething like &quot;<li>The documentation in {{ Source(&quot;js/xpconnect/idl/xpccomponents.idl&quot;, &quot;xpccomponents.idl&quot;) }}</li>&quot;
21:18marcoin MDN
21:18marcois pointing to MXR
21:19marcocan we change it to point to DXR?
21:20jwhitlockmarco: Source is a macro, and the source is on github - https://github.com/mozilla/kumascript/blob/master/macros/source.ejs
21:20jwhitlockthe macro already points to DXR
21:20marcojwhitlock: it looks like it&#39;s using dxr, but https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.import is pointing to MXR
21:21marcoif you look at the &quot;Additional Resources&quot; section
21:21* jwhitlock looks
21:21marcoI&#39;ve just fixed it
21:21marcoI just needed to publish it again, with no changes
21:21marcoI guess the macro isn&#39;t applied until you save the page
21:22jwhitlockthat&#39;s right, it is only applied on render
21:22marcothis means it might be worth regenerating all the pages where the macro is used
21:22jwhitlocka force-refresh as a logged in user also causes a re-render
21:23jwhitlockthat&#39;s a very old bug, but 772704
21:23HavvyThere&#39;s no queue to automatically update pages that have macros that changed?
21:24jwhitlocksorry bug 772704
21:24firebothttps://bugzil.la/772704 NEW, nobody@mozilla.org When a template is updated, the pages including this template should be regenerated
21:27jwhitlocknope, there is no mechanism for automatically updating pages
21:55sheppyIt&#39;s something that we&#39;ve had on the &quot;sure would be nice&quot; list since forever though :)
21:56sheppyjwhitlock: I will say that one of the reasons we didn&#39;t do it beforethat macros sometimes change several times in a row while being updatedis no longer an issue with them having moved to github.
22:07jwhitlockthere&#39;s always reasons not to do hard work...
22:07sheppyOf course :)
22:08jwhitlockI think we have a few reasons to periodically rebuild pages, such as https://github.com/mozilla/kuma/pull/4237#issuecomment-301915534
22:09jwhitlockI think it fits in our papercut process
22:09jwhitlockalso, Q3 and Q4 might be where I aggressively triage the bugs and feature requests
22:09jwhitlockwe need a backlog
22:13sheppyYeah
22:13sheppyI think it might at least be worth thinking about doing like a quarterly rebuild or something like that.
22:13sheppystandups: First draft of https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/takeRecords
22:13standupsOk, submitted #46232 for https://www.standu.ps/user/sheppy/
22:14sheppystandups: Updates to https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/observe
22:14standupsOk, submitted #46233 for https://www.standu.ps/user/sheppy/
22:14sheppystandups: Added more details to https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver_API
22:14standupsOk, submitted #46234 for https://www.standu.ps/user/sheppy/
17 May 2017
No messages
   
Last message: 126 days and 20 hours ago