Closed
Bug 93830
Opened 23 years ago
Closed 23 years ago
Remove IsItAPrinter-hack from nsCSSFrameConstructor.cpp
Categories
(Core :: DOM: CSS Object Model, defect)
Core
DOM: CSS Object Model
Tracking
()
RESOLVED
FIXED
mozilla0.9.4
People
(Reporter: roland.mainz, Assigned: roland.mainz)
Details
(Whiteboard: patch,approval)
Attachments
(1 file)
1.31 KB,
patch
|
Details | Diff | Splinter Review |
[Partially replacement for bug 92918:]
nsCSSFrameConstructor.cpp contains a hack using
|DeviceContextImpl->SupportsNativeWidgets()| to determinate whether the given
PresContext can be "scrolled" or uses a fixed media(=paper, not scrollable :-)
...
This code is simply wrong and should be replaced by the following code (from
latest patch in bug 92918):
-- snip --
diff -r -u original/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp
mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp
--- original/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp Wed Jul
25 09:52:19 2001
+++ mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp Thu Aug 2
19:26:39 2001
@@ -3764,22 +3764,15 @@
// --------- IF SCROLLABLE WRAP IN SCROLLFRAME --------
- // If the device supports scrolling (e.g., in galley mode on the screen
and
+ // If the device supports scrolling (e.g., in galley mode on the screen and
// for print-preview, but not when printing), then create a scroll frame that
// will act as the scrolling mechanism for the viewport.
// XXX Do we even need a viewport when printing to a printer?
- // XXX It would be nice to have a better way to query for whether the device
- // is scrollable
PRBool isScrollable = PR_TRUE;
if (aPresContext) {
- nsIDeviceContext* dc;
- aPresContext->GetDeviceContext(&dc);
- if (dc) {
- PRBool supportsWidgets;
- if (NS_SUCCEEDED(dc->SupportsNativeWidgets(supportsWidgets))) {
- isScrollable = supportsWidgets;
- }
- NS_RELEASE(dc);
+ PRBool isPaginated = PR_FALSE;
+ if (NS_SUCCEEDED(aPresContext->IsPaginated(&isPaginated))) {
+ isScrollable = !isPaginated;
}
}
-- snip --
This code simply asks the |aPresContext| whether it is "paginated", e.g. if the
destination is a printer - or not.
Assignee | ||
Comment 1•23 years ago
|
||
Assigning to myself, setting milestone.
Assignee | ||
Comment 2•23 years ago
|
||
Assignee | ||
Comment 3•23 years ago
|
||
Filed patch.
Requesting r=/sr= ...
Status: NEW → ASSIGNED
Whiteboard: patch,review
r=timeless
Component: Browser-General → DOM Style
QA Contact: doronr → timeless
Whiteboard: patch,review → patch,approval
Comment 5•23 years ago
|
||
Roland, you know how to request super-review -- it's documented at
http://www.mozilla.org/hacking/reviewers.html.
/be
Comment 6•23 years ago
|
||
Get an sr from waterson or dcone.
Comment 7•23 years ago
|
||
sr=waterson if dcone is okay with it.
Assignee | ||
Comment 8•23 years ago
|
||
dcone:
I need a r= from you, please :-)
Comment 9•23 years ago
|
||
If you want to know if you going to a printer, you can queryinterface to a
printcontext. If all you want to know is if your pagenated or not, this is the
correct way. Assuming you just want to know if your pagenated.. r=dcone.
Comment 10•23 years ago
|
||
Roland has requested I check this in. Since it's r/sr'd, I'll do it when i do
bug 92641.
Assignee | ||
Comment 11•23 years ago
|
||
jesup:
Did you check this patch "in" yet ?
Comment 12•23 years ago
|
||
I'll check in shortly after making sure it compiles/runs in my machine
Comment 13•23 years ago
|
||
Patch applied
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•