[Webkit-unassigned] [Bug 36361] New: Changing data of <OBJECT> element (PDF) does not refresh content

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 19 05:45:47 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=36361

           Summary: Changing data of <OBJECT> element (PDF) does not
                    refresh content
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: PDF
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: mihnea at adobe.com


Hi,

If i have a <OBJECT> element whose data property is set to a PDF and i change
data to another PDF, the content of <OBJECT> element is not refreshed.

Here is a sample application (without the pdf files, it can be any pdf):
<html>
    <head>
        <script>
        <!--
        var pdfChangeCount = 0;
        function changePDF()
        {
            var objElem = document.getElementById("ID2");
            pdfChangeCount++;
            if (pdfChangeCount %2)
                objElem.data = "resources/Test2.pdf";
            else
                objElem.data = "resources/Test1.pdf";
        }
        -->
        </script>
    </head>
<body>
    <object id="ID2" data="resources/Test1.pdf" type="application/pdf"
width="480px" height="320px"></object>
    <input type="button" value="Change PDF" onclick="changePDF();" />
</body>
</html>    

The first time the page is loaded, it correctly displays Test1.pdf. However,
when i click the button, the data property for the <object> is changed but the
content is not refreshed.
I tested it with latest WebKit on both Win/Mac and Chrome on Win/Mac and it
does not work.
FF 3.6 on Windows correctly refreshes the content.
If the <object> element is an image, then when i change the data to another
image, the content is refreshed correctly.

I saw that in HTMLObjectElement::parseMappedAttribute there is code to load the
new image. 
Should it be changed by adding with something like:
if (renderer() && !isImageType()) {
            toRenderEmbeddedObject(renderer())->updateWidget(true);
        }

when processing the data attribute?

Regards,
Mihnea Ovidenie

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list