Remove Quirks Mode

Scope of change: Small

Champion Name: Matt Marum

Specification Editors: Andy Smith / Matt Marum

Reference Implementation: 1 week for Matt Marum to develop patch for Shindig (https://issues.apache.org/jira/browse/SHINDIG-1504)

Background

In the part of the current OpenSocial Core Gadget specification that defines how Gadget Rendering Requests are to be handled, the specification states that "Gadgets run in browser quirks mode."  This requirement is seen as a holdover from the past.  Many Developers today would prefer to use standards mode when rendering their gadgets.  Some OpenSocial containers currently ignore this part of the spec.

Use Cases

  1. Gadget Developer creates a new OpenSocial Gadget with content designed in standard HTML5. The Developer wants to deploy this gadget in an OpenSocial container and expects the content to be rendered correctly.
  2. Gadget Developer creates a new OpenSocial Gadget using OpenSocial 2.0 but has content that still requires the use of browser quirks mode to be rendered correctly.  The Developer wants to be able to deploy this gadget in an OpenSocial 2.0 container and have the content rendered in quirks mode.

Proposal

Containers MUST use HTML5 as the default DOCTYPE for Gadgets using version 2.0 or greater of the OpenSocial specification, as indicated by Module/@specificationVersion.  For specification versions less than 2.0,  Containers MUST continue to use quirks mode by default.  Note that the existing Versioning rules continue to apply.

In addition to the defaults above, we propose adding an optional string attribute called doctype to the ModulePrefs element.

<Module>
  <ModulePrefs doctype="quirksmode">
  ...
  </ModulePrefs>
...
</Module>

When the "doctype" attribute value is "quirksmode", Containers SHOULD render the Gadget in browser quirks mode. This attribute can be later extended to allow custom DOCTYPEs for rendering Gadgets.  Developers should recognize that in some cases, such as when Gadgets are inlined, the value of the doctype attribute may have to be ignored.

Discussion

https://groups.google.com/d/topic/opensocial-and-gadgets-spec/yNJ7BeLtT2k/discussion

http://code.google.com/p/opensocial-resources/issues/detail?id=1139