Closed Bug 616884 Opened 14 years ago Closed 14 years ago

plugins shown when we don't want them to be on Linux

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: tnikkel, Assigned: tnikkel)

Details

Attachments

(3 files, 2 obsolete files)

This causes some ugly artifacts during page transition. I have a fix.
nsObjectFrame::CreateWidget creates the plugin widget with bounds (0,0,0,0). Then in nsPluginInstanceOwner::CreateWidget we initially place the plugin widget at 0,0 with the correct size and empty clip region (nothing shown, everything clipped out). But in nsWindow::SetWindowClipRegion we exit early because the existing clip region appears to be the same as the new region, because the existing clip region is zero width and height because it is the whole widget rect which hasn't been updated yet since nsObjectFrame::CreateWidget created it as (0,0,0,0).

When going back to a page with a plugin (maybe not all plugins) this creates a short period of time where a rect at (0,0,plugin width,plugin height) has the old page contents but the rest is the new page.
If we haven't set a clip yet on the window we should not exit early if the existing and new regions are equal.
Assignee: nobody → tnikkel
Attachment #496009 - Flags: review?(roc)
Part 1 alone fixes the bug I was seeing.
In the case I was debugging we created the plugin widget from an action triggered by nsObjectFrame::DidReflow. So in nsPluginInstanceOwner::CreateWidget we should try to use the position of the object frame instead of just putting the widget at 0,0.

Without part 1 this improves the bug I was seeing by making the artifact be where the plugin is. But with part 1 this doesn't fix any problems that I've seen.
Attachment #496012 - Flags: review?(roc)
Attachment #496012 - Attachment description: Part 2. → Part 2. Use the position of the object frame instead of 0,0.
While looking at this code I noticed something on Windows.

nsWindow::SetWindowClipRegion doesn't store the new rects if it is asked to intersect with the existing clip. Since we only use this function by calling it with intersect = true following by intersect = false in ConfigureChildren I think that this cannot cause anything to go wrong. So if we don't take this and there isn't a good reason for the existing behaviour we should probably add a comment mentioning this in the code.
Attachment #496016 - Flags: review?(roc)
Attachment #496016 - Attachment description: Part 3. → Part 3. Always store the clip rects on Windows.
Comment on attachment 496016 [details] [diff] [review]
Part 3. Always store the clip rects on Windows.

I think we should just add the comment.
Attachment #496016 - Flags: review?(roc) → review-
Ok, I will land this comment addition instead of part 3.
Attachment #496016 - Attachment is obsolete: true
Attachment #496009 - Flags: approval2.0?
Attachment #496012 - Flags: approval2.0?
I think we should add a comment saying if you call it with TRUE for the intersect parameter then you should call it with FALSE soon afterwards because it doesn't updated the stored region.
Ok.
Attachment #496066 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: