Closed domenic closed 9 years ago
LGTM!
Couldn't resist pushing a few more commits to make it actually look like a link and be functional before heading home for the weekend. The demo actually shows a working <custom-a>
now. Ticking off boxes in #37 as I go.
It isn't terribly functional in a user-facing way right now, but the
URLUtils
properties all work, which is great. Mostly would be interested in review of the approach.Commit message:
Makes use of several new webidl-class-generator features:
implements
,[CustomElementCallbacks]
, and[NoConversion]
.Introduces our first "mixin,"
URLUtils
. This gives us a direct manifestation of theURLUtils
interface from the URL Standard, and how it relates toHTMLAnchorElement
. In particular, we reify the mixin's "set the input" algorithm and the mixin target's "get the base" and "update steps" algorithms.Introduces new infrastructure for private methods, used to allow
URLUtils
to accessCustomHTMLAnchorElement
's "get the base" and "update steps" algorithms (which are indeed conceptually private methods).Introduces a wrapper around
document.registerElement
that deals with a few pitfalls stemming from custom elements' ES6 integration being incomplete, as well as the need to delete the custom element callbacks.The way private instance state is handled by URLUtils is somewhat disappointing, but will do for now.
Added a demo page, which can be launched with
npm run demo
. It uses the beefy package to do most of the work. Right now it's very crude, and was mainly used as a way for me to verify that the various properties of the<custom-a>
element were working and debug them while they weren't. We can use it to create a more impressive demo of<custom-a>
as it evolves capabilities.