David said:
That is not exactly what it means. It means that nothing will happen
when - for example - you click whatever UI element is presenting that
cursor (e.g. a window). It's as if you didn't click at all.
ISTM you are confusing the issue. From previous UI experience, when *I* see
an hourglass pointer, I assume that I need to wait, i.e. better not do
anything else, including clicking (YMMV). Therefore, I presume to signal
just that is what was intended here. Nothing more, nothing less.
Click and what don't they have to do with the pointer cursor?
OK, so clicks are (perhaps) discarded. Isn't that what the hourglass (or
whatever)-shaped wait cursor is supposed to mean, to signal to the user?
And clicks have nothing to do with shape of the pointer cursor, of course.
But the hourglass (or whatever shape the OS is set to use) is not
appropriate to indicate that clicks will be queued up during the
delay. You might use the hourglass/pointer hybrid for this in a
desktop app.
Usually yes, but it would depend on the use-case.
In a script, you let the browser/OS handle that.
AISB, the runtime environment cannot recognize that a single-threaded script
is going to take longer than expected until it is too late (and a warning
should be and is issued in some environments, e.g. Gecko); the halting
problem is still undecidable.
However, the script itself can cause the cursor change -- to whatever shape
appears be to appropriate for the task, including the hourglass/pointer
hybrid shape you are talking about, with the "progress" property value -- to
be performed in another DOM thread than the time-consuming part.[1]
BTW, the value for the property reset should be either "" or "auto", not
"default".
I beg your pardon?
PointedEars
___________
[1] As for the DOM thread notion, I think I found the that confirmed for
at least Gecko 1.9.2-based browsers (CMIIW), where in
<
http://mxr.mozilla.org/mozilla1.9.2/source/dom/src/threads/nsDOMWorker.cpp>
I found (line numbers included from copypaste):
68 class nsDOMWorkerFunctions
69 {
....
75 // Same as window.setTimeout().
76 static JSBool SetTimeout(JSContext* aCx, JSObject* aObj, uintN aArgc,
77 jsval* aArgv, jsval* aRval) {
78 return MakeTimeout(aCx, aObj, aArgc, aArgv, aRval, PR_FALSE);
79 }
80
81 // Same as window.setInterval().
82 static JSBool SetInterval(JSContext* aCx, JSObject* aObj, uintN aArgc,
83 jsval* aArgv, jsval* aRval) {
84 return MakeTimeout(aCx, aObj, aArgc, aArgv, aRval, PR_TRUE);
85 }
....
100 private:
101 // Internal helper for SetTimeout and SetInterval.
102 static JSBool MakeTimeout(JSContext* aCx, JSObject* aObj, uintN aArgc,
103 jsval* aArgv, jsval* aRval,
PRBool aIsInterval);
....
126 JSBool
127 nsDOMWorkerFunctions::MakeTimeout(JSContext* aCx,
128 JSObject* /* aObj */,
129 uintN aArgc,
130 jsval* aArgv,
131 jsval* aRval,
132 PRBool aIsInterval)
133 {
134 nsDOMWorker* worker =
static_cast<nsDOMWorker*>(JS_GetContextPrivate(aCx));
135 NS_ASSERTION(worker, "This should be set by the DOM thread service!");
136
137 if (worker->IsCanceled()) {
138 return JS_FALSE;
139 }
140
141 PRUint32 id = worker->NextTimeoutId();
142
143 if (worker->IsClosing()) {
144 // Timeouts won't run in the close handler, fake success and bail.
145 *aRval = INT_TO_JSVAL(id);
146 return JS_TRUE;
147 }
148
149 nsRefPtr<nsDOMWorkerTimeout> timeout =
new nsDOMWorkerTimeout(worker, id);
150 if (!timeout) {
151 JS_ReportOutOfMemory(aCx);
152 return JS_FALSE;
153 }
154
155 nsresult rv = timeout->Init(aCx, aArgc, aArgv, aIsInterval);
156 if (NS_FAILED(rv)) {
157 JS_ReportError(aCx, "Failed to initialize timeout!");
158 return JS_FALSE;
159 }
160
161 rv = worker->AddFeature(timeout, aCx);
162 if (NS_FAILED(rv)) {
163 JS_ReportOutOfMemory(aCx);
164 return JS_FALSE;
165 }
166
167 rv = timeout->Start();
168 if (NS_FAILED(rv)) {
169 JS_ReportError(aCx, "Failed to start timeout!");
170 return JS_FALSE;
171 }
172
173 *aRval = INT_TO_JSVAL(id);
174 return JS_TRUE;
175 }
....
401 JSFunctionSpec gDOMWorkerFunctions[] = {
402 { "dump", nsDOMWorkerFunctions:

ump, 1,
0, 0 },
403 { "setTimeout", nsDOMWorkerFunctions::SetTimeout, 1,
0, 0 },
404 { "clearTimeout", nsDOMWorkerFunctions::KillTimeout, 1,
0, 0 },
405 { "setInterval", nsDOMWorkerFunctions::SetInterval, 1,
0, 0 },
406 { "clearInterval", nsDOMWorkerFunctions::KillTimeout, 1,
0, 0 },
407 { "importScripts", nsDOMWorkerFunctions::LoadScripts, 1,
0, 0 },
408 { "XMLHttpRequest", nsDOMWorkerFunctions::NewXMLHttpRequest, 0,
0, 0 },
409 { "Worker", nsDOMWorkerFunctions::NewWorker, 1,
0, 0 },
410 #ifdef MOZ_SHARK
411 { "startShark", js_StartShark, 0,
0, 0 },
412 { "stopShark", js_StopShark, 0,
0, 0 },
413 { "connectShark", js_ConnectShark, 0,
0, 0 },
414 { "disconnectShark", js_DisconnectShark, 0,
0, 0 },
415 #endif
416 { nsnull, nsnull, 0,
0, 0 }
417 };