Closed
Bug 1119233
Opened 9 years ago
Closed 9 years ago
Move inline event handlers and styles from search.xul into other files
Categories
(Firefox :: Settings UI, defect)
Firefox
Settings UI
Tracking
()
People
(Reporter: Gijs, Assigned: aryx)
References
Details
Attachments
(2 files, 5 obsolete files)
6.19 KB,
patch
|
Details | Diff | Splinter Review | |
2.48 KB,
patch
|
Details | Diff | Splinter Review |
As per summary. These were (mostly?) added in bug 1088660 - the event handlers should be in JS instead, and the styles should be in CSS.
Flags: qe-verify-
Flags: in-testsuite?
Flags: firefox-backlog+
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → archaeopteryx
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8546494 -
Flags: review?(gijskruitbosch+bugs)
Assignee | ||
Comment 2•9 years ago
|
||
Successful Try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=ed64a9f87416
Reporter | ||
Comment 3•9 years ago
|
||
Comment on attachment 8546494 [details] [diff] [review] js (apply first), v1 Review of attachment 8546494 [details] [diff] [review]: ----------------------------------------------------------------- Instead of adding the listeners as functions, please consider adding gSearchPane, and implementing a handleEvent method instead, with a switch() over the event type and then checks on the target IDs. This will avoid having to use anonymous functions to keep |this| in line (as |this| will be gSearchPane anyway in those cases). ::: browser/components/preferences/in-content/search.js @@ +15,5 @@ > { > + function setEventListener(aId, aEventType, aCallback) > + { > + document.getElementById(aId) > + .addEventListener(aEventType, aCallback.bind(gSearchPane)); Nit: let node = document.getElementById(aId); node.addEventListener... ::: browser/components/preferences/in-content/search.xul @@ +54,5 @@ > <hbox> > <button id="restoreDefaultSearchEngines" > label="&restoreDefaultSearchEngines.label;" > accesskey="&restoreDefaultSearchEngines.accesskey;" > + /> Nit: line up with "accesskey", please. :-) @@ +60,5 @@ > <button id="removeEngineButton" > label="&removeEngine.label;" > accesskey="&removeEngine.accesskey;" > disabled="true" > + /> Nit: same.
Attachment #8546494 -
Flags: review?(gijskruitbosch+bugs) → feedback+
Reporter | ||
Comment 4•9 years ago
|
||
Comment on attachment 8546495 [details] [diff] [review] css, v1 Review of attachment 8546495 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/components/preferences/in-content/search.xul @@ -24,5 @@ > <label class="header-name">&paneSearch.title;</label> > </hbox> > > <!-- Default Search Engine --> > - <groupbox id="defaultEngineGroup" align="start" data-category="paneSearch"> I'm not sure if it's necessary to remove align="start", but it's certainly a good idea in principle. However... @@ +65,5 @@ > </hbox> > > <separator class="thin"/> > > + <hbox id="addEnginesBox" pack="start"> ... but then you can also remove pack="start" (the equivalent is -moz-box-pack: start). The same goes for flex (-moz-box-flex). I think with those attributes (XUL flexbox model) we should be consistent and either move all of them to CSS or keep all of them in XUL. Considering precedent and requirements for this bug, I guess right now we should keep them in XUL, but we should open a discussion on firefox-dev. Personally, I suspect moving away from the attributes and towards using CSS for these is a good idea, but we should get feedback about it and then implement it more widely. :-) ::: browser/themes/shared/incontentprefs/search.css @@ +2,5 @@ > * License, v. 2.0. If a copy of the MPL was not distributed with this > * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ > > +#defaultEngineGroup { > + text-align: start; the equivalent of align="start" in XUL is -moz-box-align: start, not text-align: start.
Assignee | ||
Comment 5•9 years ago
|
||
Attachment #8546494 -
Attachment is obsolete: true
Attachment #8546671 -
Flags: review?(gijskruitbosch+bugs)
Assignee | ||
Comment 6•9 years ago
|
||
Attachment #8546495 -
Attachment is obsolete: true
Attachment #8546672 -
Flags: review?(gijskruitbosch+bugs)
Reporter | ||
Updated•9 years ago
|
Attachment #8546672 -
Flags: review?(gijskruitbosch+bugs) → review+
Reporter | ||
Comment 7•9 years ago
|
||
Comment on attachment 8546671 [details] [diff] [review] js (apply first), v2 Review of attachment 8546671 [details] [diff] [review]: ----------------------------------------------------------------- You're not actually adding gSearchPane as an event listener anywhere... did you not test this? Or did you forget to qref? ::: browser/components/preferences/in-content/search.js @@ +63,5 @@ > }); > }, > > + handleEvent: function(aEvent) { > + switch (aEvent.type) { Nit: please indent all the case statements 2 spaces, too. @@ +65,5 @@ > > + handleEvent: function(aEvent) { > + switch (aEvent.type) { > + case "click": > + if (aEvent.target.id == "addEngines" && event.button == 0) Nit: braces around the bits inside the if, please. :-)
Attachment #8546671 -
Flags: review?(gijskruitbosch+bugs) → review-
Assignee | ||
Comment 8•9 years ago
|
||
> You're not actually adding gSearchPane as an event listener anywhere... did
> you not test this? Or did you forget to qref?
Forgot -purgecaches.
Attachment #8546671 -
Attachment is obsolete: true
Attachment #8546785 -
Flags: review?(gijskruitbosch+bugs)
Reporter | ||
Comment 9•9 years ago
|
||
Comment on attachment 8546785 [details] [diff] [review] js (apply first), v3 Review of attachment 8546785 [details] [diff] [review]: ----------------------------------------------------------------- LGTM!
Attachment #8546785 -
Flags: review?(gijskruitbosch+bugs) → review+
Assignee | ||
Comment 10•9 years ago
|
||
Successful Try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=8135d3ffaaea
Attachment #8546785 -
Attachment is obsolete: true
Assignee | ||
Comment 11•9 years ago
|
||
Attachment #8546672 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 12•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/18d17da8d569 https://hg.mozilla.org/integration/fx-team/rev/5a902d6fc538
Keywords: checkin-needed
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/18d17da8d569 https://hg.mozilla.org/mozilla-central/rev/5a902d6fc538
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 38
Updated•9 years ago
|
Iteration: --- → 38.1 - 26 Jan
You need to log in
before you can comment on or make changes to this bug.
Description
•