From: Garrett Smith on
David Mark wrote:
> Garrett Smith wrote:
>> David Mark wrote:
>>> Garrett Smith wrote:
>>>> Stefan Weiss wrote:
>>>>> On 10/05/10 02:14, David Mark wrote:

[...]

>> Function calls won't normally trigger a repaint, though.
>
> Googled: "opera reflow repaint"
>
> First hit:
>
> http://dev.opera.com/articles/view/efficient-javascript/?page=3
>

Does it say something there about repaint when exiting an execution
context? I didn't see any such claims there.

> I remember figuring this out (boosted by some anecdotal evidence I'm
> sure) in IE and FF around the turn of the century. But this is the only
> formal treatment of the subject that I know of. It's definitely not
> just about timeouts and intervals. Exiting the execution context is
> what _can_ trigger an (often unwanted/unneeded) repaint.
>
> You should sign up for my support service (meaning everyone). :)

Can you show an example where exiting an execution context causes repaint?
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/
From: David Mark on
David Mark wrote:
> Garrett Smith wrote:
>> David Mark wrote:
>>> Garrett Smith wrote:
>>>> Stefan Weiss wrote:
>>>>> On 10/05/10 02:14, David Mark wrote:
>>>>>> Browsers re-flow on exiting execution contexts. The
>>>>>> second set allows for up to five re-flows. The first set allows for
>>>>>> none. Re-flows are often expensive (not to mention ugly), so
>>>>>> should be
>>>>>> minimized.
>>>>> I've heard as much, but I haven't seen any official statements to that
>>>>> effect. How do you know that *all* browsers do this, or even the
>>>>> "current" ones (for user defined values of "current")? I know for a
>>>>> fact
>>>>> that the ones I've tested don't trigger a *redraw* when an execution
>>>>> context is exited, but it's impossible to test when a reflow is
>>>>> triggered. It's a bit like quantum mechanics - as soon as you measure
>>>>> it, you're changing the outcome :)
>>>>>
>>>>>
>>>> alert and resizeTo/resizeBy will trigger a repaint. Not sure about
>>>> scrolTo/By, but probably.
>>>>
>>>> DUnno about the other stuff David Mark is talking about.
>>> Really? Well, I'll direct you to search either this archive or the
>>> Opera site (or talk to anyone who has ever had to deal with animations
>>> in browsers).
>> Oh yeah, and setTimeout and setInterval calls.
>>
>> Function calls won't normally trigger a repaint, though.
>
> Googled: "opera reflow repaint"
>
> First hit:
>
> http://dev.opera.com/articles/view/efficient-javascript/?page=3
>
> I remember figuring this out (boosted by some anecdotal evidence I'm
> sure) in IE and FF around the turn of the century. But this is the only
> formal treatment of the subject that I know of. It's definitely not
> just about timeouts and intervals. Exiting the execution context is
> what _can_ trigger an (often unwanted/unneeded) repaint.
>
> You should sign up for my support service (meaning everyone). :)

Seriously. I can't monitor this group 24/7, let alone answer every
question in a timely fashion (or at all sometimes as I often get tired
of Usenet and abandon it for a spell). When it comes to
language-related questions, there are tons of people (some more advanced
that I will ever care to be) in here who can give good answers (though
they don't always do so in a timely or succinct fashion). But when it
comes to the tough cross-browser scripting issues, the voices of reason
are few and far between. Guaranteed 24 hour turnaround. $100 (US) per
month whether you ask 1 question or a 100 (they have to be brief and to
the point questions of course). Best to sign up during the design stage
of a project, before you paint (no pun intended) yourself into a corner.
The answers are often simple, but finding them on the Web (or even in
here) is for masochists (who have lots of free time to burn).

Just got the artwork order back from the graphics designer. The new
cinsoft.net will go live in the next week or two with all of the details
(and testimonials from those who are already enrolled and loving it).
From: David Mark on
Garrett Smith wrote:
> David Mark wrote:
>> Garrett Smith wrote:
>>> David Mark wrote:
>>>> Garrett Smith wrote:
>>>>> Stefan Weiss wrote:
>>>>>> On 10/05/10 02:14, David Mark wrote:
>
> [...]
>
>>> Function calls won't normally trigger a repaint, though.
>>
>> Googled: "opera reflow repaint"
>>
>> First hit:
>>
>> http://dev.opera.com/articles/view/efficient-javascript/?page=3
>>
>
> Does it say something there about repaint when exiting an execution
> context? I didn't see any such claims there.

They called it something else IIRC (a "thread" of some sort).

>
>> I remember figuring this out (boosted by some anecdotal evidence I'm
>> sure) in IE and FF around the turn of the century. But this is the only
>> formal treatment of the subject that I know of. It's definitely not
>> just about timeouts and intervals. Exiting the execution context is
>> what _can_ trigger an (often unwanted/unneeded) repaint.
>>
>> You should sign up for my support service (meaning everyone). :)
>
> Can you show an example where exiting an execution context causes repaint?

Yes, but I haven't seen your check yet. Otherwise, you are on your own
with this. Hint: for the second time, search the archive. We've been
over this and I'm hardly the only one familiar with this "phenomenon".
Just so happens I am the only one posting about it right this second.
See how that works?
From: David Mark on
David Mark wrote:
> Garrett Smith wrote:
>> David Mark wrote:
>>> Garrett Smith wrote:
>>>> David Mark wrote:
>>>>> Garrett Smith wrote:
>>>>>> Stefan Weiss wrote:
>>>>>>> On 10/05/10 02:14, David Mark wrote:
>> [...]
>>
>>>> Function calls won't normally trigger a repaint, though.
>>> Googled: "opera reflow repaint"
>>>
>>> First hit:
>>>
>>> http://dev.opera.com/articles/view/efficient-javascript/?page=3
>>>
>> Does it say something there about repaint when exiting an execution
>> context? I didn't see any such claims there.
>
> They called it something else IIRC (a "thread" of some sort).
>

Re-reading what they said, it seems they aren't very clear about this
specific issue. By "thread", they are not referring to an execution
context. But they qualify that with assertions about when they might
repaint _before_ the "thread" has ended. From experience (with Opera as
well as many other browsers), I can tell you that on exiting execution
contexts, they make a decision to repaint at that time or wait for the
next such occurrence.

Better for you to do some experimentation on your own (with more than
just Opera of course). Slower PC's/devices are usually better
candidates for such demonstrations. YMMV.

Or you could just listen to me for once. My experience invariably ends
up trumping fruitless documentation searches in such matters (as you
have found out numerous times over the years). For example, we didn't
have any documentation about the relationship between ActiveX and
"unknown" types until very recently, did we? And that documentation
confirmed exactly what I had been saying for years (and that you
attempted to contradict just a month or two ago). The browser
developers don't publish everything (and what they do is often years too
late to be helpful).
From: Garrett Smith on
David Mark wrote:
> David Mark wrote:
>> Garrett Smith wrote:
>>> David Mark wrote:
>>>> Garrett Smith wrote:
>>>>> David Mark wrote:
>>>>>> Garrett Smith wrote:
>>>>>>> Stefan Weiss wrote:
>>>>>>>> On 10/05/10 02:14, David Mark wrote:
>>> [...]
>>>
>>>>> Function calls won't normally trigger a repaint, though.
>>>> Googled: "opera reflow repaint"
>>>>
>>>> First hit:
>>>>
>>>> http://dev.opera.com/articles/view/efficient-javascript/?page=3
>>>>
>>> Does it say something there about repaint when exiting an execution
>>> context? I didn't see any such claims there.
>> They called it something else IIRC (a "thread" of some sort).

IIRC? If you recall? It's an article *you* posted.

I get that you don't like reading documentation.

The article, however, hardly qualifies as documentation. If you'd read
any, ever, you'd know that, but you've made it clear that don't read
documentation. And again, calling it "fruitless".

>>
>
> Re-reading what they said, it seems they aren't very clear about this
> specific issue. By "thread", they are not referring to an execution
> context. But they qualify that with assertions about when they might
> repaint _before_ the "thread" has ended. From experience (with Opera as
> well as many other browsers), I can tell you that on exiting execution
> contexts, they make a decision to repaint at that time or wait for the
> next such occurrence.
>
Claiming that a browser makes a decision to repaint when exiting an
execution context is certainly different from claiming that the browser
repaints when exiting an execution context.

Execution stack, is probably what was meant by "thread" in that article.

I see no evidence that shows that browsers will repaint when exiting an
execution context normally. Execution stack, yes, but execution context?
No.

> Better for you to do some experimentation on your own (with more than
> just Opera of course). Slower PC's/devices are usually better
> candidates for such demonstrations. YMMV.
>
> Or you could just listen to me for once. My experience invariably ends
> up trumping fruitless documentation searches in such matters (as you
> have found out numerous times over the years). For example, we didn't
> have any documentation about the relationship between ActiveX and
> "unknown" types until very recently, did we? And that documentation
> confirmed exactly what I had been saying for years (and that you
> attempted to contradict just a month or two ago). The browser
> developers don't publish everything (and what they do is often years too
> late to be helpful).


There was a long standing correlation with ActiveX throwing errors for
"unknown" types. MS-ES3 documentation explained that it was not only
correlation, but causation.

The article you linked didn't back up the claims that the browser will
repaint when exiting an execution context. So far there isn't any
evidence to back up the claim.
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/