Closed
Bug 582865
Opened 14 years ago
Closed 14 years ago
Provide a shared "shape" module for Point, Rect, etc.
Categories
(Toolkit Graveyard :: XULRunner, defect)
Toolkit Graveyard
XULRunner
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla2.0b4
People
(Reporter: Mardak, Assigned: mitcho)
References
Details
(Keywords: dev-doc-complete)
Attachments
(1 file, 4 obsolete files)
12.42 KB,
patch
|
Details | Diff | Splinter Review |
From bug 582023 comment 3: Fennec has Rect/Point classes that are very similar to the ones in this file already: http://mxr.mozilla.org/mobile-browser/source/chrome/content/Util.js#310 Their code is in a separate repository, so sharing it directly isn't possible at the moment, but perhaps it would be worth copying it over rather than having a slightly different (new) implementation here? I think switching wouldn't require many changes, and it would make it possible to move the code into a shared location (toolkit) in the future.
Comment 1•14 years ago
|
||
Sounds OK to the Fennec team
Assignee | ||
Comment 2•14 years ago
|
||
I'm sorry for my ignorance, but how would we go about requesting to move this code into the toolkit? Mark, it looks like Point and Rect are the only components of this Util.js that we would want to use. I assume moving just Point and Rect out into a shared location but leaving the rest alone would also be alright for you?
Comment 3•14 years ago
|
||
(In reply to comment #2) > Mark, it looks like Point and Rect are the only components of this Util.js that > we would want to use. I assume moving just Point and Rect out into a shared > location but leaving the rest alone would also be alright for you? Sounds fine to me.
Comment 4•14 years ago
|
||
(In reply to comment #2) > how would we go about requesting to move this code into the toolkit? Attach a patch that adds a Geometry.jsm to toolkit/content that exports Point/Rect symbols using the Fennec code, and ask review from Dave Townsend? Once it's landed we can file a followup on making Fennec use it instead of its own copy - same for tabcandy.
Assignee | ||
Comment 5•14 years ago
|
||
Thanks Gavin. Here's the patch.
Attachment #464064 -
Flags: review?(dtownsend)
Assignee | ||
Comment 6•14 years ago
|
||
Also added the browser_rect.js test from Mobile as browser_Geometry.js http://mxr.mozilla.org/mobile-browser/source/chrome/tests/browser_rect.js
Attachment #464064 -
Attachment is obsolete: true
Attachment #464075 -
Flags: review?(dtownsend)
Attachment #464064 -
Flags: review?(dtownsend)
Comment 7•14 years ago
|
||
What am I reviewing here, all the code in the file or just code that is moving from somewhere else?
Assignee | ||
Comment 8•14 years ago
|
||
(In reply to comment #7) > What am I reviewing here, all the code in the file or just code that is moving > from somewhere else? This is just code moving from Mobile to toolkit. Changes made are the license code and the JSM-ing.
Comment 9•14 years ago
|
||
A diff against the source file might be useful for review.
Assignee | ||
Comment 10•14 years ago
|
||
Assignee | ||
Comment 11•14 years ago
|
||
Assignee | ||
Comment 12•14 years ago
|
||
(In reply to comment #9) > A diff against the source file might be useful for review. Thanks Gavin. Diffs for both files attached.
Updated•14 years ago
|
Attachment #464400 -
Attachment is patch: true
Comment 13•14 years ago
|
||
Comment on attachment 464399 [details] [diff] [review] diff mobile-browser/source/chrome/content/Util.js tabcandy-central/toolkit/content/Geometry.jsm Unified diffs are generally preferred but ok. So this is a copy of code from, tabcandy-central. Who wrote that code and who did the code review on it?
Assignee | ||
Comment 14•14 years ago
|
||
(In reply to comment #13) > So this is a copy of code from, > tabcandy-central. Who wrote that code and who did the code review on it? The idea of this ticket is to move code which could be reused from mobile to the toolkit, as was suggested by gavin. I've simply gone ahead and committed it against our branch of mozilla-central, tabcandy-central, but I'm requesting the patch be applied to mozilla-central. The code itself—the geometry classes in Util.js (now Geometry.jsm) and tests/browser_rect.js (now tests/browser_Geometry.js—were mostly written by Benjamin Stover and reviwed by Gavin, as per the hg log: http://hg.mozilla.org/mobile-browser/log/1693b30538a3/chrome/content/Util.js http://hg.mozilla.org/mobile-browser/log/1693b30538a3/chrome/tests/browser_rect.js
Updated•14 years ago
|
Attachment #464075 -
Flags: review?(dtownsend) → review+
Reporter | ||
Updated•14 years ago
|
Attachment #464075 -
Flags: approval2.0?
Updated•14 years ago
|
Attachment #464075 -
Flags: approval2.0? → approval2.0+
Comment 15•14 years ago
|
||
Comment on attachment 464075 [details] [diff] [review] Move Geometry utility classes (+tests) to the toolkit >diff --git a/toolkit/content/Geometry.jsm b/toolkit/content/Geometry.jsm >+ * The Initial Developer of the Original Code is >+ * Mozilla Corporation. We should probably take this opportunity to change this to "the Mozilla Foundation". >+ * Contributor(s): >+ * Roy Frostig <rfrostig@mozilla.com> >+ * Ben Combee <bcombee@mozilla.com> >+ * Matt Brubeck <mbrubeck@mozilla.com> >+ * Michael Yoshitaka Erlewine <mitcho@mitcho.com> and it wouldn't hurt to add "Benjamin Stover <bstover@mozilla.com>" here.
Updated•14 years ago
|
Assignee: nobody → mitcho
OS: Mac OS X → All
Hardware: x86 → All
Comment 16•14 years ago
|
||
Also don't forget to get the Fennec bug about using this filed :)
Reporter | ||
Comment 17•14 years ago
|
||
I'll land it on m-c when the tree is green.
Attachment #464075 -
Attachment is obsolete: true
Attachment #464399 -
Attachment is obsolete: true
Attachment #464400 -
Attachment is obsolete: true
Reporter | ||
Comment 18•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/cdfff833edf9
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b4
Assignee | ||
Comment 19•13 years ago
|
||
Dev doc needed: https://developer.mozilla.org/en/JavaScript_code_modules
Keywords: dev-doc-needed
Comment 20•13 years ago
|
||
Question: expandToIntegers: function round() { this.left = Math.floor(this.left); this.top = Math.floor(this.top); this.right = Math.ceil(this.right); this.bottom = Math.ceil(this.bottom); return this; }, Shouldn't the "round()" here be "expandToIntegers()"?
Comment 21•13 years ago
|
||
Using this JSM doesn't work well in desktop right now due to conflicts with like-named classes. I'm calling this documentation complete for now; we'll revisit when it can be more easily fiddled with on Desktop.
Keywords: dev-doc-needed → dev-doc-complete
Updated•8 years ago
|
Product: Toolkit → Toolkit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•