Re: [widgets] Seeking comments on Last Call WD of Widgets: APIs and Events spec; deadline 15 Sept 2009

On Thu, Aug 20, 2009 at 11:16 AM, Marcos Caceres<> wrote:
>> The lack of review should be obvious from the errors in nearly all the
>> examples: in 6.5.1 it uses made-up schemes without pointing that out in
>> any way,

They are not made up? - only feed does not have a spec!  Specs below:

//open email

//make a phone call

//open a web page

//send and sms


I've removed feed, but still hold that is is valid even though it is
not standardized.

>  6.4.2 invokes a .forEach method on a NodeList that a NodeList
>> is not defined to have,

Yep, Robin's code was no good. I rewrote it (and tested it in FF using
window.localStorage to make sure it works):

<!doctype html>
<fieldset id="prefs-form">
  <legend>Game Options</legend>
  <label>Volume:  <input type="range" min="0" max="100"
name="volume"/> </label>
  <label>Difficulty:  <input type="range" min="0" max="100"
name="difficulty"/> </label>
  <input type="button" value="Save" onClick="savePrefs()"/>

var form   = document.getElementById("prefs-form");
var fields = form.querySelectorAll("input[type='range']");

function loadPrefs () {
   for(i in fields){
      var field = fields[i];
      if (typeof widget.preferences[] != "undefined") {
        field.value = widget.preferences[];

function savePrefs () {
  for(var i = 0; i < fields.length; i++){
      var field = fields[i];
      widget.preferences[] = field.value;

>  in 6.4.1 the JSON code is malformed due to usage
>> of the wrong quote marks,

Ok, got me there! :) I didn't know you were not allowed to use single
quotes in JSON.

> and 6.1.1 fails to escape the markup it
>> attempts to insert, leading to undesired effects if special characters
>> are used in the values.

Ok, can you help us out with some good text to use here? How do you
recommend we secure this bit?

Kind regards,

Marcos Caceres

Received on Thursday, 20 August 2009 19:41:49 UTC