W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2011

[Bug 12845] Disallow shadowing attributes

From: <bugzilla@jessica.w3.org>
Date: Thu, 02 Jun 2011 02:11:01 +0000
To: public-script-coord@w3.org
Message-Id: <E1QRxNF-0002kn-Jk@jessica.w3.org>

--- 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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:03 UTC