Closed
Bug 495002
Opened 16 years ago
Closed 16 years ago
nsPresContext ought to have CSSPixelsToDevPixels and DevPixelsToCSSPixels methods
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
People
(Reporter: db48x, Assigned: db48x)
References
Details
Attachments
(1 file, 3 obsolete files)
4.60 KB,
patch
|
bzbarsky
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
They're just AppUnitsToDevPixels ∘ CSSPixelsToAppUnits and AppUnitsToCSSPixels ∘ DevPixelsToAppUnits respectively, so it's not much more than an annoyance. It's already got every other combination though, so why not this one?
![]() |
||
Comment 1•16 years ago
|
||
Daniel, unless roc objects, want to just post a patch?
Assignee | ||
Comment 2•16 years ago
|
||
Sure, but after dinner.
Assignee | ||
Comment 3•16 years ago
|
||
This just adds the functions; I haven't gone looking for any of the places that could call them.
Assignee | ||
Updated•16 years ago
|
Attachment #380111 -
Attachment is patch: true
Attachment #380111 -
Attachment mime type: application/octet-stream → text/plain
![]() |
||
Comment 4•16 years ago
|
||
Comment on attachment 380111 [details] [diff] [review]
495002-1.diff
DevPixelsToFloatCSSPixels should return a float.
There should be a version of CSSPixelsToDevPixels that takes a float, right?
Attachment #380111 -
Flags: review?(bzbarsky) → review-
Assignee | ||
Comment 5•16 years ago
|
||
(In reply to comment #4)
> (From update of attachment 380111 [details] [diff] [review])
> DevPixelsToFloatCSSPixels should return a float.
Yes, I suppose that would be best.
Attachment #380111 -
Attachment is obsolete: true
Attachment #380132 -
Flags: review?(bzbarsky)
![]() |
||
Updated•16 years ago
|
Attachment #380132 -
Flags: superreview?(roc)
Attachment #380132 -
Flags: review?(bzbarsky)
Attachment #380132 -
Flags: review+
![]() |
||
Comment 6•16 years ago
|
||
Comment on attachment 380132 [details] [diff] [review]
495002-2.diff
Looks good; roc should sr, though
Attachment #380132 -
Flags: superreview?(roc) → superreview+
Comment on attachment 380132 [details] [diff] [review]
495002-2.diff
Wait ...
+ PRInt32 CSSPixelsToDevPixels(float aPixels)
+ { return AppUnitsToDevPixels(CSSPixelsToAppUnits(aPixels)); }
Shouldn't this be CSSPixelsToFloatDevPixels, and return a float?
Attachment #380132 -
Flags: superreview+ → superreview-
Assignee | ||
Comment 8•16 years ago
|
||
(In reply to comment #7)
> (From update of attachment 380132 [details] [diff] [review])
> Wait ...
>
> + PRInt32 CSSPixelsToDevPixels(float aPixels)
> + { return AppUnitsToDevPixels(CSSPixelsToAppUnits(aPixels)); }
>
> Shouldn't this be CSSPixelsToFloatDevPixels, and return a float?
no, device pixels are never given as floats.
But if the input is a float, surely the output should be a float? The caller should round the result as they see fit
Assignee | ||
Comment 10•16 years ago
|
||
Attachment #380132 -
Attachment is obsolete: true
Attachment #380352 -
Flags: superreview?
Attachment #380352 -
Flags: review?(bzbarsky)
Assignee | ||
Updated•16 years ago
|
Attachment #380352 -
Flags: superreview? → superreview?(roc)
Attachment #380352 -
Flags: superreview?(roc) → superreview+
Comment on attachment 380352 [details] [diff] [review]
495002-3.diff
It would be cool if you could find some existing places in the tree that should actually use these, so we're not just adding dead code. And I don't mean the screen patch I'm not keen on :-)
![]() |
||
Updated•16 years ago
|
Attachment #380352 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 12•16 years ago
|
||
(In reply to comment #11)
> (From update of attachment 380352 [details] [diff] [review])
> It would be cool if you could find some existing places in the tree that should
> actually use these, so we're not just adding dead code. And I don't mean the
> screen patch I'm not keen on :-)
Yes, indeed. I took a side trip through the dehydra/treehydra documentation to see if I could quickly write a script to find them all. Perhaps I'll still end up doing it manually, but I figure this is a good way to learn dehydra/treehydra.
Assignee | ||
Comment 13•16 years ago
|
||
oops. I suppose I would have a review already if I had remembered to attach this…
Attachment #380352 -
Attachment is obsolete: true
Attachment #382218 -
Flags: superreview?(roc)
Attachment #382218 -
Flags: review?(bzbarsky)
![]() |
||
Updated•16 years ago
|
Attachment #382218 -
Flags: review?(bzbarsky) → review+
Comment on attachment 382218 [details] [diff] [review]
495002-4.diff
I'm not sure about the analysis scripts. I'd probably put them under layout/analysis instead of layout/base/analysis, but there should also be some documentation of what they do and how to use them.
Attachment #382218 -
Flags: superreview?(roc) → superreview+
Assignee | ||
Comment 16•16 years ago
|
||
checked this in last night.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•10 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•