add permanent fullsc-toggler element to simplify code

RESOLVED FIXED in Firefox 20

Status

()

Firefox
Toolbars and Customization
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: ithinc, Assigned: ithinc)

Tracking

20 Branch
Firefox 20
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

5 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20121204 Firefox/20.0
Build ID: 20121204030754

Steps to reproduce:

http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser-fullScreen.js#49
49         let fullScrToggler = document.getElementById("fullscr-toggler");
50         if (!fullScrToggler) {
51           fullScrToggler = document.createElement("hbox");
52           fullScrToggler.id = "fullscr-toggler";
53           fullScrToggler.collapsed = true;
54           gNavToolbox.parentNode.insertBefore(fullScrToggler, gNavToolbox.nextSibling);
55         }
56         fullScrToggler.addEventListener("mouseover", this._expandCallback, false);
57         fullScrToggler.addEventListener("dragenter", this._expandCallback, false);
58       }

http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser-fullScreen.js#157
157     let fullScrToggler = document.getElementById("fullscr-toggler");
158     if (fullScrToggler) {
159       fullScrToggler.removeEventListener("mouseover", this._expandCallback, false);
160       fullScrToggler.removeEventListener("dragenter", this._expandCallback, false);
161     }

http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser-fullScreen.js#173
173       let fullScrToggler = document.getElementById("fullscr-toggler");
174       if (fullScrToggler) {
175         fullScrToggler.removeEventListener("mouseover", this._expandCallback, false);
176         fullScrToggler.removeEventListener("dragenter", this._expandCallback, false);
177       }

http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser-fullScreen.js#509
509     let toggler = document.getElementById("fullscr-toggler");
510     if (toggler) {
511       toggler.collapsed = aShow;
512     }



Expected results:

The "fullscr-toggler" would be better constructed in browser.xul and cached in FullScreen object.
Component: Untriaged → Toolbars
(Assignee)

Comment 1

5 years ago
Created attachment 692668 [details] [diff] [review]
patch
Attachment #692668 - Flags: review?(felipc)
Attachment #692668 - Flags: feedback?(gavin.sharp)
Comment on attachment 692668 [details] [diff] [review]
patch

Looks good to me!
Attachment #692668 - Flags: review?(felipc)
Attachment #692668 - Flags: review+
Attachment #692668 - Flags: feedback?(gavin.sharp)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Refactor browser-fullScreen.js a little to simplify code → add permanent fullsc-toggler element to simplify code
Assignee: nobody → ithinc
OS: Windows 7 → All
Hardware: x86_64 → All
(Assignee)

Comment 3

5 years ago
Created attachment 692672 [details] [diff] [review]
patch v2
Attachment #692668 - Attachment is obsolete: true
Attachment #692672 - Flags: review?(felipc)
Attachment #692672 - Flags: feedback?(gavin.sharp)
(Assignee)

Comment 4

5 years ago
Comment on attachment 692672 [details] [diff] [review]
patch v2

Replace _isChromeCollapsed with !_fullScrToggler.collapsed.
Attachment #692672 - Flags: review?(gavin.sharp)
Attachment #692672 - Flags: review?(felipc)
Attachment #692672 - Flags: feedback?(gavin.sharp)
(Assignee)

Comment 5

5 years ago
Created attachment 695472 [details] [diff] [review]
patch for checkin (as v1)
Attachment #692672 - Attachment is obsolete: true
Attachment #692672 - Flags: review?(gavin.sharp)
(Assignee)

Comment 6

5 years ago
"Replace _isChromeCollapsed with !_fullScrToggler.collapsed" will be handled in a followup.
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/d83930c9a712
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/d83930c9a712
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
You need to log in before you can comment on or make changes to this bug.