Bug 580160. Test plugin needs to invalidate itself if its size changes. r=josh

This commit is contained in:
Robert O'Callahan 2010-08-02 15:07:07 +12:00
parent d434e271cb
commit bb197a6e72
4 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,6 @@
<!DOCTYPE HTML>
<html>
<body>
<embed type="application/x-test" style="width:200px; height:400px;"></embed>
</body>
</html>

View File

@ -0,0 +1,15 @@
<!DOCTYPE HTML>
<html class="reftest-wait">
<body>
<embed type="application/x-test" id="p"
style="position:fixed; width:200px; height:200px;"></embed>
<script>
var p = document.getElementById("p");
function doTest() {
p.style.height = "400px";
document.documentElement.removeAttribute("class");
}
window.addEventListener("MozReftestInvalidate", doTest, false);
</script>
</body>
</html>

View File

@ -1459,5 +1459,6 @@ random-if(!haveTestPlugin) == 546071-1.html 546071-1-ref.html
== 571347-3.html 571347-3-ref.html
== 572598-1.html 572598-ref.html
== 574898-1.html 574898-ref.html
== 580160-1.html 580160-1-ref.html
== 579349-1.html 579349-1-ref.html
== 581317-1.html 581317-1-ref.html

View File

@ -939,6 +939,17 @@ NPError
NPP_SetWindow(NPP instance, NPWindow* window)
{
InstanceData* instanceData = (InstanceData*)(instance->pdata);
if (instanceData->scriptableObject->drawMode == DM_DEFAULT &&
(instanceData->window.width != window->width ||
instanceData->window.height != window->height)) {
NPRect r;
r.left = r.top = 0;
r.right = window->width;
r.bottom = window->height;
NPN_InvalidateRect(instance, &r);
}
void* oldWindow = instanceData->window.window;
pluginDoSetWindow(instanceData, window);
if (instanceData->hasWidget && oldWindow != instanceData->window.window) {