Bug 93314 - DRT to dump text and pixels even if page is not fully loaded
Summary: DRT to dump text and pixels even if page is not fully loaded
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-06 18:00 PDT by Hin-Chung Lam
Modified: 2012-08-08 14:58 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hin-Chung Lam 2012-08-06 18:00:48 PDT
DRT waits until images are loaded before it exits and dump text and pixels. Even if the test has waitUntilDone() and notifyDone(). This prevents pixel tests for partially loaded images. Extend DRT to exit immediately with similar to notifyDone(bool waitUntilLoaded = false).
Comment 1 Tony Chang 2012-08-06 18:44:53 PDT
What happens if a partially loaded image is incomplete?  Could we just write a php script that sends part of an image and then disconnects?
Comment 2 Hin-Chung Lam 2012-08-07 11:55:00 PDT
It a partially loaded image is incomplete, e.g. connection is broken during load the image can be broken.

The broken image can be rendered in two forms. Either with a broken image icon, or format specific decoder (like jpeg) will try to decode and fill the rest with a solid color. Both of these are not what we want.

The expected rendering result is the incomplete part becomes transparent. This should be tested on all platforms including gpu accelerated path.

I wrote a test with video-load-and-stall.cgi to simulate network loading behavior but because DRT has to wait for images to be "loaded" the test times out.
Comment 3 Dongseong Hwang 2012-08-07 20:01:48 PDT
(In reply to comment #2)
> The expected rendering result is the incomplete part becomes transparent. 

I understand now why you filed this bug.

> This should be tested on all platforms including gpu accelerated path.

Currently, gpu accelerated path has different policy between <image> and <div> including <image>.

In <image> case, gpu does not render image until image is loaded completely.

void RenderLayerBacking::updateImageContents()
{
    ...
    // We have to wait until the image is fully loaded before setting it on the layer.
    if (!cachedImage->isLoaded())
        return;

    // This is a no-op if the layer doesn't have an inner layer for the image.
    m_graphicsLayer->setContentsToImage(image);
    ....
}

However, in <div> including <image> case, gpu renders <image> via RenderLayerBacking::paintContents() even if the image is not loaded completely.

> I wrote a test with video-load-and-stall.cgi to simulate network loading behavior but because DRT has to wait for images to be "loaded" the test times out.

Very good!!
Comment 4 Hin-Chung Lam 2012-08-08 09:05:59 PDT
> 
> In <image> case, gpu does not render image until image is loaded completely.
> 
> void RenderLayerBacking::updateImageContents()
> {
>     ...
>     // We have to wait until the image is fully loaded before setting it on the layer.
>     if (!cachedImage->isLoaded())
>         return;
> 
>     // This is a no-op if the layer doesn't have an inner layer for the image.
>     m_graphicsLayer->setContentsToImage(image);
>     ....
> }
> 
> However, in <div> including <image> case, gpu renders <image> via RenderLayerBacking::paintContents() even if the image is not loaded completely.
> 

This code path is rare. Only if a <img> is accelerated composited that this code path will be used, e.g. 3D CSS on the element.
Comment 5 Hin-Chung Lam 2012-08-08 14:58:00 PDT
Closing this bug. I have found a way to write layout test without having to change DRT. Will upload the test case soon.