[whatwg] Week Strings
For input type=week elements the spec requires: The value attribute, if specified, must have a value that is a valid week string. -- http://www.whatwg.org/html5#week-state But the spec's HTML source contains this comment immediately afterwards: !-- ok to set out-of-range value, we never know when we might have to represent bogus input -- Does that comment mean that the above requirement will be changed to something along the lines of must have a value that is a syntactically valid week string but may represent a week that doesn't actually exist? That is, the author can seed a browser's week-picker control to a value which the browser must not submit back to the server? In general determining that something is a valid week string requires knowing which day of the week the year in question begins on. For example 2009-W53 is a valid week string (because 2009 began on a Thursday) but 2010-W53 isn't (because 2010 will begin on a Friday). Browsers will need to do this to know whether they can submit a week value. The spec doesn't appear to provide an algorithm for determining which day of the week a year begins on (however I am not a browser developer; possibly this is sufficiently straightforward that those who are don't need it spelling out). Currently Validator.nu accepts this: input type=week value=2010-W53 but not this: input type=week value=2010-W54 If out-of-range week values are to be permitted in input elements then a validator should permit both of them. Conversely if they aren't permitted then it should accept neither of them (and therefore have to implement a 'which day is January 1st' algorithm, which I'm guessing it currently doesn't). Smylers
Re: [whatwg] Week Strings
On Fri, 19 Jun 2009 11:48:17 +0200, Smylers smyl...@stripey.com wrote: The spec doesn't appear to provide an algorithm for determining which day of the week a year begins on (however I am not a browser developer; possibly this is sufficiently straightforward that those who are don't need it spelling out). It does actually, but it is not clearly linked from valid week and such: http://www.whatwg.org/specs/web-apps/current-work/#weeks If out-of-range week values are to be permitted in input elements then a validator should permit both of them. Conversely if they aren't permitted then it should accept neither of them (and therefore have to implement a 'which day is January 1st' algorithm, which I'm guessing it currently doesn't). Or maybe it implements the bogus one the specification previously defined. -- Anne van Kesteren http://annevankesteren.nl/
Re: [whatwg] Week Strings
Anne van Kesteren writes: On Fri, 19 Jun 2009 11:48:17 +0200, Smylers smyl...@stripey.com wrote: The spec doesn't appear to provide an algorithm for determining which day of the week a year begins on (however I am not a browser developer; possibly this is sufficiently straightforward that those who are don't need it spelling out). It does actually, but it is not clearly linked from valid week and such: http://www.whatwg.org/specs/web-apps/current-work/#weeks That says that 1969 December 29th was a Monday, but doesn't appear to give an algorithm for answering the question Will the year 2010 begin on a Thursday?. Smylers
Re: [whatwg] Week Strings
An algorithm for calculating the weekday of Jan. 1st given a year would be outside the scope of the HTML specification. Similarly, the HTML specification does not describe how you increment a number by 1. IMHO, Chris
Re: [whatwg] External document subset support
You can easily include a cross-domain script using a cross-domain DTD; just attach the malware as !ATTLIST body onload CDATA { sniper.shoot(); } and hope for the worst. Chris
Re: [whatwg] Dom as Audience Prereq
Unlike in previous versions, the DOM is the skeleton and the underlying model of the specification. Even if there are sections that do not reference the DOM explicitly, a reader that tries to apply them to anything will not probably be able to draw the right conclusions without a basic knowledge of the DOM. IMHO, Chris
Re: [whatwg] b Lede Example
A lede is a summary or an invitation to read the whole article. It is semantically relevant; the reader may ask, e.g., Give me the ledes and I shall choose what I would like to read. Asking for the first paragraph of each article is not that practical, as the article need not contain a lede there, in which case it is better to return nothing. IMHO, Chris
Re: [whatwg] Week Strings
Křištof Želechovski writes: An algorithm for calculating the weekday of Jan. 1st given a year would be outside the scope of the HTML specification. That's begging the question. Similarly, the HTML specification does not describe how you increment a number by 1. No, but it does explain how to interpret a sequence of digits as an integer (multiplying the value by 10 for each digit encountered). And defines that week is a period of 7 days. And defines how many days there are in each month of a year. And even states the blindingly obvious: The 'week number of the last day' of a week-year with 53 weeks is 53; the 'week number of the last day' of a week-year with 52 weeks is 52. Those things all seem much more obvious to me than working out which day January 1st of a given year is. But as I said, I'm not a browser developer so perhaps it's fine. Smylers
Re: [whatwg] Week Strings
On Fri, Jun 19, 2009 at 2:32 PM, Smylerssmyl...@stripey.com wrote: The 'week number of the last day' of a week-year with 53 weeks is 53; the 'week number of the last day' of a week-year with 52 weeks is 52. well... there are people who might think you could count from week 0 if weeks are numbered from the first whole week. there are all sorts of ways to get numbering wrong. (I've been at a place which has both 53 and 0 ...)
Re: [whatwg] Week Strings
An algorithm to calculate the weekday of Jan. 1th given a year is not obvious at all. Just the opposite: the more obvious an external fact is, the easier (and more appropriate) it is to incorporate it to the specification because it does not cause any distraction from the main subject. Cheers, Chris
Re: [whatwg] External document subset support
2009/6/19 Kristof Zelechovski giecr...@stegny.2a.pl: You can easily include a cross-domain script using a cross-domain DTD; just attach the malware as !ATTLIST body onload CDATA “{ sniper.shoot(); }” and hope for the worst. Chris You need to own the external subset, though, in order to add that !ATTLIST. It is like saying that shared JS libraries are dangerous because you import code from other sources. Giovanni
Re: [whatwg] Dom as Audience Prereq
Kristof Zelechovski writes: Unlike in previous versions, the DOM is the skeleton and the underlying model of the specification. Yup. But I don't think any more Dom knowledge is needed to read this version. Even if there are sections that do not reference the DOM explicitly, a reader that tries to apply them to anything will not probably be able to draw the right conclusions without a basic knowledge of the DOM. I think that an author wanting to know how to use certain elements to mark up a static document (no scripting) could understand enough of the relevant sections -- for example the rules on when to use which of strong, mark, b or providing alt text for images. Smylers
Re: [whatwg] Week Strings
timeless writes: On Fri, Jun 19, 2009 at 2:32 PM, Smylerssmyl...@stripey.com wrote: The 'week number of the last day' of a week-year with 53 weeks is 53; the 'week number of the last day' of a week-year with 52 weeks is 52. well... there are people who might think you could count from week 0 Except that the spec has already defined that a year starts on week 1 before the above sentence. Smylers
Re: [whatwg] b Lede Example
Kristof Zelechovski writes: A lede is a summary or an invitation to read the whole article. It is semantically relevant; the reader may ask, e.g., Give me the ledes and I shall choose what I would like to read. For a user-agent to reliably provide that functionality would require a specific lede element, not merely allowing one of several uses of b be for denoting ledes. Using b for ledes really only enables ledes to be styled differently, not for semantic interpretation. Asking for the first paragraph of each article is not that practical, as the article need not contain a lede there Are there sites which have variable-length semantic ledes, use an element to mark that up, and where a reader who doesn't have the lede styled differently (for example if span class=lede is used and the reader doesn't have CSS) is missing something? In practice it seems that sites which style ledes also have a journalistic house style which requires journalists to consistently have the lede be the first paragraph (or whatever). Smylers
Re: [whatwg] Week Strings
Getting the day of the week, in the Gregorian calendar, for a given date is pretty straightforward. I thought we publihsed it online somehwere on the Royal Observatory website, but I can't find it. However, wikipedia has the algorithm: http://en.wikipedia.org/wiki/Calculating_the_day_of_the_week#An_algorithm_to _calculate_the_day_of_the_week Cheers Jim O'Donnell Original Message: - From: K�i�tof �elechovski giecr...@stegny.2a.pl Date: Fri, 19 Jun 2009 13:39:55 +0200 To: smyl...@stripey.com, whatwg@lists.whatwg.org Subject: Re: [whatwg] Week Strings An algorithm to calculate the weekday of Jan.�1th given a year is not obvious at all. Just the opposite: the more obvious an external fact is, the easier (and more appropriate) it is to incorporate it to the specification because it does not cause any distraction from the main subject. Cheers, Chris mail2web LIVE Free email based on Microsoft® Exchange technology - http://link.mail2web.com/LIVE
Re: [whatwg] Storage Events for a Specific Storage Area
It sounds like there wasn't any discussion on this. I recently heard talk of other potential Storage areas [2]. That would make this idea even more appealing to me. Does this sound like something worth adding? Any comments? [2]: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-June/020485.html On Jun 17, 2009, at 1: 44PM, Joseph Pecoraro wrote: The storage event [1] fires for both sessionStorage and localStorage. To me, this means if you only want to interact with localStorage you will have to manually ensure that it is the storage area being modified: window.addEventListener('storage', function(e) { if ( e.storageArea === localStorage ) { // ... } } Was there any discussion about creating events specific to the storage object, or should that already be possible? I've been playing around with WebKit's Storage implementation, and the following (understandably) is not possible: localStorage.addEventListener undefined Is there any way to listen to events for a single specific storage area or is the previously mentioned approach preferred? Cheers, Joe [1]: http://dev.w3.org/html5/webstorage/#the-storage-event