hixie: Define window.external and the SearchProvider APIs, since they are implemented by several browsers to some extent. (whatwg r6140)

hixie: Define window.external and the SearchProvider APIs, since they
are implemented by several browsers to some extent. (whatwg r6140)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.4938&r2=1.4939&f=h
http://html5.org/tools/web-apps-tracker?from=6139&to=6140

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.4938
retrieving revision 1.4939
diff -u -d -r1.4938 -r1.4939
--- Overview.html 13 May 2011 22:34:24 -0000 1.4938
+++ Overview.html 16 May 2011 23:30:20 -0000 1.4939
@@ -1122,14 +1122,16 @@
      <li><a href="#simple-dialogs"><span class="secno">6.4.1 </span>Simple dialogs</a></li>
      <li><a href="#printing"><span class="secno">6.4.2 </span>Printing</a></li>
      <li><a href="#dialogs-implemented-using-separate-documents"><span class="secno">6.4.3 </span>Dialogs implemented using separate documents</a></ol></li>
-   <li><a href="#system-state-and-capabilities:-the-navigator-object"><span class="secno">6.5 </span>System state and capabilities: the <code>Navigator</code> object</a>
+   <li><a href="#system-state-and-capabilities"><span class="secno">6.5 </span>System state and capabilities</a>
     <ol>
-     <li><a href="#client-identification"><span class="secno">6.5.1 </span>Client identification</a></li>
-     <li><a href="#custom-handlers"><span class="secno">6.5.2 </span>Custom scheme and content handlers</a>
+     <li><a href="#the-navigator-object"><span class="secno">6.5.1 </span>The <code>Navigator</code> object</a>
       <ol>
-       <li><a href="#security-and-privacy"><span class="secno">6.5.2.1 </span>Security and privacy</a></li>
-       <li><a href="#sample-handler-impl"><span class="secno">6.5.2.2 </span>Sample user interface</a></ol></li>
-     <li><a href="#manually-releasing-the-storage-mutex"><span class="secno">6.5.3 </span>Manually releasing the storage mutex</a></ol></ol></li>
+       <li><a href="#client-identification"><span class="secno">6.5.1.1 </span>Client identification</a></li>
+       <li><a href="#custom-handlers"><span class="secno">6.5.1.2 </span>Custom scheme and content handlers</a></li>
+       <li><a href="#security-and-privacy"><span class="secno">6.5.1.3 </span>Security and privacy</a></li>
+       <li><a href="#sample-handler-impl"><span class="secno">6.5.1.4 </span>Sample user interface</a></li>
+       <li><a href="#manually-releasing-the-storage-mutex"><span class="secno">6.5.1.5 </span>Manually releasing the storage mutex</a></ol></li>
+     <li><a href="#the-external-interface"><span class="secno">6.5.2 </span>The <code>External</code> interface</a></ol></ol></li>
  <li><a href="#editing"><span class="secno">7 </span>User interaction</a>
   <ol>
    <li><a href="#the-hidden-attribute"><span class="secno">7.1 </span>The <code>hidden</code> attribute</a></li>
@@ -43079,6 +43081,7 @@
 
   // the user agent
   readonly attribute <a href="#navigator">Navigator</a> <a href="#dom-navigator" title="dom-navigator">navigator</a>; 
+  readonly attribute <a href="#external">External</a> <a href="#dom-external" title="dom-external">external</a>;
   readonly attribute <a href="#applicationcache">ApplicationCache</a> <a href="#dom-applicationcache" title="dom-applicationCache">applicationCache</a>;
 
   // user prompts
@@ -50220,7 +50223,7 @@
   value</a> to the given new value.</p>
 
   </div><p class="note">The <code title="dom-window-close"><a href="#dom-window-close">window.close()</a></code> method can be used to
-  close the browsing context.<h3 id="system-state-and-capabilities:-the-navigator-object"><span class="secno">6.5 </span>System state and capabilities: the <code><a href="#navigator">Navigator</a></code> object</h3><div class="impl">
+  close the browsing context.<h3 id="system-state-and-capabilities"><span class="secno">6.5 </span>System state and capabilities</h3><h4 id="the-navigator-object"><span class="secno">6.5.1 </span>The <code><a href="#navigator">Navigator</a></code> object</h4><div class="impl">
 
   <p>The <dfn id="dom-navigator" title="dom-navigator"><code>navigator</code></dfn>
   attribute of the <code><a href="#window">Window</a></code> interface must return an
@@ -50244,7 +50247,7 @@
    
 
    
-  </div><h4 id="client-identification"><span class="secno">6.5.1 </span>Client identification</h4><pre class="idl">[Supplemental, NoInterfaceObject]
+  </div><h5 id="client-identification"><span class="secno">6.5.1.1 </span>Client identification</h5><pre class="idl">[Supplemental, NoInterfaceObject]
 interface <dfn id="navigatorid">NavigatorID</dfn> {  readonly attribute DOMString <a href="#dom-navigator-appname" title="dom-navigator-appName">appName</a>;
   readonly attribute DOMString <a href="#dom-navigator-appversion" title="dom-navigator-appVersion">appVersion</a>;
   readonly attribute DOMString <a href="#dom-navigator-platform" title="dom-navigator-platform">platform</a>;
@@ -50311,7 +50314,7 @@
   identified. For this reason, user agent implementors are strongly
   urged to include as little information in this API as possible.</p>
 
-  </div><h4 id="custom-handlers"><span class="secno">6.5.2 </span>Custom scheme and content handlers</h4><pre class="idl">[Supplemental, NoInterfaceObject]
+  </div><h5 id="custom-handlers"><span class="secno">6.5.1.2 </span>Custom scheme and content handlers</h5><pre class="idl">[Supplemental, NoInterfaceObject]
 interface <dfn id="navigatorcontentutils">NavigatorContentUtils</dfn> {
   // content handler registration
   void <a href="#dom-navigator-registerprotocolhandler" title="dom-navigator-registerProtocolHandler">registerProtocolHandler</a>(in DOMString scheme, in DOMString url, in DOMString title);
@@ -50503,7 +50506,7 @@
 
   </div><div class="impl">
 
-  <h5 id="security-and-privacy"><span class="secno">6.5.2.1 </span>Security and privacy</h5>
+  <h5 id="security-and-privacy"><span class="secno">6.5.1.3 </span>Security and privacy</h5>
 
   <p>These mechanisms can introduce a number of concerns, in
   particular privacy concerns.</p>
@@ -50584,7 +50587,7 @@
 
   </div><div class="impl">
 
-  <h5 id="sample-handler-impl"><span class="secno">6.5.2.2 </span>Sample user interface</h5>
+  <h5 id="sample-handler-impl"><span class="secno">6.5.1.4 </span>Sample user interface</h5>
 
   <p><i>This section is non-normative.</i></p>
 
@@ -50626,7 +50629,7 @@
   method would work equivalently, but for schemes instead of unknown
   content types.</p>
 
-  </div><h4 id="manually-releasing-the-storage-mutex"><span class="secno">6.5.3 </span>Manually releasing the storage mutex</h4><pre class="idl">[Supplemental, NoInterfaceObject]
+  </div><h5 id="manually-releasing-the-storage-mutex"><span class="secno">6.5.1.5 </span>Manually releasing the storage mutex</h5><pre class="idl">[Supplemental, NoInterfaceObject]
 interface <dfn id="navigatorstorageutils">NavigatorStorageUtils</dfn> {
   void <a href="#dom-navigator-yieldforstorageupdates" title="dom-navigator-yieldForStorageUpdates">yieldForStorageUpdates</a>();
 };</pre><dl class="domintro"><dt><var title="">window</var> . <code title="dom-navigator"><a href="#dom-navigator">navigator</a></code> . <code title="dom-navigator-yieldForStorageUpdates"><a href="#dom-navigator-yieldforstorageupdates">yieldForStorageUpdates</a></code>()</dt>
@@ -50664,7 +50667,133 @@
    called, release the <a href="#storage-mutex">storage mutex</a> so that it is once
    again free. Otherwise, it must do nothing.</p>
 
-  </div><h2 id="editing"><span class="secno">7 </span><dfn>User interaction</dfn></h2><h3 id="the-hidden-attribute"><span class="secno">7.1 </span>The <dfn title="attr-hidden"><code>hidden</code></dfn> attribute</h3><p>All <a href="#html-elements">HTML elements</a> may have the <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> content attribute set. The <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> attribute is a <a href="#boolean-attribute">boolean
+  </div><h4 id="the-external-interface"><span class="secno">6.5.2 </span>The <code><a href="#external">External</a></code> interface</h4><div class="impl">
+
+  <p>The <dfn id="dom-external" title="dom-external"><code>external</code></dfn>
+  attribute of the <code><a href="#window">Window</a></code> interface must return an
+  instance of the <code><a href="#external">External</a></code> interface. The same object
+  must be returned each time.</p>
+
+  </div><pre class="idl">interface <dfn id="external">External</dfn> {
+  void <a href="#dom-external-addsearchprovider" title="dom-external-AddSearchProvider">AddSearchProvider</a>(in DOMString engineURL);
+  unsigned long <a href="#dom-external-issearchproviderinstalled" title="dom-external-IsSearchProviderInstalled">IsSearchProviderInstalled</a>(in DOMString engineURL);
+};</pre><dl class="domintro"><dt><var title="">window</var> . <code title="dom-external"><a href="#dom-external">external</a></code> . <code title="dom-external-AddSearchProvider"><a href="#dom-external-addsearchprovider">AddSearchProvider</a></code>( <var title="">url</var> )</dt>
+   <dd>
+
+    <p>Adds the search engine described by the OpenSearch description
+    document at <var title="">url</var>. <a href="#refsOPENSEARCH">[OPENSEARCH]</a></p>
+
+    <p>The OpenSearch description document has to be on the same
+    server as the script that calls this method.</p>
+
+   </dd>
+
+   <dt><var title="">installed</var> = <var title="">window</var> . <code title="dom-external"><a href="#dom-external">external</a></code> . <code title="dom-external-IsSearchProviderInstalled"><a href="#dom-external-issearchproviderinstalled">IsSearchProviderInstalled</a></code>( <var title="">url</var> )</dt>
+   <dd>
+
+    <p>Returns a value based on comparing <var title="">url</var> to
+    the URLs of the results pages of the installed search engines.</p>
+
+    <dl><dt>0 <dd>None of the installed search engines match <var title="">url</var>.
+     <dt>1 <dd>One or more installed search engines match <var title="">url</var>, but none are the user's default search engine.
+     <dt>2 <dd>The user's default search engine matches <var title="">url</var>.
+    </dl><p>The <var title="">url</var> is compared to the URLs of the
+    results pages of the installed search engines using a prefix
+    match. Only results pages on the same domain as the script that
+    calls this method are checked.</p>
+
+   </dd>
+
+  </dl><p class="note">Another way of exposing search engines using
+  OpenSearch description documents is using a <code><a href="#the-link-element">link</a></code>
+  element with the <code title="rel-search"><a href="#link-type-search">search</a></code> link
+  type.<div class="impl">
+
+   <p>The <dfn id="dom-external-addsearchprovider" title="dom-external-AddSearchProvider"><code>AddSearchProvider()</code></dfn>
+   method, when invoked, must run the following steps:</p>
+
+   <ol><li><p>Optionally, abort these steps. User agents may implement
+    the method as a stub method that never does anything, or may
+    arbitrarily ignore invocations with particular arguments for
+    security, privacy, or usability reasons.</li>
+
+    <li><p><a href="#resolve-a-url" title="resolve a url">Resolve</a> the <var title="">scriptURL</var> argument relative to the <a href="#entry-script">entry
+    script</a>'s <a href="#script-s-base-url" title="script's base URL">base
+    URL</a>.</li>
+
+    <li><p>If this fails, abort these steps.</li>
+
+    <li><p>If the <a href="#origin">origin</a> of the resulting <a href="#absolute-url">absolute
+    URL</a> is not the <a href="#same-origin" title="same origin">same</a> as the
+    origin of the <a href="#entry-script">entry script</a>, then abort these
+    steps.</li>
+
+    <li><p>Process the resulting <a href="#absolute-url">absolute URL</a> as the
+    <a href="#url">URL</a> to an OpenSearch description document. <a href="#refsOPENSEARCH">[OPENSEARCH]</a></li>
+
+   </ol><p>The <dfn id="dom-external-issearchproviderinstalled" title="dom-external-IsSearchProviderInstalled"><code>IsSearchProviderInstalled()</code></dfn>
+   method, when invoked, must run the following steps:</p>
+
+   <ol><li><p>Optionally, return 0 and abort these steps. User agents may
+    implement the method as a stub method that never returns a
+    non-zero value, or may arbitrarily ignore invocations with
+    particular arguments for security, privacy, or usability
+    reasons.</li>
+
+    <li><p>If the <a href="#origin">origin</a> of the <a href="#entry-script">entry script</a>
+    is an opaque identifier (i.e. it has no host component), then
+    return 0 and abort these steps.</li>
+
+    <li><p>Let <var title="">host1</var> be the host component of the
+    <a href="#origin">origin</a> of the <a href="#entry-script">entry script</a>.</li>
+
+    <li><p><a href="#resolve-a-url" title="resolve a url">Resolve</a> the <var title="">scriptURL</var> argument relative to the <a href="#entry-script">entry
+    script</a>'s <a href="#script-s-base-url" title="script's base URL">base
+    URL</a>.</li>
+
+    <li><p>If this fails, return 0 and abort these steps.</li>
+
+    <li><p>Let <var title="">host2</var> be be the <a href="#url-host" title="url-host">&lt;host&gt;</a> component of the resulting
+    <a href="#absolute-url">absolute URL</a>.</li>
+
+    <li>
+
+     <p>If the longest suffix in the Public Suffix List that matches
+     the end of <var title="">host1</var> is different than the
+     longest suffix in the Public Suffix List that matches the end of
+     <var title="">host2</var>, then return 0 and abort these steps.
+     <a href="#refsPSL">[PSL]</a></p>
+
+     <p>If the next domain component of <var title="">host1</var> and
+     <var title="">host2</var> after their common suffix are not the
+     same, then return 0 and abort these steps.</p>
+
+     <p>Domain labels must be compared after applying the IDNA ToASCII
+     algorithm to them, with both the AllowUnassigned and
+     UseSTD3ASCIIRules flags set, in an <a href="#ascii-case-insensitive">ASCII
+     case-insensitive</a> manner. <a href="#refsRFC3490">[RFC3490]</a></p>
+
+    </li>
+
+    <li><p>Let <var title="">search engines</var> be the list of
+    search engines known by the user agent and made available to the
+    user by the user agent for which the resulting <a href="#absolute-url">absolute
+    URL</a> is a <a href="#prefix-match">prefix match</a> of the search engine's
+    <a href="#url">URL</a>, if any. For search engines registered using
+    OpenSearch description documents, the <a href="#url">URL</a> of the
+    search engine corresponds to the URL given in a <code title="">Url</code> element whose <code title="">rel</code>
+    attribute is "<code title="">results</code>" (the default). <a href="#refsOPENSEARCH">[OPENSEARCH]</a></li>
+
+    <li><p>If <var title="">search engines</var> is empty, return 0
+    and abort these steps.</li>
+
+    <li><p>If the user's default search engine (as determined by the
+    user agent) is one of the search engines in <var title="">search
+    engines</var>, then return 2 and abort these steps.</li>
+
+    <li><p>Return 1.</li>
+
+   </ol></div><h2 id="editing"><span class="secno">7 </span><dfn>User interaction</dfn></h2><h3 id="the-hidden-attribute"><span class="secno">7.1 </span>The <dfn title="attr-hidden"><code>hidden</code></dfn> attribute</h3><p>All <a href="#html-elements">HTML elements</a> may have the <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> content attribute set. The <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> attribute is a <a href="#boolean-attribute">boolean
   attribute</a>. When specified on an element, it indicates that
   the element is not yet, or is no longer, relevant. <span class="impl">User agents should not render elements that have the
   <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> attribute

Received on Monday, 16 May 2011 23:33:38 UTC