Fix HTMLLegendElement for FF21

In FF21 legend uses the old XPCOM binding which has issues that changing
window.HTLMElement changes any sub class that has HTMLElement in its prototype
chain. We therefore need to ensure that we do not override HTMLElement before
overriding HTMLLegendElement.