From: David Mark on
On Jul 19, 1:51 am, Ry Nohryb <jo...(a)jorgechamorro.com> wrote:
> On Jul 18, 8:18 am, Garrett Smith <dhtmlkitc...(a)gmail.com> wrote:
>
>
>
> > The name "repaint" has the outward indication of a mystical incantation..
> > We know that there is no way to force a repaint, and so when I see a
> > name like that, I know that the method won't directly cause the browser
> > to repaint and that it will, at best, perform an unrelated action that
> > was associated with addressing a perceived problem.
>
> You're mistaken, again, Garrett.
> Yes, there are ways to force both reflows and repaints.
> For example, this (google groups) page can be forced to repaint with:
>
> document.body.style.opacity= 0;
> setTimeout(function(){document.body.style.opacity= 1},0);
>
> Or with:
> document.body.style.visibility= "hidden";
> setTimeout(function(){document.body.style.visibility= ""},0);
>
> And to reflow (+ repaint):
> document.body.style.maxWidth= "50px";
> setTimeout(function(){document.body.style.maxWidth= ""},0);
>
> HTH,

It doesn't. This oversimplification of the issue was covered earlier
in the thread (just a few hours ago). Of course you can cause the
document to reflow/repaint if you change its style and exit an
execution context (though it may not happen immediately). The
question is why you would need to do that with the styling equivalent
of a no-op. The answer is that you wouldn't unless you were stuck and
resorting to programming by mystical incantation.

Please read before posting next time. Thanks!
From: Garrett Smith on
On 2010-07-18 10:51 PM, Ry Nohryb wrote:
> On Jul 18, 8:18 am, Garrett Smith<dhtmlkitc...(a)gmail.com> wrote:
>>
>> The name "repaint" has the outward indication of a mystical incantation.
>> We know that there is no way to force a repaint, and so when I see a
>> name like that, I know that the method won't directly cause the browser
>> to repaint and that it will, at best, perform an unrelated action that
>> was associated with addressing a perceived problem.
>>
>
> You're mistaken, again, Garrett.

Did you need more explanation, after all that I have explained to you
already?

> Yes, there are ways to force both reflows and repaints.

If that is true, you have not proven it.

> For example, this (google groups) page can be forced to repaint with:
>

No, it cannot. About the best you can do is hope that the browser will
repaint.

So you've made observations of what happened in the browser and
concluded that those observations are premises for causality, huh?

That is a classic Post hoc ergo propter hoc fallacy. I saw B after A.
Therefore, A causes B. (fallacious).

[snip]

That code proves nothing at all. Where is the specification (or even
browser documentation) for "how to repaint"? There is none, is there?

>
> HTH,

It does not. The browser will repaint when it needs to.

Repaint issues are not new to me. I have dealt with them many years ago
when the then popular hacks included such things as modifying the status
bar and even resizing the window.

resizeBy(0, 1);
resizeBy(0, -1);

(!)
Voodoo.
--
Garrett
From: Ry Nohryb on
On Jul 19, 8:25 am, David Mark <dmark.cins...(a)gmail.com> wrote:
> (...) The
> question is why you would need to do that with the styling equivalent
> of a no-op.  The answer is that you wouldn't unless you were stuck and
> resorting to programming by mystical incantation.

I always read before posting: it was a reply to Garrett's assertion
"We know that there is no way to force a repaint", which is -plainly-
false. See:

"Faster HTML and CSS: Layout Engine Internals for Web Developers",
David Baron.
http://www.youtube.com/v/a2_6bGNZ7bA

>
> Please read before posting next time.  Thanks!

You're welcome.
--
Jorge.
From: David Mark on
On Jul 19, 3:12 am, Ry Nohryb <jo...(a)jorgechamorro.com> wrote:
> On Jul 19, 8:25 am, David Mark <dmark.cins...(a)gmail.com> wrote:
>
> > (...) The
> > question is why you would need to do that with the styling equivalent
> > of a no-op.  The answer is that you wouldn't unless you were stuck and
> > resorting to programming by mystical incantation.
>
> I always read before posting: it was a reply to Garrett's assertion
> "We know that there is no way to force a repaint", which is -plainly-
> false.

Which was pointless.

> See:
>
> "Faster HTML and CSS: Layout Engine Internals for Web Developers",
> David Baron.http://www.youtube.com/v/a2_6bGNZ7bA
>

As is that. You are your videos. :(
From: Ry Nohryb on
On Jul 19, 9:04 am, Garrett Smith <dhtmlkitc...(a)gmail.com> wrote:
> On 2010-07-18 10:51 PM, Ry Nohryb wrote:
> (...)
>
> > For example, this (google groups) page can be forced to repaint with:
>
> No, it cannot. About the best you can do is hope that the browser will
> repaint.
>
> So you've made observations of what happened in the browser and
> concluded that those observations are premises for causality, huh?
> (...)

What I said is not based on any "mystical incantation" but on what the
author of Mozilla's rendering engine explains in this video:

"Faster HTML and CSS: Layout Engine Internals for Web Developers",
David Baron.
http://www.youtube.com/v/a2_6bGNZ7bA

Obviously you too (I told Mark already) ought to see it in order to
learn the fundamentals of the inner workings of rendering engines, and
once you begin to see through the black box, you (and Mark) will be
able to stop thinking about it any more in terms of mystical
incantations.

HTH,
--
Jorge.