Closed
Bug 573726
Opened 16 years ago
Closed 15 years ago
Simplify Utils.js
Categories
(Firefox for Android Graveyard :: General, defect)
Firefox for Android Graveyard
General
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: vingtetun, Unassigned)
Details
Attachments
(1 file)
|
27.64 KB,
patch
|
mbrubeck
:
review-
|
Details | Diff | Splinter Review |
Utils.js is loaded into any tabs but there are many parts of it that are not really needed on the content side.
Attachment #453045 -
Flags: review?(mbrubeck)
Attachment #453045 -
Flags: review?(mark.finkle)
Comment 1•16 years ago
|
||
I like most of this, but:
- getHrefForElement should stay on the content side.
- I'd like to keep the Util object in Util.js or change the filename, otherwise I will get confused when looking for it. The real "utility" functions like bind and executeSoon will probably be wanted just as often in content as in chrome, and should stay in Util.js. (The same is probably true of dumpf and dumpln.)
If we do keep Util in Util.js (or maybe even if we don't), then:
- isPortrait can move to BrowserUI.
- makeURLAbsolute is only used in BrowserUI._getLinkURL. It could be moved to BrowserUI or just inlined there.
- needHomepageOverride can move to Browser.
| Reporter | ||
Comment 2•16 years ago
|
||
(In reply to comment #1)
> I like most of this, but:
> - getHrefForElement should stay on the content side.
> - I'd like to keep the Util object in Util.js or change the filename, otherwise
I would like to have a filename called geometry.js
> I will get confused when looking for it. The real "utility" functions like
> bind and executeSoon will probably be wanted just as often in content as in
> chrome, and should stay in Util.js. (The same is probably true of dumpf and
> dumpln.)
First i agree that it is confusing and we should change the name, also personnaly I will be happy to get rid as much as possible of the "bind" call we used to have and I see dumpf and dumpln as debug utilities functions that doesn't really need to live somewhere in the code. I would rather prefer have a file called debug.js and loaded everywhere while in debug build.
What do you think?
> If we do keep Util in Util.js (or maybe even if we don't), then:
> - isPortrait can move to BrowserUI.
> - makeURLAbsolute is only used in BrowserUI._getLinkURL. It could be moved to
> BrowserUI or just inlined there.
> - needHomepageOverride can move to Browser.
Agreed with that. I 'll update the patch.
Comment 3•16 years ago
|
||
Also remember the reflow problem with using content.scrollX and scrollY instead of using Util.getScrollOffset()
Updated•16 years ago
|
Attachment #453045 -
Flags: review?(mbrubeck) → review-
| Reporter | ||
Comment 4•15 years ago
|
||
Now that we have a Geometry.jsm and other stuffs I don't think this make sense
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → INVALID
| Reporter | ||
Updated•15 years ago
|
Attachment #453045 -
Flags: review?(mark.finkle)
You need to log in
before you can comment on or make changes to this bug.
Description
•