Closed Bug 573726 Opened 16 years ago Closed 15 years ago

Simplify Utils.js

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: vingtetun, Unassigned)

Details

Attachments

(1 file)

Attached patch PatchSplinter 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)
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.
(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.
Also remember the reflow problem with using content.scrollX and scrollY instead of using Util.getScrollOffset()
Attachment #453045 - Flags: review?(mbrubeck) → review-
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
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: