Closed Bug 870216 Opened 7 years ago Closed 7 years ago

Acrobat Reader plugin is initially sized larger than its window/frame

Categories

(Core :: Plug-ins, defect)

20 Branch
x86_64
Windows 7
defect
Not set

Tracking

()

VERIFIED FIXED
mozilla24
Tracking Status
firefox20 --- wontfix
firefox21 --- wontfix
firefox22 - wontfix
firefox23 - verified
firefox24 --- verified
firefox-esr17 --- unaffected

People

(Reporter: alice0775, Assigned: johns)

References

()

Details

(Keywords: regression)

Attachments

(4 files)

Attached image screenshot
Build Identifier:
http://hg.mozilla.org/mozilla-central/rev/b980d32c366f
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20130508 Firefox/23.0 ID:20130508031113

Steps to Reproduce:
0. Make sure that Acrobat Reader plugin should open in a tab(i.e. set "Portable Document Format (PDF)" to "Use Adobe Acrobat (in Nightly)" in option)
1. Open pdf

Actual Results:
Missing down arrow of scrollbar
Switching tab will draw the down arrow of scrollbar

Expected Result:
The down arrow of scrollbar should draw properly


Regression window(m-c)
Good:
http://hg.mozilla.org/mozilla-central/rev/8a30e07815ff
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20121214 Firefox/20.0 ID:20121214015122
Bad:
http://hg.mozilla.org/mozilla-central/rev/50d8f411d305
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20121214 Firefox/20.0 ID:20121214072922
Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=8a30e07815ff&tochange=50d8f411d305


Regression window(m-i
Good:
http://hg.mozilla.org/integration/mozilla-inbound/rev/b6d87e6d9a7e
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20121213 Firefox/20.0 ID:20121213130221
Bad:
http://hg.mozilla.org/integration/mozilla-inbound/rev/35e4ec23293c
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20121213 Firefox/20.0 ID:20121213135321
Pushlog:
http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=b6d87e6d9a7e&tochange=35e4ec23293c

Suspected: Bug 767638
It looks like all of adobe reader is slightly taller than its containing window, moving the down arrow and other controls off the screen.

Almost certainly bug 767638. Either we're somehow sending bad SetWindow() parameters, or we changed the order of calls from what acrobat was expecting in some way.
Assignee: nobody → jschoenick
Status: NEW → ASSIGNED
Summary: Acrobat Reader plugin, Missing down arrow of scrollbar → Acrobat Reader plugin is sized larger than its window in full-page mode
Oh, this range actually has two very-similar bug numbers, bug 767638 and bug 767633 that landed at the same time. Both end up changing full-page plugin codepaths substantially :(
Blocks: 767633
Debug builds of the bisect range so we can get debug spew

Bad:
https://tbpl.mozilla.org/?tree=Try&rev=76963765d55b

Good:
https://tbpl.mozilla.org/?tree=Try&rev=536577e8259d
So prior to bug 767633 / bug 767638, we get:

nsNPAPIPluginInstance::SetWindow (about to call it) this=86d4b68
NPP SetWindow called: this=86d4b68, [x=0,y=93,w=978,h=686], clip[t=0,b=0,l=0,r=0], return=0
nsPluginStreamListenerPeer::InitializeFullPage instance=86d4b68
nsNPAPIPluginInstance::SetWindow (about to call it) this=86d4b68
NPP SetWindow called: this=86d4b68, [x=0,y=93,w=978,h=686], clip[t=0,b=0,l=0,r=0], return=0
nsPluginHost::InstantiateFullPagePlugin End mime=application/pdf, rv=0, url=http://www.dmhc.ca.gov/testpage.pdf

Afterwards:

nsNPAPIPluginInstance::SetWindow (about to call it) this=1380bc50
NPP SetWindow called: this=1380bc50, [x=0,y=93,w=978,h=686], clip[t=0,b=0,l=0,r=0], return=0
nsPluginHost::InstantiatePlugin Finished mime=application/pdf, rv=0, url=http://www.dmhc.ca.gov/testpage.pdf
nsPluginStreamListenerPeer::Initialize instance=1380bc50, url=http://www.dmhc.ca.gov/testpage.pdf

So we initialize our plugin stream peer after InstantiatePlugin has finished, and, for some reason, this translates into only calling SetWindow once (seemingly correctly) instead of twice. Adobe reader seems to either expect two SetWindow calls, or expect a SetWindow call after receiving its stream.

This should be pretty easy to add a workaround for
So I was thinking, perhaps, it would be more complicated than this, but no: Adobe Reader doesn't size itself properly after getting just one SetWindow call. It expects two. We used to fire two, for no good reason. This patch makes us fire two for no good reason again. :-/
Attachment #748236 - Flags: review?(joshmoz)
https://tbpl.mozilla.org/?tree=Try&rev=6a5cb1e5394b

This is a pretty safe patch, but, plugins
Not a new regression, so no need to track. Please nominate for uplift if/when this is resolved in a low risk fashion.
Summary: Acrobat Reader plugin is sized larger than its window in full-page mode → Acrobat Reader plugin is initially sized larger than its window/frame
Attachment #748236 - Flags: review?(joshmoz) → review+
Comment on attachment 748236 [details] [diff] [review]
Fire SetWindow on plugins twice to make Adobe Reader happy

https://hg.mozilla.org/integration/mozilla-inbound/rev/5fdf32b0b0e9
Attachment #748236 - Flags: checkin+
https://hg.mozilla.org/mozilla-central/rev/5fdf32b0b0e9
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Comment on attachment 748236 [details] [diff] [review]
Fire SetWindow on plugins twice to make Adobe Reader happy

[Approval Request Comment]
Bug caused by (feature/regressing bug #):
767633

User impact if declined: 
Adobe reader often sized incorrectly (clipping ~20px off of its top/right sides)

Testing completed (on m-c, etc.): 
On m-c

Risk to taking this patch (and alternatives if risky): 
Low. 767633 inadvertently fixed us firing SetWindow() twice needlessly, but apparently adobe reader depended on that behavior. This roughly reverts us to that known-good behavior.

String or IDL/UUID changes made by this patch:
None
Attachment #748236 - Flags: approval-mozilla-beta?
Attachment #748236 - Flags: approval-mozilla-aurora?
Comment on attachment 748236 [details] [diff] [review]
Fire SetWindow on plugins twice to make Adobe Reader happy

We'll take this on Aurora, but no need to introduce any risk for this bug on Beta.
Attachment #748236 - Flags: approval-mozilla-beta?
Attachment #748236 - Flags: approval-mozilla-beta-
Attachment #748236 - Flags: approval-mozilla-aurora?
Attachment #748236 - Flags: approval-mozilla-aurora+
Duplicate of this bug: 874136
Verified as fixed on:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0
QA Contact: ioana.budnar
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0
Verified as fixed on Fx 24 beta 9 (20130905180733) and latest Nightly (20130905030206).
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.