Received: by 10.68.231.135 with SMTP id tg7mr2498572pbc.2.1348859179779; Fri, 28 Sep 2012 12:06:19 -0700 (PDT) X-BeenThere: google-chrome-developer-tools@googlegroups.com Received: by 10.68.141.133 with SMTP id ro5ls15553153pbb.1.gmail; Fri, 28 Sep 2012 12:06:19 -0700 (PDT) Received: by 10.68.229.231 with SMTP id st7mr2596860pbc.2.1348859179072; Fri, 28 Sep 2012 12:06:19 -0700 (PDT) Date: Fri, 28 Sep 2012 12:06:18 -0700 (PDT) From: Samar To: google-chrome-developer-tools@googlegroups.com Cc: Samar Message-Id: <805cf58c-9e41-4e57-9add-4a3af4135ac9@googlegroups.com> In-Reply-To: References: <205bd044-cd37-4274-8f78-c6cb547baeca@googlegroups.com> Subject: Re: [Chrome DevTools] Paint event before DOM Ready MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_587_5397391.1348859178684" ------=_Part_587_5397391.1348859178684 Content-Type: multipart/alternative; boundary="----=_Part_588_16329811.1348859178684" ------=_Part_588_16329811.1348859178684 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks, That was helpful. I'll do some homework and come up again with more questions. On Thursday, September 27, 2012 5:55:30 PM UTC+5:30, PhistucK wrote: > > External scripts and style sheets are blocking the HTML rendering until= =20 > they are downloaded, parsed and executed. > > So, adding the async=3D"async" (or maybe defer=3D"defer" can also help, I= =20 > forget) attribute to external scripts should make them not block the=20 > rendering. > > External style sheets must be added dynamically (using JavaScript) in=20 > order not to block rendering, or must be declared below the content (the= =20 > content that you want to show before everything is loaded). > Note that you better have some (basic) inline CSS in the page, or else=20 > everything will show up completely not formatted until the CSS shows us,= =20 > which may be really not nice for the user experience. > > I would guess the first paint is there because the browser parses = =20 > (and such), which is a blank sheet when it does not have any other conten= t. > > =E2=98=86*PhistucK* > > > On Wed, Sep 26, 2012 at 9:15 PM, Samar > > wrote: > >> I also see a paint event in timeline panel which highlights (on hover)= =20 >> all the visible area of webpage. This event is triggered at 1ms, the ver= y=20 >> beginning. Why a paint event is required if no data has been downloaded= =20 >> (Browser has not received any data in just 1ms) > > =20 > On Wed, Sep 26, 2012 at 9:01 PM, Samar >w= rote: > >> Thanks for the explanation. I got it. >> >> I want the browser to start displaying my page (may be just the first=20 >> screen of the full page) as early as possible. Can you point me to some= =20 >> guidelines, article etc regarding how can we trick the browser to start= =20 >> displaying page even if full content (the html itself, css, scripts etc.= )=20 >> are not downloaded completely? >> >> Thanks in advance. >> >> >> On Wednesday, September 26, 2012 11:57:37 PM UTC+5:30, PhistucK wrote: >> >>> The browser starts building the DOM tree before it finishes loading the= =20 >>> whole page (I am talking about the HTML code alone, not the=20 >>> images/resources) and also starts showing. >>> I mean, you sometimes see "half pages" before they are completely=20 >>> loaded, this means the DOM tree is being constructed as it loads, not o= nly=20 >>> when it is completely loaded. >>> (Which explains the pre ready paint events) >>> >>> >>> =E2=98=86*PhistucK* >>> >>> >>> >>> On Wed, Sep 26, 2012 at 8:15 PM, Samar wrote: >>> >>>> My understanding is that after DOM tree is constructed, page starts=20 >>>> rendering and painting, but in timeline panel I can see paint events b= efore=20 >>>> DOM ready events. How is that possible? >>> >>> >>> > ------=_Part_588_16329811.1348859178684 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thanks,
 That was helpful.
 I'll do some homework a= nd come up again with more questions.


On Thursday, September 27,= 2012 5:55:30 PM UTC+5:30, PhistucK wrote:
External scripts and s= tyle sheets are blocking the HTML rendering until they are downloaded, pars= ed and executed.

<= font color=3D"#000000">So, adding the async=3D"async" (or maybe def= er=3D"defer" can also help, I forget) attribute to external scripts = should make them not block the rendering.
<script src= =3D"..." async=3D"async"></script>
External style sheets must be added dynamically (using JavaScript= ) in order not to block rendering, or must be declared below the content (t= he content that you want to show before everything is loaded).
Note that you better have some (basic) inline = CSS in the page, or else everything will show up completely not formatted u= ntil the CSS shows us, which may be really not nice for the user experience= .

= I would guess the first paint is there because the browser parses <html&= gt; (and such), which is a blank sheet when it does not have any other cont= ent.

=E2=98=86PhistucK


On Wed, Sep 26, 2012 at 9:15 PM, Samar <sama...@gmail.com> wrote:
I also see a paint event in timeline panel which highlights (on hover) all&= nbsp;the visible area of webpage. This event is triggered at 1ms, the = very beginning. Why a paint event is required if no data has been downloade= d (Browser has not received any data in just 1ms)
 
On Wed, Sep 26, 2012 at 9:01 PM, Samar <sama...@gmail= .com> wrote:
Thanks for the explanation. I got it.

I want the browser= to start displaying my page (may be just the first screen of the full= page) as early as possible. Can you point me to some guidelines, arti= cle etc regarding how can we trick the browser to start displaying page eve= n if full content (the html itself, css, scripts etc.) are not downloaded c= ompletely?

Thanks in advance.


On= Wednesday, September 26, 2012 11:57:37 PM UTC+5:= 30, PhistucK wrote:
The browser starts building the DOM tree before it fi= nishes loading the whole page (I am talking about the HTML code alone, not = the images/resources) and also starts showing.
I mean, you sometimes see "half pages" before they are completely loade= d, this means the DOM tree is being constructed as it loads, not only when = it is completely loaded.
(Which explains the pre ready paint events)


=E2=98=86PhistucK



On Wed, Sep 26, 20= 12 at 8:15 PM, Samar <sama...@gmail.com>= wrote:
My understanding is that after DOM tree is constructed, page starts renderi= ng and painting, but in timeline panel I can see paint events before DOM re= ady events. How is that possible?


------=_Part_588_16329811.1348859178684-- ------=_Part_587_5397391.1348859178684--