[Bug 12845] Disallow shadowing attributes

http://www.w3.org/Bugs/Public/show_bug.cgi?id=12845

--- Comment #8 from Boris Zbarsky <bzbarsky@mit.edu> 2011-06-02 02:11:01 UTC ---
> I'm not actually sure what the problem with the shadowing attribute is.

The main issue I see is that it's a footgun for spec writers.  If you allow
this, then it becomes easy for someone to introduce an attribute on Element,
say, that's shadowed by preexisting attributes on Element subclasses, and then
suddenly things get very weird.

If shadowing were disallowed (and if it were, Mozilla's webidl impl at least
would make it a compile-time error), this would be detected as soon as anyone
tries to implement the new property.

For that matter, defining a property on some Element subclass that shadows a
preexisting Element property is a footgun too.  If the getter or setter don't
match what the Element property does (assuming it has both a getter and setter)
you're introducing a compat issue.  So in practice when you shadow you need to
specify the same behavior for the shadower and shadowee getter/setter
(whichever exists).  At which point, why should WebIDL allow anything else?

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Received on Thursday, 2 June 2011 02:11:03 UTC