This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23358 - A hook for objects that can enter a "dead" mode
Summary: A hook for objects that can enter a "dead" mode
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: public-webapps-bugzilla
Depends on:
Blocks: 23359
  Show dependency treegraph
Reported: 2013-09-25 23:20 UTC by Ian 'Hixie' Hickson
Modified: 2013-11-13 20:48 UTC (History)
7 users (show)

See Also:


Description Ian 'Hixie' Hickson 2013-09-25 23:20:06 UTC
I'd like a WebIDL attribute I can put on interfaces that says "anything on this that gets called should throw if it is not [magic hook]" (where [magic hook] would be "its Document is the active document of its Document's browsing context" for the History interface, for instance). Right now I only have one use case, but I have a feeling this will come up more often. For example, maybe that would be a good way to handle objects that are neutered by the structure cloning stuff.
Comment 1 Cameron McCormack 2013-09-26 01:18:42 UTC
On IRC you suggested maybe we don't even need an extended attribute for this, just a hook that gets invoked at the right places.  Just like we have the "perform a security check" on operation invocation, attribute access, etc.

Are the cases you want to handle here just another kind of security check, and we can use the same mechanism?  The spec throws a SecurityError if the security check fails.  Is that appropriate for the cases you want to handle?  Can you do some testing to find out?
Comment 2 Boris Zbarsky 2013-09-26 02:53:57 UTC
Is there a reason this can't happen effectively in the "prose" section (i.e. after argument conversion)?  In practice it only matters if your argument conversions trigger side-effects (including exceptions), but doing this sort of check before argument conversions imposes a significant cost in implementation complexity that doesn't seem warranted here.
Comment 3 Ian 'Hixie' Hickson 2013-09-26 18:10:56 UTC
Taking to do further research.
Comment 4 Ian 'Hixie' Hickson 2013-11-13 20:48:44 UTC
I'll deal with the History case in prose.