Re: Setting document.domain

On Thu, 29 Jan 2009, Gervase Markham wrote:
> 
> ==Matching Algorithm==
> 
> The list is designed to be matched against domain names. Given a domain
> name, consisting of one or more dot-separated labels, and a copy of the
> public suffix list containing a number of rules, there are three
> possible outcomes of a matching:
> 
>    1. there is no match between the public suffix list and the domain
>       name (e.g. "localhost.localdomain" or "intranet")
>    2. all labels in the domain name together form a public suffix (e.g.
>       "co.uk" or "nsw.edu.au")
>    3. a strict subset of labels in the domain name, beginning at the
>       right-hand end, together form a public suffix (e.g. "bbc.co.uk"
>       or "google.com")
> 
> To determine which is the correct outcome for a domain candidate.domain,
> the procedure is as follows:

Does 2 also include cases like "uk"? For HTML5's document.domain, I need 
that case as well.

The only other comment would be that it is helpful if there are 
defined terms, so that there is no ambiguity when "linking" the specs 
(with a parallel drawn to linking code). In this case, the three (or four) 
items in the list could be given names, e.g. "no match", "public match", 
and "private match" (or whatever).

With those labels, I could say

   If /new value/, when matched against the Public Suffix List, results 
   in a /public match/ with one of the suffixes, then throw a SECURITY_ERR 
   exception and abort these steps. [PSL]

Cheers,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Thursday, 29 January 2009 06:22:34 UTC