Charles Pritchard | 1 Jan 2011 02:17

Processing the zoom level - MS extensions to window.screen

Regarding:
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-December/029557.html

My objections have been noted throughout the threads:

 > It's not possible to discover the scaling of CSS pixels to actual device
 > pixels, with the current standard.

Ian's response:

"This is by design. You shouldn't need to know the actual device pixel
depth, as far as I can tell. What's the use case?"

I've got to say, this horse has been beaten to death.

It's necessary to know CSS pixel scaling to match the backend bitmap 
with the device.
This is common, active practice on mobile devices:
  [canvas width="200" style="width: 100px;"]

This is the current "fix" for Mozilla, as they are unwilling to budge:
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-December/029475.html

Robert O'Callahan's proposal would break some existing applications, and 
though it is indeed within the bounds of the existing spec, it would 
lead to slower canvas implementations; it'd also lead to weird 
situations where canvas backing sizes are of different dimensions across 
elements -- this would again, lead to unnecessary computing when using 
resources.  I've forwarded his proposal to the FX group, as I do think 
it has strong merit as part of the SVG/CSS discussions: Canvas has not 
(Continue reading)

Charles Pritchard | 1 Jan 2011 02:19

Fwd: RE: Inconsistent behaviour of globalCompositeOperation property

Implementation issues with the Drawing Model [1] have been floating around for some time.
For whatever reasons, Microsoft is not willing to publicly discuss their issue with the spec,
beyond the scant details listed below.

That's fine and all.. I'm bringing it to the WHATWG's attention because it seems to me
like some of the confusion could be avoided were a "standard" PNG photo available,
demonstrating proper behavior.

I thought this issue was resolved some time ago, but it keeps coming up.
I don't fault anyone, it's a very subtle part of the spec.

This reference image helped me communicate with Robert (Mozilla) last year, about the drawing model section.
Screen cap:
http://imgur.com/zUu66.png
Generated from:
https://developer.mozilla.org/en/Canvas_tutorial/Compositing
Thread:
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-December/024316.html

There seems to still be some disagreement over composting:
https://bugs.webkit.org/show_bug.cgi?id=39177

I thought we had a handle on this, following some slight changes to the spec by Ian:
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-October/023706.html

Apparently it's not handled yet.

Sending out a flare, hoping that we can get this issue put to rest before the next round
of major releases.


-Charles

Below are the only public comments I'm aware of, that MS has posted on the issue:
http://lists.w3.org/Archives/Public/public-canvas-api/2010OctDec/0070.html
Earlier thread...
http://lists.w3.org/Archives/Public/public-canvas-api/2010AprJun/0046.html

These comments lack the detail necessary to provide feedback.


-------- Original Message -------- Subject: Resent-Date: Resent-From: Date: From: To:
RE: Inconsistent behaviour of globalCompositeOperation property
Wed, 15 Dec 2010 23:47:24 +0000
public-canvas-api-Pl0VvzL1eo4@public.gmane.org
Wed, 15 Dec 2010 23:45:39 +0000
Jatinder Mann <jmann-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>
public-canvas-api-Pl0VvzL1eo4@public.gmane.org <public-canvas-api-Pl0VvzL1eo4@public.gmane.org>


We initially felt that the Drawing Model [1], as written in the spec, was incorrectly defined. We have since consulted with many graphics experts, and it appears that the spec as written, and implemented by Firefox and Opera, is the correct definition of Porter-Duff and composition operations, and its behavior is acceptable.

 

Thanks,

Jatinder

 

[1] http://dev.w3.org/html5/2dcontext/#drawing-model

 

Jatinder Mann | Microsoft Program Manager | jmann-0li6OtcxBFHby3iVrkZq2A@public.gmane.org

 

From: public-canvas-api-request-Pl0VvzL1eo4@public.gmane.org [mailto:public-canvas-api-request-Pl0VvzL1eo4@public.gmane.org] On Behalf Of Jatinder Mann
Sent: Tuesday, May 25, 2010 11:57 AM
To: public-canvas-api-Pl0VvzL1eo4@public.gmane.org
Subject: Inconsistent behaviour of globalCompositeOperation property

 

As we were reviewing the globalCompositeOperation property [1] of the Canvas 2D Context, we have noticed that there is a large inconsistency with the way web browsers implement this property.

 

Firefox 3.6.3 and Opera 10.5 have a similar behaviour that matches the current version of the Canvas 2D Context spec. Chrome 4.1 and Safari 4.0.5 behave similarly to each other, albeit differently from the spec. Today, web developers cannot reliably use this property in designing their webpages due to this interoperability issue.

 

We consider that the Safari implementation of the Drawing Model makes more sense from a web developer point of view. Most of the Canvas APIs are applied to the next primitive being drawn. However, the clipping behavior, as defined in the current Drawing Model [2], affects the current contents of the Canvas outside of the current primitive being drawn. The Safari Drawing Model calls for the clipping region to only affect the current primitive being drawn.

 

We recommend updating the spec to match the Safari Drawing Model. We would like to discuss this area in more detail.

 

Thank you,

Jatinder

 

[1] http://dev.w3.org/html5/2dcontext/#compositing 

[2] http://dev.w3.org/html5/2dcontext/#drawing-model

 

Jatinder Mann | Microsoft Program Manager | jmann-0li6OtcxBFHby3iVrkZq2A@public.gmane.org

 

Charles Pritchard | 1 Jan 2011 02:23

Exposing spelling/grammar suggestions in contentEditable

Regarding:
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-December/029559.html

This has (somewhat) been resolved: Benjamin has pointed out that 
aria-invalid = "spelling|grammar"
would work just fine with <mark>. It's simply not implemented by vendors 
at the moment. It is covered
by the WAI ARIA 1.0 LC doc.

somebody [mark aria-invalid="spelling"]mispeld[/mark] this text.

Charles Pritchard | 1 Jan 2011 02:35

Low Memory Event

Regarding:
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-December/029575.html

Web Applications may have wildly different use cases than hypertext 
documents.

The issue at hand is attempting, in some part, to send a signal to the 
DOM that a low
memory condition exists. This may not happen, but it certainly has 
strong use cases in web apps.

This doesn't mean adding any sort of constraint: it's simply a 
suggestion which the listening
application is free to ignore.

Currently, we can fool around with window.onblur, to try and "guess" 
when responsiveness is less important.

Ian's response to Rob demonstrates something that will always exist: 
Sometimes we switch tabs, and the other tab is a lower priority.
Apple's innovations with the iOS demonstrate how useful events can be, 
for eeking out a little extra stability in constrained environments.

Chrome and Firefox will crash / behave funnily when RAM is short. RAM 
gets short on my machine.
Safari also bails out, on the iOS, when RAM runs out. These can't be 
avoided completely, but they can
easily be mitigated by sending out an event, which the author can use to 
slim-down their environment.

A web application I work on uses Canvas bitmaps as buffers, to speed 
things up, like "Undo", when drawing.
It also uses Canvas to keep image sprites available. Many of these 
buffers can be destroyed at any time,
but doing so would mean they need to be recreated, taking up CPU. It's a 
typical CPU vs RAM trade-off.

If I were to receive an event, letting me know a low memory condition 
exists, I'd drop most of my buffers
immediately, allowing for the machine and my application to carry on 
normally, a little while longer.

This little bit of information sharing means a little bit more stability.

So, again: if low memory, then get rid of unneeded data in the scripting 
environment, such as canvas bitmaps, and state arrays.
The upside, is that the browser would run out of ram a little less 
often. The downside is that there'd be another word in the
large vocabulary of HTML/DOM events.

It may not be time to tackle these kind of issues, but I thought I'd 
give it a shot.

The usefulness has already been proven by iOS applications. We can work 
with low memory events there.
I'd like to be able to listen for them on the desktop as well.

-Charles

Glenn Maynard | 1 Jan 2011 03:43
Gravatar

Re: Processing the zoom level - MS extensions to window.screen

On Fri, Dec 31, 2010 at 8:17 PM, Charles Pritchard <chuck@...> wrote:
> Nor will it be addressed, as Mozilla has given firm notice, they've intentionally obfuscated
> the value (devicePixelRatio), in the scripting environment. I dislike seeing that kind of behavior
> in any software.

It seems like the same old problem: someone's convinced himself that
he's thought of everything, and considers anything he didn't think of,
that doesn't fit the shiny, unbending, academic design in his head, as
invalid.  It's as frustrating to have my software fall victim to this
as it's always been.

Somebody wrote an NES emulator in Javascript, and even now I wouldn't
have believed it if I didn't see it myself.  Anybody saying "you
should never need to do that" today needs to prepare themselves for
plausible counterexamples.

> WebKit is stuck, as Mozilla won't budge. MS has exposed the values in a
> non-standard way.

Why is WebKit stuck because of Mozilla?  Having browser-specific fixes
for IE and for WebKit is much better than not being able to fix it at
all.  Giving a better experience to people using browsers that give me
what I need is better than forcing a broken lowest-common-denominator
on everyone.

--

-- 
Glenn Maynard

Boris Zbarsky | 1 Jan 2011 05:01
Picon
Favicon

Re: Low Memory Event

On 12/31/10 7:35 PM, Charles Pritchard wrote:
> If I were to receive an event, letting me know a low memory condition
> exists

In many cases the only way a browser can determine that such a condition 
exists is by trying to allocate memory and having the allocation fail. 
At which point... it's out of memory.  It doesn't have memory to 
allocate the event object, much less to run your script.

There are various ways to try to work around this by trying to 
pre-reserve a memory pool, but they're not very reliable.  I suggest 
reading the pretty extensive discussions on this topic in Mozilla's 
bugzilla and on the various Mozilla mailing lists over the last several 
years.

> I'd drop most of my buffers
> immediately, allowing for the machine and my application to carry on
> normally, a little while longer.

"drop most of my buffers" means you stop referencing them.  They don't 
get deallocated until garbage collection happens.  Garbage collection 
can require memory to perform.  In the case of Gecko, collecting 
canvases in fact requires a cycle-collection algorithm to run, which has 
to build a graph representing the current reference graph.  It's a 
fairly memory-hungry algorithm.

So by the time you're out of memory, doing this is too late.  It won't work.

 > The downside is that there'd be another word in the
> large vocabulary of HTML/DOM events.

And significantly greater implementation complexity for browsers if they 
try to make it work.  And it still wouldn't work.

> The usefulness has already been proven by iOS applications. We can work
> with low memory events there.

iOS may well provide useful low memory notifications to applications. 
Other OSes do not.  You find out about low memory when your allocation 
fails if you're lucky or when the kernel sends you a SIGKILL (Linux, I'm 
looking at you).

> I'd like to be able to listen for them on the desktop as well.

Then get desktop OS vendors to give applications a way to detect low 
memory reliably.

-Boris

Benjamin Hawkes-Lewis | 1 Jan 2011 08:12

Re: Exposing spelling/grammar suggestions in contentEditable

On Sat, Jan 1, 2011 at 1:23 AM, Charles Pritchard <chuck@...> wrote:
> It is covered by the WAI ARIA 1.0 LC doc.

Note this usage is waiting on a putative change to WAI-ARIA to define
its meaning when used with roles other than gridcell/option/row/tab.

http://www.w3.org/WAI/PF/aria/states_and_properties#aria-selected

--
Benjamin Hawkes-Lewis

Benjamin Hawkes-Lewis | 1 Jan 2011 08:18

Re: Submitting form question

On Thu, Dec 30, 2010 at 9:09 PM, Aryeh Gregor
<Simetrical+w3c@...> wrote:
> On Thu, Dec 30, 2010 at 9:06 AM,  <Yael.Aharon@...> wrote:
>> When submitting a form, whose method is "GET" and action is identical to the
>> current location, except for the fragment, should that trigger reloading the
>> page, or simply navigating to the fragment?
>
> As I'm reading the spec, you're doing "Mutate action" in step 19 here:
>
> http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#form-submission-algorithm
>
> Then in the navigation algorithm, step 7 says you just navigate to the
> new fragment and don't reload the page:
>
> http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#navigate
>
>> The background for my question is in the analysis done in
>> <          >
>
> Your conclusion appears to match mine, if I'm reading you right.
> HTML5 is confusing sometimes, but it sure is precise.
>

--

-- 
--
Benjamin Hawkes-Lewis

Benjamin Hawkes-Lewis | 1 Jan 2011 09:23

Re: Exposing spelling/grammar suggestions in contentEditable

On Sat, Jan 1, 2011 at 7:12 AM, Benjamin Hawkes-Lewis
<bhawkeslewis@...> wrote:
> On Sat, Jan 1, 2011 at 1:23 AM, Charles Pritchard <chuck@...> wrote:
>> It is covered by the WAI ARIA 1.0 LC doc.
>
> Note this usage is waiting on a putative change to WAI-ARIA to define
> its meaning when used with roles other than gridcell/option/row/tab.
>
> http://www.w3.org/WAI/PF/aria/states_and_properties#aria-selected

Sorry for the noise - as was pointed out to me off-list, OP was
referring to aria-invalid which doesn't have this problem.

--
Benjamin Hawkes-Lewis

Ian Hickson | 1 Jan 2011 09:44
Picon

Re: window.open question...

On Mon, 27 Sep 2010, Biju wrote:
>
> Question, whether html5 spec is specific about behavior for steps at...
> https://bugzilla.mozilla.org/show_bug.cgi?id=197709#c0
> 
> See also https://bugzilla.mozilla.org/show_bug.cgi?id=197709#c3
> 
> I dont see HTML5 is specific about it at
> http://www.w3.org/TR/html5/browsers.html#dom-open
> http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#dom-open
> 
> So I think that Firefox bug report is invalid, but want to confirm....

As far as I can tell the HTML spec defines all this. See the "navigate" 
algorithm for details on what happens when a page loads, including when a 
new Window object is created:

   http://www.whatwg.org/specs/web-apps/current-work/complete.html#navigate

Note in particular the exception listed under "creating a new Document 
object", which may be relevant here.

--

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


Gmane