Closed
Bug 337356
Opened 18 years ago
Closed 18 years ago
Page zoom breaks if content policy accesses frame's document
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jwkbugzilla, Assigned: martijn.martijn)
References
Details
Attachments
(3 files, 3 obsolete files)
1.54 KB,
text/plain
|
Details | |
196 bytes,
text/html
|
Details | |
3.54 KB,
patch
|
Details | Diff | Splinter Review |
This issue has been reported for Adblock Plus 0.7 - if you zoom a page with a frame and then reload it the frame will show text in normal size while the containing page is still zoomed. Attaching minimized test case.
Reporter | ||
Comment 1•18 years ago
|
||
This content policy does only one thing - it accesses node.contentWindow.document for frame nodes, that's enough to break page zoom. Simply save it as TestPolicy.js and drop it into the application's components directory. Then remove compreg.dat in your profile to make the component register.
Reporter | ||
Comment 2•18 years ago
|
||
This testcase contains a frame with some text. To reproduce the bug: 1. Install content policy component from attachment above 2. Go to this page (a JavaScript exception will occur because the content policy tries to access a document that isn't there yet) 3. Press Ctrl-+ a few times to zoom the page 4. Press "Reload" You will see that the text outside the frame is zoomed while text inside it isn't. I was able to reproduce it in Firefox 1.5.0.3, in a current trunk nightly and in Firefox 1.5.0.4 build 2006050817 where bug 336875 should be fixed (so this isn't the same issue).
Reporter | ||
Comment 3•18 years ago
|
||
Forgot to mention: the testcase won't work with Adblock Plus 0.7 because it uses a data: URL that will be ignored.
Comment 4•18 years ago
|
||
Yep. Zoom is gotten from the previous content viewer, or from the parent if there isn't one. You're forcing content viewer creation when you try to get the document from a window that doesn't have one yet, and CreateAboutBlankContentViewer doesn't copy zoom state, along with a bunch of other things.
Comment 5•18 years ago
|
||
Actually, I was wrong. CreateAboutBlankContentViewer does copy state. But SetTextZoom and GetTextZoom on DocumentViewerImpl are broken -- they only work if there is an mPresContext, which is not going to be the case for the about:blank viewer here. So the viewer should probably store the text zoom in a member, and possibly set it on the prescontext when creating it?
Keywords: helpwanted
Assignee | ||
Comment 6•18 years ago
|
||
So something like this?
Comment 7•18 years ago
|
||
That looks about right, yes. Does it work?
Assignee | ||
Comment 8•18 years ago
|
||
Yes, it seems to work. I'll recheck with backing out the patch.
Assignee | ||
Comment 9•18 years ago
|
||
Comment on attachment 222355 [details] [diff] [review] patch Yes, backing out the patch makes the bug appear again.
Attachment #222355 -
Flags: review?(bzbarsky)
Comment 10•18 years ago
|
||
Comment on attachment 222355 [details] [diff] [review] patch Add an assert in GetTextZoom that !mPresContext || mPresContext->TextZoom() == mTextZoom, and r+sr=bzbarsky
Attachment #222355 -
Flags: superreview+
Attachment #222355 -
Flags: review?(bzbarsky)
Attachment #222355 -
Flags: review+
Updated•18 years ago
|
Assignee: general → martijn.martijn
Flags: blocking1.9a2+
Assignee | ||
Comment 11•18 years ago
|
||
Boris, something like this?
Attachment #222355 -
Attachment is obsolete: true
Comment 13•18 years ago
|
||
Comment on attachment 223839 [details] [diff] [review] patch2, with assertion You want: + NS_ASSERTION(!mPresContext || mPresContext->TextZoom() == mTextZoom, + "mPresContext->TextZoom() != mTextZoom");
Attachment #223839 -
Flags: review-
Assignee | ||
Comment 14•18 years ago
|
||
Yeah, sorry about continuously wrong patches here. I'll do what you say in comment 13 and will check that in (hopefully) tomorrow.
Assignee | ||
Comment 15•18 years ago
|
||
Attachment #223839 -
Attachment is obsolete: true
Assignee | ||
Comment 16•18 years ago
|
||
Checked that patch in. Sorry for the delay. Checking in layout/base/nsDocumentViewer.cpp; /cvsroot/mozilla/layout/base/nsDocumentViewer.cpp,v <-- nsDocumentViewer.cpp new revision: 1.490; previous revision: 1.489 done
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•18 years ago
|
Keywords: helpwanted
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•