Closed Bug 404290 Opened 17 years ago Closed 17 years ago

the size of popup windows needs to be specified in css pixels, not device pixels

Categories

(Core :: DOM: Core & HTML, defect, P4)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: db48x, Assigned: db48x)

References

Details

Attachments

(2 files, 1 obsolete file)

Currently when the dpi of the user's monitor is 144 or greater, all of the chrome and content visible in a window has it's size scaled up. However, the dimensions of popup windows or dialog windows is still assumed to be given in device pixels. This results in problems because the window will often be one quarter of the size necessary to display it's contents. To be precise, all of the window features that you can specify when calling open or openDialog that are lengths should be in css pixels. This includes top, left, width, height, screenX/Y, outerWidth/Height and innerWidth/Height.
Flags: blocking1.9?
Blocks: 348059
Attached patch 404290-1.diffSplinter Review
Assignee: nobody → db48x
Status: NEW → ASSIGNED
Attachment #289267 - Flags: review?(sharparrow1)
Comment on attachment 289267 [details] [diff] [review] 404290-1.diff Looks correct to me; make sure to get an embedding peer for sr, though, because I have no authority to review patches in the embedding module.
Attachment #289267 - Flags: review?(sharparrow1) → review+
Attachment #289267 - Flags: superreview?(benjamin)
Flags: blocking1.9? → blocking1.9+
Priority: -- → P4
Comment on attachment 289267 [details] [diff] [review] 404290-1.diff >Index: embedding/components/windowwatcher/src/Makefile.in >-REQUIRES = xpcom \ >- string \ >+REQUIRES = xpcom \ >+ string \ This seems like a gratuitous change to me, please don't. >Index: embedding/components/windowwatcher/src/nsWindowWatcher.cpp >+ nsCOMPtr<nsIWidget> mainWidget; >+ treeOwnerAsWin->GetMainWidget(getter_AddRefs(mainWidget)); >+ nsCOMPtr<nsIDeviceContext> ctx = mainWidget->GetDeviceContext(); >+ >+ float DevPixelsPerCSSPixel = float(ctx->AppUnitsPerCSSPixel()) / ctx->AppUnitsPerDevPixel(); Are all of these methods guaranteed to succeed? This needs review from roc or a widget owner, I'd think.
Attachment #289267 - Flags: superreview?(benjamin)
Attachment #289267 - Flags: superreview+
Attachment #289267 - Flags: review?(roc)
Attachment #289267 - Flags: review+
Comment on attachment 289267 [details] [diff] [review] 404290-1.diff Those can't really fail
Attachment #289267 - Flags: review?(roc) → review+
thanks, checked in.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
(In reply to comment #4) > Those can't really fail embedding/browser/webBrowser/nsDocShellTreeOwner.cpp doesn't seem to agree: 702 NS_IMETHODIMP 703 nsDocShellTreeOwner::GetMainWidget(nsIWidget** aMainWidget) 704 { 705 return NS_ERROR_NULL_POINTER; 706 } This patch causes Camino to crash on every popup (see bug 406108)
Can you implement that method? We need to get a Gecko widget from somewhere so we can convert from CSS pixels to device pixels correctly.
(In reply to comment #7) > Can you implement that method? If that refers to me, no; I have no familiarity with most of /embedding (nor is it at all clear to me from the idl what GetMainWidget is supposed to do, exactly). Someone who knows embedding will need to look at it--and I'd like to request that unless that's going to happen very soon the patch here be backed out in the meantime, as it cripples embeddors.
Attached patch fix regression (obsolete) — Splinter Review
No need to back out. This patch should fix it; please try it.
Sure, that fixes the crash, but it means that this bug isn't actually fixed for Camino (or presumably other embedders, since the code in question isn't Camino-specific)...
OK, but that's better than leaving it unfixed for everyone.
As long as this (or a follow-up bug blocking 348059) is left open for actually fixing this bug for embedders, that makes sense.
Is there anything else you need from me before getting this reviewed and landed?
Specifically, it would be...unpleasant...for us to have to live with this common crasher until whenever the tree opens again after fx3b2 (which date seems as-of-yet-undetermined, as far as I can tell).
Comment on attachment 290899 [details] [diff] [review] fix regression r=me (josh suggested I get the ball rolling so this can land before freeze; I hope I'm not stepping on any toes)
Attachment #290899 - Flags: superreview?(bzbarsky)
Attachment #290899 - Flags: review+
Comment on attachment 290899 [details] [diff] [review] fix regression So why not just get the widget from the docshell instead of getting it from the treeowner? Is the problem that the docshell's widget is null at this point?
Fix v2, per discussion with bzbarsky. This gives Camino-like embedding clients a valid widget. (It lies about the DPI, so the behavior here still isn't right on the Mac, but at least it pushes the issue to the right place in the code).
Attachment #290899 - Attachment is obsolete: true
Attachment #291323 - Flags: superreview?(bzbarsky)
Attachment #290899 - Flags: superreview?(bzbarsky)
Comment on attachment 291323 [details] [diff] [review] fix regression, v2 sr=bzbarsky. Please make sure to file a bug on the Thebes device context dpi thing if there isn't one already. cc me and roc, as well as stuart and vlad on that bug?
Attachment #291323 - Flags: superreview?(bzbarsky)
Attachment #291323 - Flags: superreview+
Attachment #291323 - Flags: review+
Comment on attachment 291323 [details] [diff] [review] fix regression, v2 Landed on trunk.
Filed bug 406668 for the DPI issue, since I didn't see an existing bug.
Are there tests that would catch some of these bugs (e.g. the crasher bug 406108 that this bug exposed, bug 401328 [which I realize is a very different bug]) if the tests were being run by apps exercising embedding code (e.g., Camino, Epiphany, etc.)? Just wondering aloud....
Running mochitest in an embedding environment should catch window.open() bugs, I would think.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: