David said:
Garrett said:
David said:
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:
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.
[...]
Oh yeah, and setTimeout and setInterval calls.
Function calls won't normally trigger a repaint, though.
You have completely missed the point. The lack of function calls
between DOM manipulations ensures that they will _not_ be triggered.
And often they are triggered on exiting execution contexts,
Then it should not be that hard to produce an example demonstrating that
phenomenon.
No, it shouldn't. I can produce one that is visible on _my_ PC with no
trouble. What's your problem?
Said the Jehova's witness.
Where?
Did you see a problem that nobody else saw? Why not share it with the
group and show us about it? It is certainly interesting and on-topic
material for this NG and thread (in contrast to the ads for your support
services)
I think it is. And you are the only one asking about it at this point.
It is unsurprising that nobody is complaining about the nothing not
being solved.
Just because nobody is willing to tell you you are wrong does not mean
that you have provided evidence to your claims.
Are you playing dumb or what? And I noticed you've translated the
terminology (e.g. exiting => completing). So, I think you know that
when you call a function, you exit one context and enter another.
Would you rather use the term exiting?
Exiting an execution context? OK. So I think you mean that given:
div.style.color = "red";
// func();
div.style.position = "absolute";
- that if line two "func()" is uncommented, then the browser might
repaint, but if it isn't then that won't happen.
The cases where I know that is true is with alert, scrollTo/By, etc as
mentioned. I also recall seeing flickering issues, though it was
actually within one function call. It was something along the lines of:
el.style.visibility = "visible";
el.style.top = t + "px";
el.style.left = l + "px";
- and in an old version of Mozilla, the menu would be shown momentarily
out of place and snap into place.
If you are able to try an old version of Mozilla, around 1.0, see:
http://brainjar.com/dhtml/menubar/demo.html
- and you may notice the described behavior.
Right? That's when updates _can_ happen. As Opera said, there are a
number of considerations it uses to determine when to do them. It does
_not_ necessarily wait until the end of the call stack. You can put
_that_ in the bank. And how could you not know this at this point? We
just had this discussion a couple of months back. Did you search the
archive as I asked?
I vaguely recall the notion of repainting was presented without much
evidence and instead of picking it up, I did something else.
Put two PC's of varying performance side by side and one may have a
noticeable update while the other may not. It depends on far too many
variables to predict. So concentrate on the abstraction, rather than
observations. It's served me well for many years (primarily by knowing
that if I need for updates to happen all at once, I need to avoid
exiting the execution context).
You are describing undocumented behavior with no example.
You are applying the reaction of that behavior in a way that may
adversely affect API design. It is as if you are prioritizing API design
around undocumented peculiarities rather than logical organization of
what needs to go where.
A function that sets innerHTML is not as clear or efficient as setting
innerHTML directly and it requires organizing that function so that it
is a "static" method as a property of something. That is the reason for
not creating such function. Not: The browser will repaint. The browser
won't repaint then and if it does it is making a bad choice.