Closed Bug 93830 Opened 23 years ago Closed 23 years ago

Remove IsItAPrinter-hack from nsCSSFrameConstructor.cpp

Categories

(Core :: DOM: CSS Object Model, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla0.9.4

People

(Reporter: roland.mainz, Assigned: roland.mainz)

Details

(Whiteboard: patch,approval)

Attachments

(1 file)

[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.
Assigning to myself, setting milestone.
Assignee: asa → Roland.Mainz
Keywords: correctness
Target Milestone: --- → mozilla0.9.4
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
Roland, you know how to request super-review -- it's documented at http://www.mozilla.org/hacking/reviewers.html. /be
Get an sr from waterson or dcone.
sr=waterson if dcone is okay with it.
dcone: I need a r= from you, please :-)
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.
Roland has requested I check this in. Since it's r/sr'd, I'll do it when i do bug 92641.
jesup: Did you check this patch "in" yet ?
I'll check in shortly after making sure it compiles/runs in my machine
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.

Attachment

General

Creator:
Created:
Updated:
Size: