- From: Francois Daoust <fd@w3.org>
- Date: Thu, 02 Jul 2009 17:46:50 +0200
- To: marcosc@opera.com
- CC: public-webapps@w3.org
Hi Marcos, Marcos Caceres wrote: [...] >> Comment 1: relative can't be absolute >> ----- [...] > Fixed. Used your text. OK. >> Comment 2: links resolution in e.g. start file >> ----- >> The specification implies but does not define how links in documents other >> than the configuration document are to be handled (or did I miss >> something?). In particular, how is a user agent supposed to resolve relative >> links to packaged files that appear in the start file? > > You are absolutely right. However, the WG decided that URI resolution > is out of scope for the P&C specification so we only recently > published Widgets 1.0: URI Scheme specification: > http://dev.w3.org/2006/waf/widgets-uri/ > > To make sure that it is clear that the P&C spec will not be handling > URIs outside the scope of the config.xml, I've added the following > note to the spec: > > "Note: This specification does not define how links in documents other > than the configuration document are to be dereferenced. For handling > links in other documents, such as (X)HTML, CSS, SVG, ect., please > refer to the [Widgets URI] specification." > > Is the above text sufficient? Yes. I saw the widget scheme document too late, I agree it addresses this comment. >> Comment 3: localization and absolute URIs >> ----- >> We more or less already exchanged emails on that, but... I don't understand >> the need to have absolute paths bypass localization. > > I guess the logic is that authors, for whatever reason (e.g., force > testing a locale without needing to change the locale on their > device), are going to use absolute URIs, so I'm of the opinion that we > support them. Right but they don't seem to be supported by the widget scheme document. See example below. > >> Consider the two examples below: >> 1. a config document that contains a <content src="startfolder/index.html" >> /> directive >> 2. a config document that contains a <content src="/startfolder/index.html" >> /> directive >> >> I think people are used to using relative and absolute paths in links >> interchangeably. Since the config document is at the root of the widget, I >> would expect the two examples to have the same effect. > > Yes, they would have the same effect iff the folder structure was: > > widget.wgt > /startfolder/ > > But, for whatever reason, the folder structure was as follows, it > would also work: > > widget.wgt > startfolder/index.html > fr/startfolder/index.html > jp/startfolder/index.html > >> Here, if the widget's >> package contains a locales/fr/index.html, it may be used in the first case >> (provided "fr" is in user agent locales of course), but it won't ever be >> used in the second case. > > Yes, for case 1, so long as: > > widget.wgt > fr/startfolder/index.html > > And yes, it will not be matched in case 2... which is what I would expect. > >> I realize that when an absolute path is treated the same way as a relative >> path, the "Complex example" of 8.4 Localization Examples: >> http://dev.w3.org/2006/waf/widgets/#complex-example >> ... cannot be implemented as such in practice. I think that's fine, there >> should not be any way for something in a "locales/[LANG]" folder (or >> wherever else for that matter) to bypass the localization algorithm. Having >> one complicates things more than anything else, IMHO. > > I personally don't agree (I personally like the way it works right now > and seem consistent with the way I would expect absolute paths to > work). However, I think I will defer this to the working group for a > resolution; others may agree with your position or I might not be > understanding your proposal. I'd say you understood what I meant ;) Note I do not object to the group's final resolution on this, whatever it may be. Let me just try another example that mixes this document and the widget scheme doc to clarify what I find slightly inconsistent. Consider the following widget package, and a user agent that has "fr" in its locales: widget.wgt config.xml start.html about.html locales fr start.html about.html config.xml points to start.html as the widget start file through a <content src="/start.html" /> element. The mapping between the path and the widget resource is defined in the Packaging spec. start.html links to about.html through a <a href="/about.html">About this widget</a> link. The mapping between the path and the widget resource is defined in the widget scheme spec. Both links use absolute paths. Visually, they look alike. Per the rule for finding a file within a widget package [1] defined in the packaging spec, the start file is resolved in step 3, and matches "widget.wgt/start.html". No localization because it is an absolute path. Per the Mapping widget URIs to Widget Resources [2] section in the widget scheme spec, the starting "/" gets removed before applying the rule for finding a file within a widget package [1], so "about.html" enters the rule steps, localization occurs, and "widget.wgt/locales/fr/about.html" gets matched. From a user perspective, why should there be a difference between the way links in the config file and links in other files are mapped to widget resources? Francois. [1] http://dev.w3.org/2006/waf/widgets/#rule-for-finding-a-file-within-a-widget-0 [2] http://dev.w3.org/2006/waf/widgets-uri/#mapping-widget-uris-to-widget-resources
Received on Thursday, 2 July 2009 15:47:31 UTC