Closed
Bug 353071
Opened 19 years ago
Closed 19 years ago
Simplify visibility checks in OpenLocation and getSearchBar
Categories
(Firefox :: General, defect, P3)
Firefox
General
Tracking
()
RESOLVED
FIXED
Firefox 3 alpha1
People
(Reporter: asaf, Assigned: asaf)
Details
Attachments
(1 file, 2 obsolete files)
5.84 KB,
patch
|
Details | Diff | Splinter Review |
We can do simple checks on the boxObject of the location bar and search bar elements instead of checking their containers visibility etc.
Assignee | ||
Comment 1•19 years ago
|
||
Attachment #238937 -
Flags: review?(gavin.sharp)
Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Comment 2•19 years ago
|
||
Comment on attachment 238937 [details] [diff] [review]
patch
>Index: browser/base/content/browser.js
> var element;
>- if (gIsLoadingBlank && gURLBar && !gURLBar.hidden &&
>- !gURLBarContainer.parentNode.collapsed)
>+ if (gIsLoadingBlank && gURLBar && isElementVisible(gURLBar))
> element = gURLBar;
> else
> element = content;
>- if (gURLBar) {
>- var style = document.defaultView.getComputedStyle(gURLBarContainer, null);
>- if (style.visibility == "visible" && style.display != "none") {
>- gURLBar.focus();
>- gURLBar.select();
>- return;
>- }
>+ if (gURLBar && isElementVisible(gURLBar)) {
>+ gURLBar.focus();
>+ gURLBar.select();
>+ return;
gURLBarContainer is now unused, so you can remove it.
>Index: browser/base/content/utilityOverlay.js
>+function isElementVisible(aElement)
>+{
>+ // * When an element is hidden (not collapsed), its boxObject.x property is
>+ // set to 0.
This is also true for elements on the leftmost edge of the screen, though... You should probably check at least one of width and height, too. I kinda of wish there was a better way to tell whether an element has a frame or not (or maybe there is and I don't know about it - maybe one of the Neils would?). Also, use document.defaultView.getComputedStyle instead of window.getComputedStyle.
Attachment #238937 -
Flags: review?(gavin.sharp) → review-
Assignee | ||
Updated•19 years ago
|
Priority: -- → P3
Assignee | ||
Comment 3•19 years ago
|
||
Attachment #238937 -
Attachment is obsolete: true
Attachment #239426 -
Flags: review?(gavin.sharp)
Comment 4•19 years ago
|
||
Comment on attachment 239426 [details] [diff] [review]
patch
r=me if you also remove other traces of gURLBarContainer.
Attachment #239426 -
Flags: review?(gavin.sharp) → review+
Assignee | ||
Comment 5•19 years ago
|
||
mozilla/browser/base/content/browser.js 1.708
mozilla/browser/base/content/utilityOverlay.js 1.43
Attachment #239426 -
Attachment is obsolete: true
Assignee | ||
Updated•19 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•18 years ago
|
OS: Mac OS X 10.3 → All
Hardware: Macintosh → All
You need to log in
before you can comment on or make changes to this bug.
Description
•