[Bug 12248] Make objects first-class API citizens

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

--- Comment #40 from Cameron McCormack <cam@mcc.id.au> 2011-05-26 21:57:14 UTC ---
I think there would be times when you want to know if a dictionary member
wasn't specified, and where the behaviour of your operation isn't just as if a
particular default value was assumed for that missing member.  For example:

  dictionary ImageDrawingOptions {
    unsigned long width;
    unsigned long height;
  };

  interface Whatever {
    void drawImage(in Image aImage, in optional ImageDrawingOptions options);
  };

Maybe you want to make it so that a call `whatever.drawImage(a, { width: 100
})` results in the height of the drawn image be determined by its aspect ratio.
 You wouldn't be able to use a default value in the IDL there, and you need
drawImage to be able to distinguish between present and not.  Unless you wanted
to say

  dictionary ImageDrawingOptions {
    unsigned long? width = null;
    unsigned long? height = null;
  };

and then define that null means the same thing as the dictionary member not
being present, but that seems less clean to me.

-- 
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, 26 May 2011 21:57:19 UTC