From simonp at opera.com Thu Apr 1 02:04:51 2010 From: simonp at opera.com (Simon Pieters) Date: Thu, 01 Apr 2010 10:04:51 +0100 Subject: [whatwg] some comments on establish a WebSocket connection Message-ID: The establish a WebSocket connection algorithm says: [[ 35. ... ?If the byte is 0x20 (ASCII space) Ignore the byte and move on to the next step. Otherwise Treat the byte as described by the list in the next step, then move on to that next step for real. Note: This skips past a space character after the colon, if necessary. 36. Read a byte from the server. If the connection closes before this byte is received, then fail the WebSocket connection and abort these steps. Otherwise, handle the byte as described in the appropriate entry below: ?If the byte is 0x0D (ASCII CR) Move on to the next step. ]] Consider the case when the server gives a colon followed by CR. My reading is that step 36 will be run twice: Upon receiving the CR in step 35, "Treat the byte as described by the list in the next step" which is "Move on to the next step." (i.e. step 37), "then move on to that next step for real." (i.e. step 36). Step 41 says: [[ If the entry's name is "set-cookie" or "set-cookie2" or another cookie-related field name If the relevant specification is supported by the user agent, handle the cookie as defined by the appropriate specification, with the resource being the one with the host host, the port port, the path (and possibly query parameters) resource name, and the scheme http if secure is false and https if secure is true. [COOKIES] ]] What should be done if the relevant specification is not supported? -- Simon Pieters Opera Software From no at opera.com Thu Apr 1 00:33:27 2010 From: no at opera.com (Niklas Beischer) Date: Thu, 01 Apr 2010 10:33:27 +0300 Subject: [whatwg] WebSocket bufferedAmount includes overhead or not In-Reply-To: References: <9F539841-2652-4B5A-BAE2-B681100BBEBA@webkit.org> <4BA88C13.4010908@helsinki.fi> <63df84f1003292319m6dc167boe77cb30d1d1a9fa9@mail.gmail.com> <63df84f1003300722t3aa2b4c4r5f6f7cb8a1541d60@mail.gmail.com> Message-ID: On Thu, 01 Apr 2010 00:44:57 +0300, Jonas Sicking wrote: > On Tue, Mar 30, 2010 at 11:06 PM, Niklas Beischer wrote: >> On Tue, 30 Mar 2010 17:22:07 +0300, Jonas Sicking >> wrote: >> >>> On Tue, Mar 30, 2010 at 1:51 AM, Niklas Beischer wrote: >>>> >>>> On Tue, 30 Mar 2010 09:19:33 +0300, Jonas Sicking >>>> wrote: >>>>> >>>>> On Wed, Mar 24, 2010 at 2:33 PM, Ian Hickson wrote: >>>>>> >>>>>> On Tue, 23 Mar 2010, Anne van Kesteren wrote: >>>>>>> >>>>>>> We (Opera) would prefer this too. I.e. to not impose details of the >>>>>>> protocol on the API. >>>>>> >>>>>> If we're exposing nothing from the protocol, does that mean we >>>>>> shouldn't >>>>>> be exposing that the string converts to UTF-8 either? >>>>> >>>>> While exposing the fact that strings are sent as UTF-8 does say >>>>> something about the protocol, I think it's still much more protocol >>>>> independent than including the message headers. The string has to be >>>>> serialized in some way, and it seems unlikely that any newly >>>>> developed >>>>> protocol in the foreseeable future would use anything other than >>>>> UTF-8 >>>>> as serialization. >>>> >>>> True, but if bufferedAmount does not byte for byte (or character for >>>> character) match what is fed to the API, what does a few bytes >>>> representing the current overhead matter? IIRC EcmaScript uses UTF-16, >>>> which means that serialization will in most cases make the number of >>>> actually buffered bytes differ from the number of bytes in the >>>> original >>>> message buffer. >>> >>> EcmaScript doesn't do any serialization so I'm not sure what you mean >>> here? >> >> I meant the serialization in the WebSocket. Unless the protocol >> implementation keeps track of exactly how its serialized buffer differs >> from >> the original buffer it will not be able to give a correct answer to how >> much >> of the original buffer is left to transfer. >> >> >>>> And just because we currently use UTF-8 for >>>> serialization doesn't mean that will always be the case. Thus API >>>> users >>>> cannot rely on performing their own conversion to UTF-8 just to find >>>> out >>>> exactly how many characters in their message have been sent. >>> >>> My point was that using anything but UTF-8 is unlikely. So the >>> opposite of what you're saying here. >> >> So you're saying binary is out of the question? > > No. At this point I'm confused as to what your point is. Unless you're > simply agreeing with the earlier emails in this thread that the fact > that we're converting to UTF-8 and use the converted bytes exposes > some protocol details. Are you arguing anything other than that? No, I'm not arguing anything else. I do agree that it exposes protocol details. My point is that precisely that makes it more or less pointless to hide other protocol specifics. Specifics that have minor impact on the actual number bufferedAmount contains. According to your suggestion we should expose the impact of serialization but hide the framing. I don't see the reason for drawing the line between the two. It will, in my opinion, only complicate the implementation. BR, /niklas -- Niklas Beischer Software Developer Opera Software From jonas at sicking.cc Thu Apr 1 02:20:46 2010 From: jonas at sicking.cc (Jonas Sicking) Date: Thu, 1 Apr 2010 02:20:46 -0700 Subject: [whatwg] WebSocket bufferedAmount includes overhead or not In-Reply-To: References: <4BA88C13.4010908@helsinki.fi> <63df84f1003292319m6dc167boe77cb30d1d1a9fa9@mail.gmail.com> <63df84f1003300722t3aa2b4c4r5f6f7cb8a1541d60@mail.gmail.com> Message-ID: On Thu, Apr 1, 2010 at 12:33 AM, Niklas Beischer wrote: > On Thu, 01 Apr 2010 00:44:57 +0300, Jonas Sicking wrote: > >> On Tue, Mar 30, 2010 at 11:06 PM, Niklas Beischer wrote: >>> >>> On Tue, 30 Mar 2010 17:22:07 +0300, Jonas Sicking >>> wrote: >>> >>>> On Tue, Mar 30, 2010 at 1:51 AM, Niklas Beischer wrote: >>>>> >>>>> On Tue, 30 Mar 2010 09:19:33 +0300, Jonas Sicking >>>>> wrote: >>>>>> >>>>>> On Wed, Mar 24, 2010 at 2:33 PM, Ian Hickson wrote: >>>>>>> >>>>>>> On Tue, 23 Mar 2010, Anne van Kesteren wrote: >>>>>>>> >>>>>>>> We (Opera) would prefer this too. I.e. to not impose details of the >>>>>>>> protocol on the API. >>>>>>> >>>>>>> If we're exposing nothing from the protocol, does that mean we >>>>>>> shouldn't >>>>>>> be exposing that the string converts to UTF-8 either? >>>>>> >>>>>> While exposing the fact that strings are sent as UTF-8 does say >>>>>> something about the protocol, I think it's still much more protocol >>>>>> independent than including the message headers. The string has to be >>>>>> serialized in some way, and it seems unlikely that any newly developed >>>>>> protocol in the foreseeable future would use anything other than UTF-8 >>>>>> as serialization. >>>>> >>>>> True, but if bufferedAmount does not byte for byte (or character for >>>>> character) match what is fed to the API, what does a few bytes >>>>> representing the current overhead matter? IIRC EcmaScript uses UTF-16, >>>>> which means that serialization will in most cases make the number of >>>>> actually buffered bytes differ from the number of bytes in the original >>>>> message buffer. >>>> >>>> EcmaScript doesn't do any serialization so I'm not sure what you mean >>>> here? >>> >>> I meant the serialization in the WebSocket. Unless the protocol >>> implementation keeps track of exactly how its serialized buffer differs >>> from >>> the original buffer it will not be able to give a correct answer to how >>> much >>> of the original buffer is left to transfer. >>> >>> >>>>> And just because we currently use UTF-8 for >>>>> serialization doesn't mean that will always be the case. Thus API users >>>>> cannot rely on performing their own conversion to UTF-8 just to find >>>>> out >>>>> exactly how many characters in their message have been sent. >>>> >>>> My point was that using anything but UTF-8 is unlikely. So the >>>> opposite of what you're saying here. >>> >>> So you're saying binary is out of the question? >> >> No. At this point I'm confused as to what your point is. Unless you're >> simply agreeing with the earlier emails in this thread that the fact >> that we're converting to UTF-8 and use the converted bytes exposes >> some protocol details. Are you arguing anything other than that? > > No, I'm not arguing anything else. I do agree that it exposes protocol > details. My point is that precisely that makes it more or less pointless to > hide other protocol specifics. Specifics that have minor impact on the > actual number bufferedAmount contains. > > According to your suggestion we should expose the impact of serialization > but hide the framing. I don't see the reason for drawing the line between > the two. It will, in my opinion, only complicate the implementation. I agree it does complicate the implementation, but as far as I can see not very much. Thus I prioritize utility to webpages over lazyness of web browser authors ;) The reason I think that I think we should hide framing is that this is much more likely to change in future versions of the protocol. For example if we add support for multiplexing (I don't know how likely this is) we'll possibly have to add an extra byte to frames to indicate channel. This could be negotiated on connection as to keep things backwards compatible. However I see it as much less likely that future versions of websocket will change strings from being serialized as UTF-8 to being serialized as something else. / Jonas From hsivonen at iki.fi Thu Apr 1 02:29:34 2010 From: hsivonen at iki.fi (Henri Sivonen) Date: Thu, 1 Apr 2010 12:29:34 +0300 Subject: [whatwg] Character encoding of document.open()ed documents In-Reply-To: <4BB39E60.9020009@mit.edu> References: <4BB34D1B.6000002@mit.edu> <4BB39E60.9020009@mit.edu> Message-ID: <9E732943-275F-4BFA-851F-5FFE3EF1ED06@iki.fi> On Mar 31, 2010, at 22:11, Boris Zbarsky wrote: > On 3/31/10 10:37 AM, Henri Sivonen wrote: >> Gecko sets the document's character encoding to UTF-8 and uses UTF-8 to decode the external resource. > > One more clarifying question.... Does Gecko use UTF-8, or the encoding of whatever document it was open() got called on? Gecko uses the encoding of the document that open() got called on. http://hsivonen.iki.fi/test/moz/document-open-initial-charset.htm >> WebKit uses the encoding of the opener. IE8 (both with compat view button pressed and not pressed) sets the document's character encoding to "unicode" and uses UTF-8 to decode the external resource. Opera uses Windows-1252 to decode the external resource. > > Similar question for IE. IE6 and IE8 set the encoding to "unicode" and use UTF-8 to decode the external resource even if the document that open() was called on had a different meta charset. It seems that WebKit uses the encoding of the document that open() was called on *and* about:blank in an iframe inherits the encoding of its parent, which is why I previously thought WebKit used the encoding of the opener. Furthermore, I was wrong when I thought Opera didn't support document.charset and document.characterSet. It does support them, but document.open()ed docs have the document's character encoding set to the empty string and the empty string means the user's fallback encoding (Windows-1252 by default) for the purpose of external resources. From the evidence so far, assuming that IE is axiomatically sufficiently Web compatible here, it seems to me that making document.open() set the encoding to UTF-8 and ignoring meta charset in document.open()ed documents could work. I can also see why retaining the encoding of the document that open() was called on could be preferable, but so far I'm not persuaded that meta charset in document.open()ed documents should have an effect. I verified that CSS and JS are treated the same way: http://hsivonen.iki.fi/test/moz/document-open-external-charset-style.htm http://hsivonen.iki.fi/test/moz/document-open-initial-charset-style.htm http://hsivonen.iki.fi/test/moz/document-open-internal-charset-style.htm On Apr 1, 2010, at 06:26, And Clover wrote: > No browser will actually try to submit a form as UTF-16 for this reason, but it still causes problems. eg. Firefox misleadingly sets the `_charset_` hack field to 'UTF-16' even though the submission is UTF-8-encoded. Is a bug on file? I didn't find a bug about this in Bugzilla. -- Henri Sivonen hsivonen at iki.fi http://hsivonen.iki.fi/ From hsivonen at iki.fi Thu Apr 1 06:29:36 2010 From: hsivonen at iki.fi (Henri Sivonen) Date: Thu, 1 Apr 2010 16:29:36 +0300 Subject: [whatwg] Character encoding of document.open()ed documents In-Reply-To: <4BB34D1B.6000002@mit.edu> References: <4BB34D1B.6000002@mit.edu> Message-ID: <3F83D10B-DEE2-4A8B-BCBF-8CA457EE0C7B@iki.fi> On Mar 31, 2010, at 16:24, Boris Zbarsky wrote: > I distinctly recall Gecko having compat bugs of various sorts here for the external resource case at one point (as in, people reporting intranet apps and the like that worked in IE but not Gecko), and us trying pretty hard to fix them. Could this have been only about trying to decode the external resources as UTF-16 vs. trying to decode them using any ASCII superset encoding? By looking at CVS blame a second time, I found only https://bugzilla.mozilla.org/show_bug.cgi?id=255820 where the key thing seems to be avoiding UTF-16 and not so much letting the meta have an effect and https://bugzilla.mozilla.org/show_bug.cgi?id=35340 where the compat target seems to have been Netscape 4. -- Henri Sivonen hsivonen at iki.fi http://hsivonen.iki.fi/ From simonp at opera.com Thu Apr 1 09:04:22 2010 From: simonp at opera.com (Simon Pieters) Date: Thu, 01 Apr 2010 17:04:22 +0100 Subject: [whatwg] Web Workers feedback In-Reply-To: References: <9cef076f1003151713k5436e613m6bc4adec414915e2@mail.gmail.com> <9cef076f1003151807r7c2b448ata983f1ec125568e6@mail.gmail.com> <63df84f1003292306p72656873x27385900fd755226@mail.gmail.com> <63df84f1003300054x49230747vf2ebb3d90ee4dca8@mail.gmail.com> <4BB1BC6E.70807@gmail.com> Message-ID: On Tue, 30 Mar 2010 23:09:49 +0100, Ian Hickson wrote: >> Personally my guess it's more likely that they really wanted to. > > I have no idea which is more likely. The only use case I'm aware of is > passing an in, and for that there isn't really a fallback position, > so it doesn't matter if we send null or throw an exception. It does matter because if you send null, the worker has to respond that it got null so the script can do what it wants on the main thread, which makes the operation async and means the worker script needs logic for the non-supported case. It's more convenient to catch an exception and do what you want directly, and have the worker script only care about the supported case. This is actually the exact same problem as what we have now, moving from string based to structured clone. In order to test structured clone support, you have to send a message back and forth. I think it would have been better if non-strings threw an exception from the start, but it's too late to change it now. A use case I had with structured clone is posting three ImageData objects where the worker compares the pixels of two of them and puts the difference on the third and posts that one back. I do it in a worker because it's a heavy operation for big images and I needed to keep the timing correct for events in the main thread. If workers isn't supported, I did the operation later when the timing of events didn't matter. I didn't make it detect support for workers but lack of structured clone because it seemed too annoying to implement. -- Simon Pieters Opera Software From jonas at sicking.cc Thu Apr 1 15:31:03 2010 From: jonas at sicking.cc (Jonas Sicking) Date: Thu, 1 Apr 2010 15:31:03 -0700 Subject: [whatwg] Workers: What can be done in a worker after call to close()? In-Reply-To: References: Message-ID: On Wed, Mar 31, 2010 at 10:03 AM, ben turner wrote: > Hi, > > When implementing the close() function for Firefox we chose to set the > closing flag and clear pending events only. As the worker script is > calling close() on itself we figured that the worker should retain > maximum functionality until it has finished execution (otherwise it > could just not call close() and rely on some kind of postMessage() and > terminate() combo). Therefore we do not enforce any timeout for the > currently executing script and we continue to allow postMessage() > calls and synchronous XHR to proceed. Since the closing flag is set in > response to close() the worker is guaranteed to finish as soon as the > currently running script finishes. We always enforce a timeout for any > code that runs in response to the close event that gets fired after > the current script finishes, though. > > If the code that calls close() never returns (like the while(1) { } > example above) then the worker will never finish, as pointed out > above, but that's no different than having a worker script that > consists only of a while(1) { } loop and we don't think it's important > to prevent. If a worker script is written in this way then a > terminate() call is still a valid solution. > > Also, since we try to retain maximum functionality after close() we > also allow errors to propagate as shown above. > > If anyone is curious the basic strategy we use in response to close > functions (like close(), terminate(), and for UA-generated events like > when the main worker object is GC'd) can be found in the following > table: > > http://mxr.mozilla.org/mozilla-central/source/dom/src/threads/nsDOMWorker.h#202 For what it's worth, I think the behavior that firefox has makes a lot of sense and I think it should be mandated by the spec. (I know, big shocker :) ) The one thing that we do and that is somewhat iffy is the close event. Ben actually gets it a bit wrong in the description above. This is how it works: We fire the close event handler in four situations: * After close() is called by the worker, once it finishes its current execution. * After terminate() is called from outside the worker and any code running has been aborted. * If the worker is garbage collected. * Once the user leaves the page (or specifically, once the page falls out of the bfcache). Only in the last case do we give the close handler a time limit, after which any currently running close handler is aborted and no more close handlers are run. Though of course the user can leave the page *while* the close event is getting fired. If so, we start the time limit at that point. The iffy part is the third bullet above, since it exposes GC behavior. This is very unfortunate indeed and because of it I feel that our implementation is somewhat experimental. We could simply not fire the close event in that case, however this would seem to reduce the usefulness of the close event quite a bit. So I think for now I don't care if the close event is put in the spec or not. But I wanted to let you know what we're doing. We don't currently have any plans to remove it. / Jonas From johnnyg at google.com Thu Apr 1 15:53:08 2010 From: johnnyg at google.com (John Gregg) Date: Thu, 1 Apr 2010 15:53:08 -0700 Subject: [whatwg] Directory upload via Message-ID: For context, Ian Fette started a thread about uploading directories of files in December: http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-December/024455.html At that time, it was thought that directory upload could be implemented by a UA in response to a tag using different UI only, and modifying the FileAPI spec to allow path information in the form input.files[0].name="1.jpg" input.files[0].path="a" input.files[1].name="2.jpg" input.files[1].path="a/b" input.files[2].name="3.jpg" input.files[2].path="a/c" I've started developing a prototype of this in WebKit/Chromium. Based on what I've encountered so far, I would like to propose adding directory upload functionality using an explicit new 'directory' attribute on the file input element. The existing behavior of would not change, but when processing , the UA would display a directory selection UI and store the path information, and *not* allow individual files to be selected. It would allow multiple files to have the same leaf name (.name attribute), as long as the paths were different. The path attributes would include the name of the chosen directory This would be preferable for several reasons: - Most built-in file system UI on major platforms (Windows/Mac/Linux) have distinct dialogs for choosing files and choosing directories. Allowing the UA to use these directly makes sense rather than creating hybrids. - Avoiding "leaf name" conflicts in a directory tree is not feasible in many applications -- asking a user to ensure unique photo names in a large set of albums before uploading would fail to meet that use case. Therefore HTML documents should know in advance whether the path information will be relevant in the eventual storage of the files. Sites currently using would have compatibility problems with an implementation which allowed conflicting file names along different paths. What are your thoughts about adding the 'directory' attribute? Thanks, -John -------------- next part -------------- An HTML attachment was scrubbed... URL: From atwilson at google.com Thu Apr 1 16:40:47 2010 From: atwilson at google.com (Drew Wilson) Date: Thu, 1 Apr 2010 16:40:47 -0700 Subject: [whatwg] Workers: What can be done in a worker after call to close()? In-Reply-To: References: Message-ID: How does the GC-initiated close() event work in Firefox, in the case of a fire-and-forget worker? For example: foo.html: forget.js: self.setInterval(function() { ...do something...}, 1000); In this case, it seems incorrect to ever fire a close() event until the parent window leaves the bfcache. I'm guessing you must do something to prevent the worker object from being GC'd in the case that there's pending activity in the worker? -atw On Thu, Apr 1, 2010 at 3:31 PM, Jonas Sicking wrote: > On Wed, Mar 31, 2010 at 10:03 AM, ben turner > wrote: > > Hi, > > > > When implementing the close() function for Firefox we chose to set the > > closing flag and clear pending events only. As the worker script is > > calling close() on itself we figured that the worker should retain > > maximum functionality until it has finished execution (otherwise it > > could just not call close() and rely on some kind of postMessage() and > > terminate() combo). Therefore we do not enforce any timeout for the > > currently executing script and we continue to allow postMessage() > > calls and synchronous XHR to proceed. Since the closing flag is set in > > response to close() the worker is guaranteed to finish as soon as the > > currently running script finishes. We always enforce a timeout for any > > code that runs in response to the close event that gets fired after > > the current script finishes, though. > > > > If the code that calls close() never returns (like the while(1) { } > > example above) then the worker will never finish, as pointed out > > above, but that's no different than having a worker script that > > consists only of a while(1) { } loop and we don't think it's important > > to prevent. If a worker script is written in this way then a > > terminate() call is still a valid solution. > > > > Also, since we try to retain maximum functionality after close() we > > also allow errors to propagate as shown above. > > > > If anyone is curious the basic strategy we use in response to close > > functions (like close(), terminate(), and for UA-generated events like > > when the main worker object is GC'd) can be found in the following > > table: > > > > > http://mxr.mozilla.org/mozilla-central/source/dom/src/threads/nsDOMWorker.h#202 > > For what it's worth, I think the behavior that firefox has makes a lot > of sense and I think it should be mandated by the spec. (I know, big > shocker :) ) > > The one thing that we do and that is somewhat iffy is the close event. > Ben actually gets it a bit wrong in the description above. This is how > it works: > > We fire the close event handler in four situations: > > * After close() is called by the worker, once it finishes its current > execution. > * After terminate() is called from outside the worker and any code > running has been aborted. > * If the worker is garbage collected. > * Once the user leaves the page (or specifically, once the page falls > out of the bfcache). > > Only in the last case do we give the close handler a time limit, after > which any currently running close handler is aborted and no more close > handlers are run. > > Though of course the user can leave the page *while* the close event > is getting fired. If so, we start the time limit at that point. > > The iffy part is the third bullet above, since it exposes GC behavior. > This is very unfortunate indeed and because of it I feel that our > implementation is somewhat experimental. > > We could simply not fire the close event in that case, however this > would seem to reduce the usefulness of the close event quite a bit. > > So I think for now I don't care if the close event is put in the spec > or not. But I wanted to let you know what we're doing. We don't > currently have any plans to remove it. > > / Jonas > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonas at sicking.cc Thu Apr 1 16:49:51 2010 From: jonas at sicking.cc (Jonas Sicking) Date: Thu, 1 Apr 2010 16:49:51 -0700 Subject: [whatwg] Workers: What can be done in a worker after call to close()? In-Reply-To: References: Message-ID: On Thu, Apr 1, 2010 at 4:40 PM, Drew Wilson wrote: > How does the GC-initiated close() event work in Firefox, in the case of a > fire-and-forget worker? > For example: > foo.html: > > forget.js: > self.setInterval(function() { ...do something...}, 1000); > In this case, it seems incorrect to ever fire a close() event until the > parent window leaves the bfcache.?I'm guessing you must do something to > prevent the worker object from being GC'd in the case that there's pending > activity in the worker? Indeed, such a worker would never be GC'd. Similarly a worker that simply contains a infinite while(1) {} loop, or a worker that continuously starts XHR requests at the end of the previous XHR requests. This isn't really related to the 'close' event though, but rather worker lifetime. The 'close' event would still fire at some point. Either if someone calls terminate() from the outside, or once the user navigates away from the page that started the worker. / Jonas From dimich at google.com Thu Apr 1 16:57:06 2010 From: dimich at google.com (Dmitry Titov) Date: Thu, 1 Apr 2010 16:57:06 -0700 Subject: [whatwg] Workers: What can be done in a worker after call to close()? In-Reply-To: References: Message-ID: Thanks Jonas! So there is somewhat of a consensus on close() to effectively let a worker run normally until the exit from the current JS fragment. It makes sense for us as well. I think the only change to the spec here would be the removal of the 3rd line in the description of what close() does, so the ports are still functional, at least for posting from the worker: When a script invokes the close() method on a WorkerGlobalScope object, the > user agent must run the following steps (atomically): > Discard any tasks that have been added to the event loop's task queues. Set the worker's WorkerGlobalScope object's closing flag to true. (This > prevents any further tasks from being queued.) Disentangle all the ports in the list of the worker's ports. .. which probably is not a big deal (hope Ian will chime in on this). Not sure about onclose indeed... Perhaps we can use some time to see if developers will request something like this more explicitly, then we could think about it more. Dmitry On Thu, Apr 1, 2010 at 3:31 PM, Jonas Sicking wrote: > On Wed, Mar 31, 2010 at 10:03 AM, ben turner > wrote: > > Hi, > > > > When implementing the close() function for Firefox we chose to set the > > closing flag and clear pending events only. As the worker script is > > calling close() on itself we figured that the worker should retain > > maximum functionality until it has finished execution (otherwise it > > could just not call close() and rely on some kind of postMessage() and > > terminate() combo). Therefore we do not enforce any timeout for the > > currently executing script and we continue to allow postMessage() > > calls and synchronous XHR to proceed. Since the closing flag is set in > > response to close() the worker is guaranteed to finish as soon as the > > currently running script finishes. We always enforce a timeout for any > > code that runs in response to the close event that gets fired after > > the current script finishes, though. > > > > If the code that calls close() never returns (like the while(1) { } > > example above) then the worker will never finish, as pointed out > > above, but that's no different than having a worker script that > > consists only of a while(1) { } loop and we don't think it's important > > to prevent. If a worker script is written in this way then a > > terminate() call is still a valid solution. > > > > Also, since we try to retain maximum functionality after close() we > > also allow errors to propagate as shown above. > > > > If anyone is curious the basic strategy we use in response to close > > functions (like close(), terminate(), and for UA-generated events like > > when the main worker object is GC'd) can be found in the following > > table: > > > > > http://mxr.mozilla.org/mozilla-central/source/dom/src/threads/nsDOMWorker.h#202 > > For what it's worth, I think the behavior that firefox has makes a lot > of sense and I think it should be mandated by the spec. (I know, big > shocker :) ) > > The one thing that we do and that is somewhat iffy is the close event. > Ben actually gets it a bit wrong in the description above. This is how > it works: > > We fire the close event handler in four situations: > > * After close() is called by the worker, once it finishes its current > execution. > * After terminate() is called from outside the worker and any code > running has been aborted. > * If the worker is garbage collected. > * Once the user leaves the page (or specifically, once the page falls > out of the bfcache). > > Only in the last case do we give the close handler a time limit, after > which any currently running close handler is aborted and no more close > handlers are run. > > Though of course the user can leave the page *while* the close event > is getting fired. If so, we start the time limit at that point. > > The iffy part is the third bullet above, since it exposes GC behavior. > This is very unfortunate indeed and because of it I feel that our > implementation is somewhat experimental. > > We could simply not fire the close event in that case, however this > would seem to reduce the usefulness of the close event quite a bit. > > So I think for now I don't care if the close event is put in the spec > or not. But I wanted to let you know what we're doing. We don't > currently have any plans to remove it. > > / Jonas > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ian at hixie.ch Thu Apr 1 17:42:02 2010 From: ian at hixie.ch (Ian Hickson) Date: Fri, 2 Apr 2010 00:42:02 +0000 (UTC) Subject: [whatwg] Workers: What can be done in a worker after call to close()? In-Reply-To: References: Message-ID: On Thu, 1 Apr 2010, Dmitry Titov wrote: > > I think the only change to the spec here would be the removal of the 3rd > line in the description of what close() does, so the ports are still > functional, at least for posting from the worker: [...] I'm fine with doing this. > Not sure about onclose indeed... Perhaps we can use some time to see if > developers will request something like this more explicitly, then we > could think about it more. There's no onclose in the spec currently. It was removed to avoid exposing GC behaviour. -- Ian Hickson U+1047E )\._.,--....,'``. fL http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.' From bzbarsky at MIT.EDU Thu Apr 1 20:11:50 2010 From: bzbarsky at MIT.EDU (Boris Zbarsky) Date: Thu, 01 Apr 2010 23:11:50 -0400 Subject: [whatwg] Character encoding of document.open()ed documents In-Reply-To: <3F83D10B-DEE2-4A8B-BCBF-8CA457EE0C7B@iki.fi> References: <4BB34D1B.6000002@mit.edu> <3F83D10B-DEE2-4A8B-BCBF-8CA457EE0C7B@iki.fi> Message-ID: <4BB56076.6090905@mit.edu> On 4/1/10 9:29 AM, Henri Sivonen wrote: > On Mar 31, 2010, at 16:24, Boris Zbarsky wrote: > >> I distinctly recall Gecko having compat bugs of various sorts here >> for the external resource case at one point (as in, people >> reporting intranet apps and the like that worked in IE but not >> Gecko), and us trying pretty hard to fix them. > > Could this have been only about trying to decode the external > resources as UTF-16 vs. trying to decode them using any ASCII > superset encoding? It's possible. It's been a while since I last looked at this code... > By looking at CVS blame a second time, I found only > https://bugzilla.mozilla.org/show_bug.cgi?id=255820 where the key > thing seems to be avoiding UTF-16 and not so much letting the meta > have an effect That's the bug I was largely thinking of, yes. So maybe we're ok with UTF-8. -Boris From bzbarsky at MIT.EDU Thu Apr 1 20:12:40 2010 From: bzbarsky at MIT.EDU (Boris Zbarsky) Date: Thu, 01 Apr 2010 23:12:40 -0400 Subject: [whatwg] Character encoding of document.open()ed documents In-Reply-To: <9E732943-275F-4BFA-851F-5FFE3EF1ED06@iki.fi> References: <4BB34D1B.6000002@mit.edu> <4BB39E60.9020009@mit.edu> <9E732943-275F-4BFA-851F-5FFE3EF1ED06@iki.fi> Message-ID: <4BB560A8.3010302@mit.edu> On 4/1/10 5:29 AM, Henri Sivonen wrote: > but so far I'm not persuaded that meta charset > in document.open()ed documents should have an effect. Agreed on that. -Boris From bzbarsky at MIT.EDU Thu Apr 1 20:15:09 2010 From: bzbarsky at MIT.EDU (Boris Zbarsky) Date: Thu, 01 Apr 2010 23:15:09 -0400 Subject: [whatwg] WebSocket bufferedAmount includes overhead or not In-Reply-To: References: <4BA88C13.4010908@helsinki.fi> <63df84f1003292319m6dc167boe77cb30d1d1a9fa9@mail.gmail.com> <63df84f1003300722t3aa2b4c4r5f6f7cb8a1541d60@mail.gmail.com> <4BB2D5F1.3060106@mit.edu> <4BB3C9D8.8010100@mit.edu> Message-ID: <4BB5613D.2060603@mit.edu> On 3/31/10 6:57 PM, Jonas Sicking wrote: > I would expect that send() is allowed to start streaming data over the > network as soon as it can, but only update bufferedAmount from the > event loop. Maybe I'm not being clear. Let's say bufferedAmount were to reflect the number of UTF-8-encoded bytes to be sent, for the sake of argument. I wait until bufferedAmount is 0, then call send("My text"). What are possible values of bufferedAmount if I examine it right after the send() call? Is 0 a valid possible value? What about 1? 2? 3? 4? 5? 6? 7? Presumably the value will be somewhere in the integer range [0,7], right? Or will it always be 7 after that call in that situation? -Boris From morrita at google.com Thu Apr 1 22:09:23 2010 From: morrita at google.com (Hajime Morita) Date: Fri, 2 Apr 2010 14:09:23 +0900 Subject: [whatwg] Selection API compatibility on exceptions Message-ID: Hi, I'm working on WebKit and I found that there are an inconsistency between spec and implementations around Selection API. Some Selection APIs including collapse(), selectAllChildren() take DOM nodes as arguments. And the spec says Selection should throw WRONG_DOCUMENT_ERROR if "if the given node is in a different document." But neither Firefox, Opera, and Webkit throws such exception. They accept foreign nodes (Firefox), or just gnore them (WebKit). (I couldn't figure out how Opera behaves. It allows API to be called, but nothing seems happen even with valid nodes.) You can walk Selection behaviour with http://www.dodgson.org/t/selections.html Although it is ideal to throwing exceptions, it may break existing applications which depend current generous behaviour. So it looks reasonable for me to change the spec to say not to throw exceptions for foreign nodes, and just ignore them instead. Any ideas? -- morita From dbaron at dbaron.org Thu Apr 1 23:36:16 2010 From: dbaron at dbaron.org (L. David Baron) Date: Thu, 1 Apr 2010 23:36:16 -0700 Subject: [whatwg] [html5] r4949 - [giow] (0) The CSS rules need to do attribute value matching consistently across [...] In-Reply-To: <20100402061049.7E49D1C84005@ps20323.dreamhostps.com> References: <20100402061049.7E49D1C84005@ps20323.dreamhostps.com> Message-ID: <20100402063616.GA10510@pickering.dbaron.org> On Thursday 2010-04-01 23:10 -0700, whatwg at whatwg.org wrote: > [giow] (0) The CSS rules need to do attribute value matching consistently across HTML and XHTML, despite the rules for interpreting author style sheets. > Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=9335 > +

For the purpose of the > + rules marked "case-sensitive", user agents are expected to use > + case-sensitive matching of attribute values rather than > + case-insensitive matching, regardless of whether a case-insensitive > + matching is normally required for the given attribute.

> + > +

Similarly, for the > + purpose of the rules marked "case-insensitive", user agents are > + expected to use ASCII case-insensitive matching of > + attribute values rather than case-sensitive matching, even for > + attributes in XHTML documents.

> + > +

These markings only affect the handling of attribute > + values, not attribute names or element names.

Making attribute values case-insensitive in XHTML seems incompatible with longstanding Gecko behavior (though our handling of input's type attribute is buggy, at least) and with the clear intent of XHTML1, and doesn't seem implementable on top of a conformant CSS selectors implementation. Do we really want to do this? -David -- L. David Baron http://dbaron.org/ Mozilla Corporation http://www.mozilla.com/ From narendra.sisodiya at gmail.com Fri Apr 2 00:07:25 2010 From: narendra.sisodiya at gmail.com (narendra sisodiya) Date: Fri, 2 Apr 2010 12:37:25 +0530 Subject: [whatwg] idea for .zhtml format #html5 #web Message-ID: ____ just a thought ___ You can view the first webpage create on earth. We have saved our file from .txt .rtf .doc and now .odt. I love ODF format (.odt and other things) but there is a scope for .zhtml format for document and other purpose. Basically the idea of zhtml format is to create document/webpage using HTML5 technology. HTML5 technology with client side can create dynamic webpage with image video and we can actually use JavaScript to create a dynamic document. So basically we can create a zip out of all the html,js,css,images files and put a extension of .zhtml. There are many advantage of using zhtml format. * You can create some good web based software and share it using just one file. * Any document create using zhtml will be viewable after 100 years too. * Server must support .zhtml format so that website can autounzip and provide underlying files Ex http://localhost/myfile.zhtml/test.html Disadvantage * There is no standard over web to make a slideshow Or presentation . There are 100 possible ways. So zhtml writers will make their own conventions but I believe that this will reach into a equilibrium * do not know !! but there there will be someone. -- ??????????????????????????? ? Narendra Sisodiya ( ???????? ???????? ) ? Society for Knowledge Commons ? Web : http://narendra.techfandu.org ??????????????????????????? -------------- next part -------------- An HTML attachment was scrubbed... URL: From shwetankd at opera.com Fri Apr 2 00:17:09 2010 From: shwetankd at opera.com (Shwetank Dixit) Date: Fri, 02 Apr 2010 12:47:09 +0530 Subject: [whatwg] idea for .zhtml format #html5 #web In-Reply-To: References: Message-ID: Hi Narendra, I think what you're proposing could be achieved already (at least somewhat) by the html5 offline applications part http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html#offline On Fri, 02 Apr 2010 12:37:25 +0530, narendra sisodiya wrote: > ____ just a thought ___ > > You can view the first webpage create on earth. We have saved our file > from > .txt .rtf .doc and now .odt. I love ODF format (.odt and other things) > but > there is a scope for .zhtml format for document and other purpose. > Basically the idea of zhtml format is to create document/webpage using > HTML5 > technology. HTML5 technology with client side can create dynamic webpage > with image video and we can actually use JavaScript to create a dynamic > document. So basically we can create a zip out of all the > html,js,css,images > files and put a extension of .zhtml. > > There are many advantage of using zhtml format. > > * You can create some good web based software and share it using just one > file. > * Any document create using zhtml will be viewable after 100 years too. > * Server must support .zhtml format so that website can autounzip and > provide underlying files Ex http://localhost/myfile.zhtml/test.html > > Disadvantage > > * There is no standard over web to make a slideshow Or presentation . > There > are 100 possible ways. So zhtml writers will make their own conventions > but > I believe that this will reach into a equilibrium > * do not know !! but there there will be someone. > > -- Shwetank Dixit Web Evangelist, Site Compatibility / Developer Relations / Consumer Products Group Member - Web Standards Project (WaSP) - International Liaison Group Opera Software - www.opera.com Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ From narendra.sisodiya at gmail.com Fri Apr 2 00:30:19 2010 From: narendra.sisodiya at gmail.com (narendra sisodiya) Date: Fri, 2 Apr 2010 13:00:19 +0530 Subject: [whatwg] idea for .zhtml format #html5 #web In-Reply-To: References: Message-ID: On Fri, Apr 2, 2010 at 12:47 PM, Shwetank Dixit wrote: > Hi Narendra, > > I think what you're proposing could be achieved already (at least somewhat) > by the html5 offline applications part > http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html#offline > > Thanks for hinting , infact I was looking for it. The idea behind this is, my govt is wasting money of making e-learning content they are mainly .exe and swf file http://techfandu.blogspot.com/2010/03/e-learning-modules-tutorials-guidelines.htmlSo Basically I suggested them to use HTML5 also, I told them that content will be able to able to view on mobile (which support html5). Support for ODF is browser is still waiting and take time. http://techfandu.blogspot.com/2010/03/e-learning-modules-tutorials-guidelines.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipj at opera.com Fri Apr 2 01:36:18 2010 From: philipj at opera.com (=?iso-8859-15?Q?Philip_J=E4genstedt?=) Date: Fri, 02 Apr 2010 16:36:18 +0800 Subject: [whatwg] idea for .zhtml format #html5 #web In-Reply-To: References: Message-ID: On Fri, 02 Apr 2010 15:07:25 +0800, narendra sisodiya wrote: > ____ just a thought ___ > > You can view the first webpage create on earth. We have saved our file > from > .txt .rtf .doc and now .odt. I love ODF format (.odt and other things) > but > there is a scope for .zhtml format for document and other purpose. > Basically the idea of zhtml format is to create document/webpage using > HTML5 > technology. HTML5 technology with client side can create dynamic webpage > with image video and we can actually use JavaScript to create a dynamic > document. So basically we can create a zip out of all the > html,js,css,images > files and put a extension of .zhtml. > > There are many advantage of using zhtml format. > > * You can create some good web based software and share it using just one > file. > * Any document create using zhtml will be viewable after 100 years too. > * Server must support .zhtml format so that website can autounzip and > provide underlying files Ex http://localhost/myfile.zhtml/test.html > > Disadvantage > > * There is no standard over web to make a slideshow Or presentation . > There > are 100 possible ways. So zhtml writers will make their own conventions > but > I believe that this will reach into a equilibrium > * do not know !! but there there will be someone. Sounds like widgets: http://www.w3.org/TR/widgets/ -- Philip J?genstedt Core Developer Opera Software From brucel at opera.com Fri Apr 2 02:57:04 2010 From: brucel at opera.com (Bruce Lawson) Date: Fri, 02 Apr 2010 09:57:04 -0000 Subject: [whatwg] Why are form fields without a name barred from constraint validation? Message-ID: "Constraint validation: If an element does not have a name attribute specified, or its name attribute's value is the empty string, then it is barred from constraint validation." http://dev.w3.org/html5/spec/forms.html#naming-form-controls As a matter of interest, why? -- Hang loose and stay groovy, Bruce Lawson Web Evangelist www.opera.com (work) www.brucelawson.co.uk (personal) www.twitter.com/brucel From info at html5.jp Fri Apr 2 02:28:50 2010 From: info at html5.jp (Futomi Hatano) Date: Fri, 02 Apr 2010 18:28:50 +0900 Subject: [whatwg] Why are form fields without a name barred from constraint validation? In-Reply-To: References: Message-ID: <20100402182849.A1E2.C8DE7135@html5.jp> Hi Bruce, On Fri, 02 Apr 2010 09:57:04 -0000 "Bruce Lawson" wrote: > "Constraint validation: If an element does not have a name attribute > specified, or its name attribute's value is the empty string, then it is > barred from constraint validation." > > http://dev.w3.org/html5/spec/forms.html#naming-form-controls > > > As a matter of interest, why? Because such controls are ignored when the form is submitted. http://dev.w3.org/html5/spec/forms.html#form-submission-algorithm Nameless controls are meaningless in form submission. So, those controls do not need to be validated, I think. -- Futomi Hatano http://www.html5.jp/ http://www.futomi.com/ http://twitter.com/futomi From brucel at opera.com Fri Apr 2 04:00:04 2010 From: brucel at opera.com (Bruce Lawson) Date: Fri, 02 Apr 2010 11:00:04 -0000 Subject: [whatwg] Why are form fields without a name barred from constraint validation? In-Reply-To: <20100402182849.A1E2.C8DE7135@html5.jp> References: <20100402182849.A1E2.C8DE7135@html5.jp> Message-ID: On Fri, 02 Apr 2010 09:28:50 -0000, Futomi Hatano wrote: > > Because such controls are ignored when the form is submitted. > http://dev.w3.org/html5/spec/forms.html#form-submission-algorithm > Nameless controls are meaningless in form submission. > So, those controls do not need to be validated, I think. Thanks! b From annevk at opera.com Fri Apr 2 12:53:53 2010 From: annevk at opera.com (Anne van Kesteren) Date: Fri, 02 Apr 2010 12:53:53 -0700 Subject: [whatwg] Why are form fields without a name barred from constraint validation? In-Reply-To: References: <20100402182849.A1E2.C8DE7135@html5.jp> Message-ID: On Fri, 02 Apr 2010 04:00:04 -0700, Bruce Lawson wrote: > On Fri, 02 Apr 2010 09:28:50 -0000, Futomi Hatano wrote: >> Because such controls are ignored when the form is submitted. >> http://dev.w3.org/html5/spec/forms.html#form-submission-algorithm >> Nameless controls are meaningless in form submission. >> So, those controls do not need to be validated, I think. > > Thanks! FWIW, there have been some requests on dropping this since nowadays form controls are not always associated with a form, but the validity concept can still be useful in such scenarios. -- Anne van Kesteren http://annevankesteren.nl/ From annevk at opera.com Fri Apr 2 12:58:29 2010 From: annevk at opera.com (Anne van Kesteren) Date: Fri, 02 Apr 2010 12:58:29 -0700 Subject: [whatwg] [html5] r4949 - [giow] (0) The CSS rules need to do attribute value matching consistently across [...] In-Reply-To: <20100402063616.GA10510@pickering.dbaron.org> References: <20100402061049.7E49D1C84005@ps20323.dreamhostps.com> <20100402063616.GA10510@pickering.dbaron.org> Message-ID: On Thu, 01 Apr 2010 23:36:16 -0700, L. David Baron wrote: > Making attribute values case-insensitive in XHTML seems incompatible > with longstanding Gecko behavior (though our handling of input's > type attribute is buggy, at least) and with the clear intent of > XHTML1, and doesn't seem implementable on top of a conformant CSS > selectors implementation. > > Do we really want to do this? I think we do want case-insensitive attribute values to be case-insensitive in both HTML and XHTML. I think ideally we remove the special casing of certain attributes with Selectors and introduce an ASCII case-insensitive flag for attribute value selectors to deal with this issue. -- Anne van Kesteren http://annevankesteren.nl/ From ash at ashleysheridan.co.uk Fri Apr 2 04:43:05 2010 From: ash at ashleysheridan.co.uk (Ashley Sheridan) Date: Fri, 02 Apr 2010 12:43:05 +0100 Subject: [whatwg] idea for .zhtml format #html5 #web In-Reply-To: References: Message-ID: <1270208585.28845.82.camel@localhost> On Fri, 2010-04-02 at 12:37 +0530, narendra sisodiya wrote: > ____ just a thought ___ > > You can view the first webpage create on earth. We have saved our file > from .txt .rtf .doc and now .odt. I love ODF format (.odt and other > things) but there is a scope for .zhtml format for document and other > purpose. > Basically the idea of zhtml format is to create document/webpage using > HTML5 technology. HTML5 technology with client side can create dynamic > webpage with image video and we can actually use JavaScript to create > a dynamic document. So basically we can create a zip out of all the > html,js,css,images files and put a extension of .zhtml. > > There are many advantage of using zhtml format. > > * You can create some good web based software and share it using just > one file. > * Any document create using zhtml will be viewable after 100 years > too. > * Server must support .zhtml format so that website can autounzip and > provide underlying files Ex http://localhost/myfile.zhtml/test.html > > Disadvantage > > * There is no standard over web to make a slideshow Or presentation . > There are 100 possible ways. So zhtml writers will make their own > conventions but I believe that this will reach into a equilibrium > * do not know !! but there there will be someone. > > > -- > ??????????????????????????? > ? Narendra Sisodiya ( ???????? ???????? ) > ? Society for Knowledge Commons > ? Web : http://narendra.techfandu.org > ??????????????????????????? Didn't Microsoft already try this with its .mhtml format? Thanks, Ash http://www.ashleysheridan.co.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From tkent at chromium.org Fri Apr 2 08:31:32 2010 From: tkent at chromium.org (TAMURA, Kent) Date: Sat, 3 Apr 2010 00:31:32 +0900 Subject: [whatwg] Input color state: type mismatch In-Reply-To: <4BB10830.4070500@gmail.com> References: <4BAE0CAD.4020802@gmail.com> <7c2a12e21003291249j44bf9717q5a38f20434e1345d@mail.gmail.com> <4BB10830.4070500@gmail.com> Message-ID: I found type=number also had no typeMismatch. If a user wants to type a negative value, he types '-' first. This state should make typeMismatch true because '-' is not a valid floating point number. -- TAMURA Kent Software Engineer, Google -------------- next part -------------- An HTML attachment was scrubbed... URL: From doug at schepers.cc Fri Apr 2 09:25:59 2010 From: doug at schepers.cc (Doug Schepers) Date: Fri, 02 Apr 2010 12:25:59 -0400 Subject: [whatwg] idea for .zhtml format #html5 #web In-Reply-To: References: Message-ID: <4BB61A97.5080709@schepers.cc> Hi, folks- Philip J?genstedt wrote (on 4/2/10 4:36 AM): > On Fri, 02 Apr 2010 15:07:25 +0800, narendra sisodiya > wrote: > >> ____ just a thought ___ >> >> You can view the first webpage create on earth. We have saved our file >> from >> .txt .rtf .doc and now .odt. I love ODF format (.odt and other things) >> but >> there is a scope for .zhtml format for document and other purpose. >> Basically the idea of zhtml format is to create document/webpage using >> HTML5 >> technology. HTML5 technology with client side can create dynamic webpage >> with image video and we can actually use JavaScript to create a dynamic >> document. So basically we can create a zip out of all the >> html,js,css,images >> files and put a extension of .zhtml. >> >> There are many advantage of using zhtml format. >> >> * You can create some good web based software and share it using just one >> file. >> * Any document create using zhtml will be viewable after 100 years too. >> * Server must support .zhtml format so that website can autounzip and >> provide underlying files Ex http://localhost/myfile.zhtml/test.html >> >> Disadvantage >> >> * There is no standard over web to make a slideshow Or presentation . >> There >> are 100 possible ways. So zhtml writers will make their own >> conventions but >> I believe that this will reach into a equilibrium >> * do not know !! but there there will be someone. > > Sounds like widgets: http://www.w3.org/TR/widgets/ Yes, this is exactly the motivation behind W3C Widgets (or HTML5 Widgets, if you prefer more buzzwords). You can gzip up a set of related content, and run it locally with special permissions. You can digitally sign it, to ensure the integrity and provenance of the content. You can even run them on the server referenced from an element in an HTML page. They might be suitable as a Firefox-like "extensions" mechanism. I don't think it's defined anywhere, but a browser could choose to save bundled resources as a self-contained Widget ("File > Save as Widget..."), which would be a great authoring solution for Widgets. Regards- -Doug From gkbrown at mac.com Fri Apr 2 09:59:09 2010 From: gkbrown at mac.com (Greg Brown) Date: Fri, 02 Apr 2010 12:59:09 -0400 Subject: [whatwg] Font metrics Message-ID: <365E0DE8-F722-4F01-A024-BC4C71E603F3@mac.com> Hi all, In reviewing the current draft API for the element (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html), I noticed that there is no support for obtaining font metrics such as ascent, descent, leading, and bounding box. It seems like the most recent discussion regarding font metrics took place a couple of years ago: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2008-May/014706.html But even that thread refers to discussions from 2006. I would personally like to see support for these values added to the API. Is this something that could be considered for the final spec? What are the major obstacles to providing such support? I would think that this information could be easily obtained using the underlying graphics API, but maybe I am missing something. Thanks, Greg From jonas at sicking.cc Fri Apr 2 10:43:57 2010 From: jonas at sicking.cc (Jonas Sicking) Date: Fri, 2 Apr 2010 10:43:57 -0700 Subject: [whatwg] WebSocket bufferedAmount includes overhead or not In-Reply-To: <4BB5613D.2060603@mit.edu> References: <63df84f1003292319m6dc167boe77cb30d1d1a9fa9@mail.gmail.com> <63df84f1003300722t3aa2b4c4r5f6f7cb8a1541d60@mail.gmail.com> <4BB2D5F1.3060106@mit.edu> <4BB3C9D8.8010100@mit.edu> <4BB5613D.2060603@mit.edu> Message-ID: On Thu, Apr 1, 2010 at 8:15 PM, Boris Zbarsky wrote: > On 3/31/10 6:57 PM, Jonas Sicking wrote: >> >> I would expect that send() is allowed to start streaming data over the >> network as soon as it can, but only update bufferedAmount from the >> event loop. > > Maybe I'm not being clear. ?Let's say bufferedAmount were to reflect the > number of UTF-8-encoded bytes to be sent, for the sake of argument. > > I wait until bufferedAmount is 0, then call send("My text"). > > What are possible values of bufferedAmount if I examine it right after the > send() call? ?Is 0 a valid possible value? ?What about 1? ?2? 3? 4? 5? 6? 7? > > Presumably the value will be somewhere in the integer range [0,7], right? > ?Or will it always be 7 after that call in that situation? In order to archive maximum interoperability and predictability I think it should always be 7. So bufferedAmount is always adjusted synchronously upwards by the length of the sent message by send(), and always adjusted downwards from events posted to the main event loop. Though it's possible that this is overengineering given how people are likely to use bufferedAmount. Interested to hear opinions. / Jonas From jonas at sicking.cc Fri Apr 2 10:46:17 2010 From: jonas at sicking.cc (Jonas Sicking) Date: Fri, 2 Apr 2010 10:46:17 -0700 Subject: [whatwg] Why are form fields without a name barred from constraint validation? In-Reply-To: References: <20100402182849.A1E2.C8DE7135@html5.jp> Message-ID: On Fri, Apr 2, 2010 at 12:53 PM, Anne van Kesteren wrote: > On Fri, 02 Apr 2010 04:00:04 -0700, Bruce Lawson wrote: >> >> On Fri, 02 Apr 2010 09:28:50 -0000, Futomi Hatano wrote: >>> >>> Because such controls are ignored when the form is submitted. >>> http://dev.w3.org/html5/spec/forms.html#form-submission-algorithm >>> Nameless controls are meaningless in form submission. >>> So, those controls do not need to be validated, I think. >> >> Thanks! > > FWIW, there have been some requests on dropping this since nowadays form > controls are not always associated with a form, but the validity concept can > still be useful in such scenarios. Yeah. I think in the interest of 'least surprise', I think such controls should be validated too. If someone added validation constraints to such a control, I would think it's more likely than not that they wanted to control validated. / Jonas From herenvardo at gmail.com Fri Apr 2 11:39:21 2010 From: herenvardo at gmail.com (Eduard Pascual) Date: Fri, 2 Apr 2010 20:39:21 +0200 Subject: [whatwg] idea for .zhtml format #html5 #web In-Reply-To: <4BB61A97.5080709@schepers.cc> References: <4BB61A97.5080709@schepers.cc> Message-ID: On Fri, Apr 2, 2010 at 6:25 PM, Doug Schepers wrote: > I don't think it's defined anywhere, but a browser could choose to save > bundled resources as a self-contained Widget ("File > Save as Widget..."), > which would be a great authoring solution for Widgets. Isn't that the same thing, in essence, as MS did with IE? IIRC, IE had an choice, on its save dialog, to "Save full page", which packed the html page + all the CSS, JS, image, and other dependencies within a ".mht" (called meta-HTML) file (which, of course, only IE would be able to open afterwards). The fact is that this feature has been removed from the more recent versions of IE (not sure if it was from IE6 or 7). It would be interesting to know why MS decided why such a feature should be removed. At first glance, the only potential issue I see (both with IE's old MHT format and with any possible zhtml) is XSS: when a downloaded file is loaded from the local filesystem into the browser, which is its domain? It may need some same-directory files, but it may be possible that it tries to fetch something from its original location that has not been downloaded, it might be trying to load content from a domain that is not the local system. This issue should be addressed if something like that is to be usable: if we face the choice of broken pages vs. security flaw, the idea will be already a failure. However, I have no idea of how to approach this. Regards, Eduard Pascual From t.broyer at gmail.com Fri Apr 2 12:41:32 2010 From: t.broyer at gmail.com (Thomas Broyer) Date: Fri, 2 Apr 2010 21:41:32 +0200 Subject: [whatwg] idea for .zhtml format #html5 #web In-Reply-To: References: <4BB61A97.5080709@schepers.cc> Message-ID: On Fri, Apr 2, 2010 at 8:39 PM, Eduard Pascual wrote: > > On Fri, Apr 2, 2010 at 6:25 PM, Doug Schepers wrote: > > I don't think it's defined anywhere, but a browser could choose to save > > bundled resources as a self-contained Widget ("File > Save as Widget..."), > > which would be a great authoring solution for Widgets. > > Isn't that the same thing, in essence, as MS did with IE? IIRC, IE had > an choice, on its save dialog, to "Save full page", which packed the > html page + all the CSS, JS, image, and other dependencies within a > ".mht" (called meta-HTML) file (which, of course, only IE would be > able to open afterwards). MHTML stands for MIME-encapsulated HTML and is an IETF RFC: http://www.rfc-editor.org/rfc/rfc2557.txt > The fact is that this feature has been removed from the more recent > versions of IE (not sure if it was from IE6 or 7). It would be > interesting to know why MS decided why such a feature should be > removed. Selecting Page -> Save as... on IE8 brings the save file dialog with the type defaulting to "Web Archive, single file (*.mht)" > At first glance, the only potential issue I see (both with IE's old > MHT format and with any possible zhtml) is XSS: when a downloaded file > is loaded from the local filesystem into the browser, which is its > domain? The one from its Content-Location MIME header. -- Thomas Broyer /t?.ma.b?wa.je/ From herenvardo at gmail.com Fri Apr 2 13:26:42 2010 From: herenvardo at gmail.com (Eduard Pascual) Date: Fri, 2 Apr 2010 22:26:42 +0200 Subject: [whatwg] idea for .zhtml format #html5 #web In-Reply-To: References: <4BB61A97.5080709@schepers.cc> Message-ID: On Fri, Apr 2, 2010 at 9:41 PM, Thomas Broyer wrote: > On Fri, Apr 2, 2010 at 8:39 PM, Eduard Pascual wrote: >> >> On Fri, Apr 2, 2010 at 6:25 PM, Doug Schepers wrote: >> > I don't think it's defined anywhere, but a browser could choose to save >> > bundled resources as a self-contained Widget ("File > Save as Widget..."), >> > which would be a great authoring solution for Widgets. >> >> Isn't that the same thing, in essence, as MS did with IE? IIRC, IE had >> an choice, on its save dialog, to "Save full page", which packed the >> html page + all the CSS, JS, image, and other dependencies within a >> ".mht" (called meta-HTML) file (which, of course, only IE would be >> able to open afterwards). > > MHTML stands for MIME-encapsulated HTML and is an IETF RFC: > http://www.rfc-editor.org/rfc/rfc2557.txt I can't remember for sure where I saw the "meta HTML" name, but I'm sure I had seen it somewhere. Anyway, thanks for the correction. >> The fact is that this feature has been removed from the more recent >> versions of IE (not sure if it was from IE6 or 7). It would be >> interesting to know why MS decided why such a feature should be >> removed. > > Selecting Page -> Save as... on IE8 brings the save file dialog with > the type defaulting to "Web Archive, single file (*.mht)" My apologies: vague memory + not testing = stupid post from me ^^; After a bit of research to refresh my memory, I've found that what MS removed from IE was the "offline favorites" feature, and MHT was portrayed as a better alternative. I just got a "404 Brain Not Found" and mixed things up. So feel free to simply ignore my previous e-mail, since it was entirely based on a mistaken assumption. Regards Eduard Pascual From ian at hixie.ch Fri Apr 2 14:37:57 2010 From: ian at hixie.ch (Ian Hickson) Date: Fri, 2 Apr 2010 21:37:57 +0000 (UTC) Subject: [whatwg] Input color state: type mismatch In-Reply-To: References: <4BAE0CAD.4020802@gmail.com> <7c2a12e21003291249j44bf9717q5a38f20434e1345d@mail.gmail.com> <4BB10830.4070500@gmail.com> Message-ID: On Sat, 3 Apr 2010, TAMURA, Kent wrote: > > I found type=number also had no typeMismatch. If a user wants to type a > negative value, he types '-' first. This state should make typeMismatch > true because '-' is not a valid floating point number. The user agent shouldn't update the value until the input is a valid number. ("User agents must not allow the user to set the value to a string that is not a valid floating point number.") -- Ian Hickson U+1047E )\._.,--....,'``. fL http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.' From ian at hixie.ch Fri Apr 2 14:39:37 2010 From: ian at hixie.ch (Ian Hickson) Date: Fri, 2 Apr 2010 21:39:37 +0000 (UTC) Subject: [whatwg] Font metrics In-Reply-To: <365E0DE8-F722-4F01-A024-BC4C71E603F3@mac.com> References: <365E0DE8-F722-4F01-A024-BC4C71E603F3@mac.com> Message-ID: On Fri, 2 Apr 2010, Greg Brown wrote: > > In reviewing the current draft API for the element > (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html), > I noticed that there is no support for obtaining font metrics such as > ascent, descent, leading, and bounding box. It seems like the most > recent discussion regarding font metrics took place a couple of years > ago: > > http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2008-May/014706.html > > But even that thread refers to discussions from 2006. > > I would personally like to see support for these values added to the > API. Is this something that could be considered for the final spec? What > are the major obstacles to providing such support? I would think that > this information could be easily obtained using the underlying graphics > API, but maybe I am missing something. It's something we'll probably add in due course, but for now we're waiting for the existing canvas API stuff to be implemented properly. We can't add too much stuff at once, because if we do the browser vendors get so far behind that they end up either rushing to catch up (leading to more bugs), or skipping parts in order to get the rest done right (leading to parts of the spec being ignored). -- Ian Hickson U+1047E )\._.,--....,'``. fL http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.' From pedzsan at gmail.com Sat Apr 3 06:55:07 2010 From: pedzsan at gmail.com (Perry Smith) Date: Sat, 3 Apr 2010 08:55:07 -0500 Subject: [whatwg] Web version formatting request Message-ID: <264D3DC7-A612-4B67-8177-B7827CE605EB@gmail.com> At the top of each page of the multipage version is a "previous", "TOC", "next" type of navigation. Can one of those be added at the bottom of each page too? When I get finished reading one "page", I have to scroll to the top and click to get to the next page. Thanks, Perry From gkbrown at mac.com Sat Apr 3 07:23:39 2010 From: gkbrown at mac.com (Greg Brown) Date: Sat, 03 Apr 2010 10:23:39 -0400 Subject: [whatwg] Font metrics In-Reply-To: References: <365E0DE8-F722-4F01-A024-BC4C71E603F3@mac.com> Message-ID: OK, that makes sense. Thanks for the info. On Apr 2, 2010, at 5:39 PM, Ian Hickson wrote: > On Fri, 2 Apr 2010, Greg Brown wrote: >> >> In reviewing the current draft API for the element >> (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html), >> I noticed that there is no support for obtaining font metrics such as >> ascent, descent, leading, and bounding box. It seems like the most >> recent discussion regarding font metrics took place a couple of years >> ago: >> >> http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2008-May/014706.html >> >> But even that thread refers to discussions from 2006. >> >> I would personally like to see support for these values added to the >> API. Is this something that could be considered for the final spec? What >> are the major obstacles to providing such support? I would think that >> this information could be easily obtained using the underlying graphics >> API, but maybe I am missing something. > > It's something we'll probably add in due course, but for now we're waiting > for the existing canvas API stuff to be implemented properly. We can't add > too much stuff at once, because if we do the browser vendors get so far > behind that they end up either rushing to catch up (leading to more bugs), > or skipping parts in order to get the rest done right (leading to parts of > the spec being ignored). > > -- > Ian Hickson U+1047E )\._.,--....,'``. fL > http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,. > Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.' From pedzsan at gmail.com Sat Apr 3 07:59:27 2010 From: pedzsan at gmail.com (Perry Smith) Date: Sat, 3 Apr 2010 09:59:27 -0500 Subject: [whatwg] Section 2.7.2.1 (HTMLCollection) question Message-ID: <0AE4F6D4-BA33-456A-AF32-42339271AD5C@gmail.com> From [1] > The namedItem(key) method must return the first node in the > collection that matches the following requirements: > > It is an a, applet, area, embed, form, frame, frameset, iframe, img, > or object element with a name attribute equal to key, or, > It is an element with an ID equal to key. Should "equal" be clarified? In particular, from 2.4.9, I got the idea that comparing names would be "compatibility caseless" at least in that instance. Is that also true here? I don't see the term "valid hash-name reference" in this section so I don't think I missed something but I easily could have. Also, off topic a little: should these questions be posted here or is it more productive to use the form on the page? [1] http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#htmlcollection-0 Thank you, Perry -------------- next part -------------- An HTML attachment was scrubbed... URL: From onsemeliot at gmx.net Sat Apr 3 14:25:54 2010 From: onsemeliot at gmx.net (Onsemeliot) Date: Sat, 03 Apr 2010 23:25:54 +0200 Subject: [whatwg] Using fonts stored on servers In-Reply-To: References: Message-ID: <20100403212554.30870@gmx.net> Hi people, I hope nobody is offended if I start being a member of this group by asking for a feature in the new standard. I'm a web designer and try to stick to clear standards in order to get the best results on various systems, but I wonder why you don't implement the support of defining (at least) free font faces stored at any server. There is an old solution for this on Netscape 4.1 and IE 4, but no newer browser supports anything similar. I often work with very tight corporite design rules. They need to be implemented in all layout's, but it is always necessary to violate them on web pages because it is impossible to use specific fonts there without switching to images instead of using real text. Do you see any chance of supporting such a feature in the future? Bye for now Onsemeliot -- Sicherer, schneller und einfacher. Die aktuellen Internet-Browser - jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/atbrowser From ash at ashleysheridan.co.uk Sat Apr 3 14:31:40 2010 From: ash at ashleysheridan.co.uk (Ashley Sheridan) Date: Sat, 03 Apr 2010 22:31:40 +0100 Subject: [whatwg] Using fonts stored on servers In-Reply-To: <20100403212554.30870@gmx.net> References: <20100403212554.30870@gmx.net> Message-ID: <1270330300.28845.134.camel@localhost> On Sat, 2010-04-03 at 23:25 +0200, Onsemeliot wrote: > Hi people, > > I hope nobody is offended if I start being a member of this group by asking for a feature in the new standard. > > I'm a web designer and try to stick to clear standards in order to get the best results on various systems, but I wonder why you don't implement the support of defining (at least) free font faces stored at any server. > > There is an old solution for this on Netscape 4.1 and IE 4, but no newer browser supports anything similar. > > I often work with very tight corporite design rules. They need to be implemented in all layout's, but it is always necessary to violate them on web pages because it is impossible to use specific fonts there without switching to images instead of using real text. > > Do you see any chance of supporting such a feature in the future? > > Bye for now > Onsemeliot CSS3 has this in terms of font support, but it's just a wait for browsers to implement it or reject it I guess: http://www.w3.org/TR/css3-fonts/ Thanks, Ash http://www.ashleysheridan.co.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From jackalmage at gmail.com Sat Apr 3 14:43:21 2010 From: jackalmage at gmail.com (Tab Atkins Jr.) Date: Sat, 3 Apr 2010 14:43:21 -0700 Subject: [whatwg] Using fonts stored on servers In-Reply-To: <1270330300.28845.134.camel@localhost> References: <20100403212554.30870@gmx.net> <1270330300.28845.134.camel@localhost> Message-ID: On Sat, Apr 3, 2010 at 2:31 PM, Ashley Sheridan wrote: > > On Sat, 2010-04-03 at 23:25 +0200, Onsemeliot wrote: > > Hi people, > > I hope nobody is offended if I start being a member of this group by asking for a feature in the new standard. > > I'm a web designer and try to stick to clear standards in order to get the best results on various systems, but I wonder why you don't implement the support of defining (at least) free font faces stored at any server. > > There is an old solution for this on Netscape 4.1 and IE 4, but no newer browser supports anything similar. > > I often work with very tight corporite design rules. They need to be implemented in all layout's, but it is always necessary to violate them on web pages because it is impossible to use specific fonts there without switching to images instead of using real text. > > Do you see any chance of supporting such a feature in the future? > > Bye for now > Onsemeliot > > CSS3 has this in terms of font support, but it's just a wait for browsers to implement it or reject it I guess: > > http://www.w3.org/TR/css3-fonts/ All modern browsers support the @font-face declaration in CSS. Even IE6 and 7 do. There is a slight wrinkle in that they accept different formats, though. IE only accepts fonts in the EOT format, while other browsers accept fonts in the normal TTF format and possibly WOFF format. There are converters both online and downloadable to turn a TTF font into an EOT very easily, and there are guides online about how to safely and easily serve both types of fonts to both browsers (you can't *quite* do what the CSS Fonts module says, because IE's support is somewhat buggy). So feel free to use webfonts on your website. All your visitors will be able to see them. ~TJ From ash at ashleysheridan.co.uk Sat Apr 3 14:45:02 2010 From: ash at ashleysheridan.co.uk (Ashley Sheridan) Date: Sat, 03 Apr 2010 22:45:02 +0100 Subject: [whatwg] Using fonts stored on servers In-Reply-To: References: <20100403212554.30870@gmx.net> <1270330300.28845.134.camel@localhost> Message-ID: <1270331102.28845.137.camel@localhost> On Sat, 2010-04-03 at 14:43 -0700, Tab Atkins Jr. wrote: > On Sat, Apr 3, 2010 at 2:31 PM, Ashley Sheridan > wrote: > > > > On Sat, 2010-04-03 at 23:25 +0200, Onsemeliot wrote: > > > > Hi people, > > > > I hope nobody is offended if I start being a member of this group by asking for a feature in the new standard. > > > > I'm a web designer and try to stick to clear standards in order to get the best results on various systems, but I wonder why you don't implement the support of defining (at least) free font faces stored at any server. > > > > There is an old solution for this on Netscape 4.1 and IE 4, but no newer browser supports anything similar. > > > > I often work with very tight corporite design rules. They need to be implemented in all layout's, but it is always necessary to violate them on web pages because it is impossible to use specific fonts there without switching to images instead of using real text. > > > > Do you see any chance of supporting such a feature in the future? > > > > Bye for now > > Onsemeliot > > > > CSS3 has this in terms of font support, but it's just a wait for browsers to implement it or reject it I guess: > > > > http://www.w3.org/TR/css3-fonts/ > > All modern browsers support the @font-face declaration in CSS. Even > IE6 and 7 do. There is a slight wrinkle in that they accept different > formats, though. IE only accepts fonts in the EOT format, while other > browsers accept fonts in the normal TTF format and possibly WOFF > format. There are converters both online and downloadable to turn a > TTF font into an EOT very easily, and there are guides online about > how to safely and easily serve both types of fonts to both browsers > (you can't *quite* do what the CSS Fonts module says, because IE's > support is somewhat buggy). > > So feel free to use webfonts on your website. All your visitors will > be able to see them. > > ~TJ http://webfonts.info/wiki/index.php?title=@font-face_browser_support shows what browsers support what. Thanks, Ash http://www.ashleysheridan.co.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From pedzsan at gmail.com Sat Apr 3 17:47:31 2010 From: pedzsan at gmail.com (Perry Smith) Date: Sat, 3 Apr 2010 19:47:31 -0500 Subject: [whatwg] Web Apps as epub Message-ID: <7687F036-EB26-4C8F-9670-DB6729A755A0@gmail.com> Hi, Ian and I have been working trying to get the "overall.html" document as an epub format for ebook readers. I have got a version that appears to be working on my nook. I've put it here: http://aix-consulting.net/web_apps.epub If anyone has an ebook reader, please download it and let me know if you have any problems reading it. So far, its been working for me. The process is not yet 100% automatic but we hope to get that accomplished at some point so that it will be up kept up to date. Thanks, Perry From pedzsan at gmail.com Sat Apr 3 18:16:14 2010 From: pedzsan at gmail.com (Perry Smith) Date: Sat, 3 Apr 2010 20:16:14 -0500 Subject: [whatwg] HTMLCollection and HTMLAllCollection suggestion Message-ID: <32D6EB12-D495-4DC0-B23C-9A00E9441575@gmail.com> HTMLCollection has a namedItem method that returns either null or one object. [1] HTMLAllCollection has a namedItem method that returns either null, one object, or a collection of objects. [2] I'm a Rails freak and one of the things that they do which I love is foo returns an item and foos returns a list of items. The unconscious benefit of this I believe is huge. My suggestion is to have namedItem always return either null or 1 object. And have namedItems always return a collection. We can debate whether it is better to return null or an empty collection. I prefer the latter myself. Then I can always feed it to an iterator. [1] http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#htmlcollection-0 [2] http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#htmlallcollection-0 -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at davidflanagan.com Sat Apr 3 21:58:15 2010 From: david at davidflanagan.com (David Flanagan) Date: Sat, 03 Apr 2010 21:58:15 -0700 Subject: [whatwg] HTMLCollection and HTMLAllCollection suggestion In-Reply-To: <32D6EB12-D495-4DC0-B23C-9A00E9441575@gmail.com> References: <32D6EB12-D495-4DC0-B23C-9A00E9441575@gmail.com> Message-ID: <4BB81C67.4060208@davidflanagan.com> Perry Smith wrote: > HTMLCollection has a namedItem method that returns either null or one > object. [1] > > HTMLAllCollection has a namedItem method that returns either null, one > object, or a collection of objects. [2] > > I'm a Rails freak and one of the things that they do which I love is foo > returns an item and foos returns a list of items. The unconscious > benefit of this I believe is huge. > > My suggestion is to have namedItem always return either null or 1 object. > > And have namedItem*s* always return a collection. We can debate whether > it is better to return null or an empty collection. I prefer the latter > myself. Then I can always feed it to an iterator. > > [1] http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#htmlcollection-0 > [2] http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#htmlallcollection-0 Perry, But no one actually invokes namedItem()--they just use a regular property access expression on an HTMLAllCollection. namedItem() is left over from the strange days when the W3C was specifying Java APIs for working with XML instead of JavaScript APIs for HTML! David Flanagan From onsemeliot at gmx.net Sun Apr 4 02:55:00 2010 From: onsemeliot at gmx.net (Onsemeliot) Date: Sun, 04 Apr 2010 11:55:00 +0200 Subject: [whatwg] Using fonts stored on servers In-Reply-To: <1270331102.28845.137.camel@localhost> References: <20100403212554.30870@gmx.net> <1270330300.28845.134.camel@localhost> <1270331102.28845.137.camel@localhost> Message-ID: <20100404095500.4750@gmx.net> Thank you all, it's embarrassing that i expected font management from the HTML standards instead of from CSS. Thank you for leading me to the CSS3-possibilities. Ciao Onsemeliot > > > > > > CSS3 has this in terms of font support, but it's just a wait for > browsers to implement it or reject it I guess: > > > > > > http://www.w3.org/TR/css3-fonts/ > > > > All modern browsers support the @font-face declaration in CSS. Even > > IE6 and 7 do. There is a slight wrinkle in that they accept different > > formats, though. IE only accepts fonts in the EOT format, while other > > browsers accept fonts in the normal TTF format and possibly WOFF > > format. There are converters both online and downloadable to turn a > > TTF font into an EOT very easily, and there are guides online about > > how to safely and easily serve both types of fonts to both browsers > > (you can't *quite* do what the CSS Fonts module says, because IE's > > support is somewhat buggy). > > > > So feel free to use webfonts on your website. All your visitors will > > be able to see them. > > > > ~TJ > > > http://webfonts.info/wiki/index.php?title=@font-face_browser_support > shows what browsers support what. > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > -- Sicherer, schneller und einfacher. Die aktuellen Internet-Browser - jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/atbrowser From saurabh at skjworld.com Sun Apr 4 04:50:39 2010 From: saurabh at skjworld.com (Saurabh Jain) Date: Sun, 4 Apr 2010 17:20:39 +0530 Subject: [whatwg] Image Collision Detection in Canvas Message-ID: Hi, I have a proposal for adding generic image collision API in Canvas. Given two images HTMLImageElement objects and there respective x, y, clip width and clip height the API call will let you know if there's any non-transparent pixel (any opaque or translucent pixel) in one image's clipping region that overlaps a non-transparent pixel in another image's clipping region. The clipping region defined by this API call is for local use only for this purpose. This API will be useful for game programmers. I am author of India's first book on J2ME and have been developing mobile games since 2002. I have through personal experience observed that this pixel level collision at native level is required for game developers to build games easily. What I am referring to is a kind of generic pixel level collision. People are free to develop there own complex collision mechanisms for complex games but small teams composed of new game developers find image collision detection implementation the most difficult concept in the whole game development process to grasp. Also pixel level checking for two 100 pixel x 100pixel images will involve lot of execution time if done at JavaScript level since up to 10000 checks may have to be performed. Native browser support can speed things a lot. Similar thing happened in J2ME where before MIDP 2.0 people had hard time to do pixel level collision both due to programming complexity and execution issues. Saurabh Jain Director SKJ Technologies Private Limited http://www.skjworld.com Author : Mobile Phone Programming using Java ME (J2ME) http://library.skjworld.com/mobile-technology/java/java-me -------------- next part -------------- An HTML attachment was scrubbed... URL: From pedzsan at gmail.com Sun Apr 4 07:07:21 2010 From: pedzsan at gmail.com (Perry Smith) Date: Sun, 4 Apr 2010 09:07:21 -0500 Subject: [whatwg] HTMLCollection and HTMLAllCollection suggestion In-Reply-To: <4BB81C67.4060208@davidflanagan.com> References: <32D6EB12-D495-4DC0-B23C-9A00E9441575@gmail.com> <4BB81C67.4060208@davidflanagan.com> Message-ID: <54D1AD08-A78B-4874-B24E-9432FA4D7AE3@gmail.com> On Apr 3, 2010, at 11:58 PM, David Flanagan wrote: > Perry Smith wrote: >> HTMLCollection has a namedItem method that returns either null or >> one object. [1] >> HTMLAllCollection has a namedItem method that returns either null, >> one object, or a collection of objects. [2] >> I'm a Rails freak and one of the things that they do which I love >> is foo returns an item and foos returns a list of items. The >> unconscious benefit of this I believe is huge. >> My suggestion is to have namedItem always return either null or 1 >> object. >> And have namedItem*s* always return a collection. We can debate >> whether it is better to return null or an empty collection. I >> prefer the latter myself. Then I can always feed it to an iterator. >> [1] http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#htmlcollection-0 >> [2] http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#htmlallcollection-0 > > Perry, > > But no one actually invokes namedItem()--they just use a regular > property access expression on an HTMLAllCollection. namedItem() is > left over from the strange days when the W3C was specifying Java > APIs for working with XML instead of JavaScript APIs for HTML! Hmm. I was wondering. The pop up boxes on the side did not have any icons in them so I thought no one had implemented them. Can you give me an example of "regular property access expression on an HTMLAllCollection" ? I can't figure out what you are referring to. Thanks, Perry From ian at hixie.ch Sun Apr 4 15:10:31 2010 From: ian at hixie.ch (Ian Hickson) Date: Sun, 4 Apr 2010 22:10:31 +0000 (UTC) Subject: [whatwg] Web version formatting request In-Reply-To: <264D3DC7-A612-4B67-8177-B7827CE605EB@gmail.com> References: <264D3DC7-A612-4B67-8177-B7827CE605EB@gmail.com> Message-ID: On Sat, 3 Apr 2010, Perry Smith wrote: > At the top of each page of the multipage version is a "previous", "TOC", > "next" type of navigation. > > Can one of those be added at the bottom of each page too? > > When I get finished reading one "page", I have to scroll to the top and click > to get to the next page. All the multipage stuff is done by Philip. -- Ian Hickson U+1047E )\._.,--....,'``. fL http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.' From tkent at chromium.org Sun Apr 4 19:19:17 2010 From: tkent at chromium.org (TAMURA, Kent) Date: Mon, 5 Apr 2010 11:19:17 +0900 Subject: [whatwg] Input color state: type mismatch In-Reply-To: References: <4BAE0CAD.4020802@gmail.com> <7c2a12e21003291249j44bf9717q5a38f20434e1345d@mail.gmail.com> <4BB10830.4070500@gmail.com> Message-ID: On Sat, Apr 3, 2010 at 06:37, Ian Hickson wrote: > On Sat, 3 Apr 2010, TAMURA, Kent wrote: > > > > I found type=number also had no typeMismatch. If a user wants to type a > > negative value, he types '-' first. ?This state should make typeMismatch > > true because '-' is not a valid floating point number. > The user agent shouldn't update the value until the input is a valid > number. ("User agents must not allow the user to set the value to a string > that is not a valid floating point number.") Why are type=email and url different from type=number at this point? -- TAMURA Kent Software Engineer, Google From mounir.lamouri at gmail.com Mon Apr 5 05:21:25 2010 From: mounir.lamouri at gmail.com (Mounir Lamouri) Date: Mon, 05 Apr 2010 14:21:25 +0200 Subject: [whatwg] Why [PutForwards=value] for htmlFor output element attribute ? Message-ID: <4BB9D5C5.10102@gmail.com> Hi, I'm wondering why the [PutForwards=value] extended attribute is needed for the htmlFor output element attribute ? It is making things pretty ugly for a need I do not really get. Thanks, -- Mounir From pokemon260 at gmail.com Mon Apr 5 06:11:48 2010 From: pokemon260 at gmail.com (Swampert) Date: Mon, 5 Apr 2010 21:11:48 +0800 Subject: [whatwg] Will you consider about RFC 4329? Message-ID: Dear WHATAG, In your HTML5 draft standard, the default value for type attribute in script element is "text/javascript". While according to RFC 4329, the MIME type "text/javascript" is obsolete, the proper MIME type for JavaScript is "application/javascript" or "application/ecmascript". And Apache also can serve .js files as application/javascript MIME type. And JavaScript is obviously somewhat a kind of application, we already serve XHTML1.1/XHTML5 webpages as application/xhtml+xml, why don't we use application/* on JavaScript? I think HTML5 should be for the future, not just being pragmatic. Even though IE doesn't welcome the new MIME type ( IE even don't welcome application/xhtml+xml ), changing the default type for script doesn't bring any trouble, and won't break the web. Because when the type attribute is absent, IE can still run the script. We can just let modern browsers regard script as the right MIME type. -- Ilex.Swampert. 52POKE.COM - Paradise for Pok?mon Fans -------------- next part -------------- An HTML attachment was scrubbed... URL: From supercanadian at gmail.com Mon Apr 5 08:57:49 2010 From: supercanadian at gmail.com (Charles Iliya Krempeaux) Date: Mon, 5 Apr 2010 08:57:49 -0700 Subject: [whatwg] Will you consider about RFC 4329? In-Reply-To: References: Message-ID: Hello, On Mon, Apr 5, 2010 at 6:11 AM, Swampert wrote: > > Dear WHATAG, > In your HTML5 draft standard, the default value for type attribute in script element is "text/javascript". While according to RFC 4329, the MIME type "text/javascript" > is obsolete, the proper MIME type for JavaScript is "application/javascript" or "application/ecmascript". And Apache also can serve .js files as application/javascript MIME > type. And JavaScript is obviously somewhat a kind of application, we already serve XHTML1.1/XHTML5 webpages as application/xhtml+xml, why don't we use > application/* on JavaScript? Isn't the reason that XML (including XHTML) changed from the text/* MIME types to the application/* MIME types have to do with problems that occurred with Character Transcoding that automagically happens from Transcoding Proxies when the HTTP Content-Type is give as a text/* MIME type?!? Specifically, the issue that occurs when an XML document (explicitly or implicitly) declares an encoding different than the Content-Type (explicitly or implicitly) declared by HTTP?! I.e., I don't think they are choosing application/* MIME types because JavaScript is "a kind of application". (Not that the "application/*" MIME type actually means that the file, with said MIME type, is "a kind of application".) -- Charles Iliya Krempeaux, B.Sc. http://changelog.ca/ Everything a Web Developer or Web Designer Should Know - http://w3remix.com/ From david at davidflanagan.com Mon Apr 5 11:04:13 2010 From: david at davidflanagan.com (David Flanagan) Date: Mon, 05 Apr 2010 11:04:13 -0700 Subject: [whatwg] HTMLCollection and HTMLAllCollection suggestion In-Reply-To: <54D1AD08-A78B-4874-B24E-9432FA4D7AE3@gmail.com> References: <32D6EB12-D495-4DC0-B23C-9A00E9441575@gmail.com> <4BB81C67.4060208@davidflanagan.com> <54D1AD08-A78B-4874-B24E-9432FA4D7AE3@gmail.com> Message-ID: <4BBA261D.9070401@davidflanagan.com> Perry Smith wrote: > > On Apr 3, 2010, at 11:58 PM, David Flanagan wrote: > >> Perry Smith wrote: >>> HTMLCollection has a namedItem method that returns either null or one >>> object. [1] >>> HTMLAllCollection has a namedItem method that returns either null, >>> one object, or a collection of objects. [2] >>> I'm a Rails freak and one of the things that they do which I love is >>> foo returns an item and foos returns a list of items. The >>> unconscious benefit of this I believe is huge. >>> My suggestion is to have namedItem always return either null or 1 >>> object. >>> And have namedItem*s* always return a collection. We can debate >>> whether it is better to return null or an empty collection. I prefer >>> the latter myself. Then I can always feed it to an iterator. >>> [1] >>> http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#htmlcollection-0 >>> >>> [2] >>> http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#htmlallcollection-0 >>> >> >> Perry, >> >> But no one actually invokes namedItem()--they just use a regular >> property access expression on an HTMLAllCollection. namedItem() is >> left over from the strange days when the W3C was specifying Java APIs >> for working with XML instead of JavaScript APIs for HTML! > > Hmm. I was wondering. The pop up boxes on the side did not have any > icons in them so I thought no one had implemented them. > > Can you give me an example of "regular property access expression on an > HTMLAllCollection" ? I can't figure out what you are referring to. > > Thanks, > Perry > > Perry, I think the only HTMLAllCollection is the deprecated document.all. By regular property access expression, I mean something like: document.all.foo or document.all["foo"] instead of: document.all.namedItem("foo") David From ian at hixie.ch Mon Apr 5 13:10:10 2010 From: ian at hixie.ch (Ian Hickson) Date: Mon, 5 Apr 2010 20:10:10 +0000 (UTC) Subject: [whatwg] Will you consider about RFC 4329? In-Reply-To: References: Message-ID: On Mon, 5 Apr 2010, Swampert wrote: > > In your HTML5 draft standard, the default value for type attribute in > script element is "text/javascript". While according to RFC 4329, the > MIME type "text/javascript" is obsolete, the proper MIME type for > JavaScript is "application/javascript" or "application/ecmascript". The type everyone uses is text/javascript. What's the point of using application/javascript? What problem does it solve? > And Apache also can serve .js files as application/javascript MIME type. > And JavaScript is obviously somewhat a kind of application, we already > serve XHTML1.1/XHTML5 webpages as application/xhtml+xml, why don't we > use application/* on JavaScript? I think HTML5 should be for the future, > not just being pragmatic. application/ doesn't mean the type describes an application, it means the type describes binary application data that doesn't fit other categories. > Even though IE doesn't welcome the new MIME type ( IE even don't welcome > application/xhtml+xml ), changing the default type for script doesn't > bring any trouble, and won't break the web. Because when the type > attribute is absent, IE can still run the script. We can just let modern > browsers regard script as the right MIME type. I think a better solution would be to fix RFC 4329 to match deployed reality. -- Ian Hickson U+1047E )\._.,--....,'``. fL http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.' From dhtmlkitchen at gmail.com Mon Apr 5 13:49:17 2010 From: dhtmlkitchen at gmail.com (Garrett Smith) Date: Mon, 5 Apr 2010 13:49:17 -0700 Subject: [whatwg] currentAlert is undefined Message-ID: I am getting js errors on the HTML 5 specification in FF 3.6. Not testing, now, jsut trying to do some RTFM. THis page: http://www.whatwg.org/specs/web-apps/current-work/multipage/apis-in-html-documents.html#innerhtml Results in error: currentAlert is undefined currentAlert.className = 'closed'; From p01 at opera.com Tue Apr 6 00:21:44 2010 From: p01 at opera.com (Mathieu 'p01' Henri) Date: Tue, 06 Apr 2010 10:21:44 +0300 Subject: [whatwg] Font metrics In-Reply-To: References: <365E0DE8-F722-4F01-A024-BC4C71E603F3@mac.com> Message-ID: On Sat, 03 Apr 2010 17:23:39 +0300, Greg Brown wrote: > OK, that makes sense. Thanks for the info. However, a extra readonly attribute float "height" to the "TextMetrics" interface should be fairly trivial to implement for browser vendors and would greatly help web developers layout text in Canvas. > On Apr 2, 2010, at 5:39 PM, Ian Hickson wrote: > >> On Fri, 2 Apr 2010, Greg Brown wrote: >>> >>> In reviewing the current draft API for the element >>> (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html), >>> I noticed that there is no support for obtaining font metrics such as >>> ascent, descent, leading, and bounding box. It seems like the most >>> recent discussion regarding font metrics took place a couple of years >>> ago: >>> >>> http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2008-May/014706.html >>> >>> But even that thread refers to discussions from 2006. >>> >>> I would personally like to see support for these values added to the >>> API. Is this something that could be considered for the final spec? >>> What >>> are the major obstacles to providing such support? I would think that >>> this information could be easily obtained using the underlying graphics >>> API, but maybe I am missing something. >> >> It's something we'll probably add in due course, but for now we're >> waiting >> for the existing canvas API stuff to be implemented properly. We can't >> add >> too much stuff at once, because if we do the browser vendors get so far >> behind that they end up either rushing to catch up (leading to more >> bugs), >> or skipping parts in order to get the rest done right (leading to parts >> of >> the spec being ignored). >> >> -- >> Ian Hickson U+1047E )\._.,--....,'``. fL >> http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,. >> Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.' > -- Mathieu 'p01' Henri \ Opera Software JavaScript Developer \ Core ExtApps From ian at hixie.ch Tue Apr 6 02:00:48 2010 From: ian at hixie.ch (Ian Hickson) Date: Tue, 6 Apr 2010 09:00:48 +0000 (UTC) Subject: [whatwg] Forms feedback In-Reply-To: References: <20100402182849.A1E2.C8DE7135@html5.jp> Message-ID: On Thu, 21 Jan 2010, NARUSE, Yui wrote: > In 4.10.19.4 URL-encoded form data, The > application/x-www-form-urlencoded encoding algorithm, > it says: > > > For each character in the entry's name and value, apply the following > > subsubsteps: > > > > If the character isn't in the range U+0020, U+002A, U+002D, U+002E, > > U+0030 to U+0039, U+0041 to U+005A, U+005F, U+0061 to U+007A then > > replace the character with a string formed as follows: Start with the > > empty string, and then, taking each byte of the character when > > expressed in the selected character encoding in turn, append to the > > string a U+0025 PERCENT SIGN character (%) followed by two characters > > in the ranges U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9) and > > U+0041 LATIN CAPITAL LETTER A to U+0046 LATIN CAPITAL LETTER F > > representing the hexadecimal value of the byte (zero-padded if > > necessary). > > > > If the character is a U+0020 SPACE character, replace it with a single > > U+002B PLUS SIGN character (+). > > This means, U+9670, encoded as "?x89?x41" in Shift_JIS, must be encoded > as "%89%41", and shouldn't be "%89A"? Either is fine (they mean the same thing). I've changed the spec to be closer to what browsers do though, thanks. On Thu, 21 Jan 2010, Aryeh Gregor wrote: > > MediaWiki currently uses a search-suggest feature based on lots of > JavaScript that's used to calculate all sorts of widths and heights to > painstakingly construct an absolutely-positioned div, and reimplement > standard dropdown navigation controls on top of that. It works pretty > well (go to en.wikipedia.org and start typing a query to see -- > implementation at > ), > but it's a horrible hack and doesn't integrate perfectly with the > system. When I found out Opera implements , thanks to the > helpful spec annotations, I tried rewriting mwsuggest.js to use > where supported. > > My primary feedback here is that a simpler JS API would *really* be > nice. In this kind of situation, typically you receive some JSON or > whatnot from the server, so you have a JavaScript array that you want > to use for suggestions. The code to make a given list the suggest > source for an input is something like: > > var datalist = document.getElementById( 'arbitrary-id' ); > if ( datalist == null ) { > datalist = document.createElement( 'datalist' ); > datalist.id = 'arbitrary-id'; > document.body.appendChild( datalist ); > } else { > datalist.innerHTML = ''; > } > input.setAttribute( 'list', 'arbitrary-id' ); > while ( var i = 0; i < suggestions.length; i++ ) { > var option = document.createElement( 'option' ); > option.value = suggestions[i]; > datalist.appendChild( option ); > } > > This is all quite awkward. It was pointed out on IRC that there are > legitimate use-cases for declarative datalists (e.g., > http://html5.lachy.id.au/), but I'd expect JS-constructed datalists to > be a much bigger use-case. I can think of several sites off the top > of my head that use absolutely-positioned divs to provide search > suggestions to users, but none that do so statically. So I think a > better API is needed -- preferably just > > input.suggest = suggestions; > > or similar. The details aren't particularly important, but the > current API is really cumbersome when used from JS. To be fair a lot of the above is redundant with just having the in the document ahead of time. All you really need is to set the contents of the element's contents each time; this need not be more than one line if what you send from the server is a string of HTML representing the