On 7/2/14, 11:07 AM, Adam Barth wrote:
I've studied the XBL implementation of <marquee> in Gecko, and it does leak some implementation details.
Absolutely. The point of the XBL implementation was to provide the functionality (back before there was a spec for it, note) at minimal cost and core complexity. It's not even close to what hixie has specced for marquee right now.
As a simple example, alert(document.createElement('marquee')) in Firefox says "[object HTMLDivElement]" because the XBL implementation uses a div.
It's because XBL doesn't have a way to affect the sort of JS object that's created for the element and we explicitly map the "marquee" tag name to creating an HTMLDivElement C++ object because we didn't really have any better sort of C++ object for it to create.
Web components can help solve parts of this "what sort of JS object to create?", I agree.
-Boris