Closed Bug 1022724 Opened 11 years ago Closed 11 years ago

Display a devtool overlay for the system app

Categories

(Firefox OS Graveyard :: Gaia::System, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
2.0 S4 (20june)

People

(Reporter: vingtetun, Assigned: vingtetun)

References

Details

(Keywords: perf, Whiteboard: [c=devtools p= s=2014.06.20.t u=])

User Story

+++ This bug was initially created as a clone of Bug #971008 +++

devtools-layers currently use <div>counter</div>. Obviously changing the number create artificial reflows which may ends up into an infinite loop once there is something to display reflows into the system app.

Using canvas should solve the issue.

Attachments

(1 file, 3 obsolete files)

It would be nice to finally be able to see the devtools overlay for the system app.
Attached patch devtools.system.patch (obsolete) — Splinter Review
Jan, I'm not sure that moving the SettingsListener.observe call here is something you expect ?
Attachment #8437015 - Flags: review?(janx)
Attached patch devtools.system (obsolete) — Splinter Review
Just realized that I introduced a new !important and didn't fix up the test.
Attachment #8437015 - Attachment is obsolete: true
Attachment #8437015 - Flags: review?(janx)
Attachment #8437037 - Flags: review?(janx)
Comment on attachment 8437037 [details] [diff] [review] devtools.system Review of attachment 8437037 [details] [diff] [review]: ----------------------------------------------------------------- Thanks a lot for this feature! Horrible nit-monster strikes again: ::: apps/settings/elements/developer_hud.html @@ +26,5 @@ > </li> > + <li> > + <label class="pack-checkbox"> > + <input type="checkbox" name="devtools.overlay.system"> > + <span data-l10n-id="devtools-overlay-system">Show System overlay</span> (please reflect properties nits) ::: apps/settings/locales/settings.en-US.properties @@ +993,5 @@ > debugger-disabled=Disabled > debugger-adb-only=ADB only > debugger-adb-and-devtools=ADB and DevTools > devtools-overlay=Show devtools overlay > +devtools-overlay-system=Show System overlay Over-nits: Please, - remove the unused "devtools-overlay" property, - rename "devtools-overlay-system" to "hud-system", and "Show System overlay" to "Show system HUD" (with lowercase "system"), - move both "hud-system" and "jank-threshold" properties up with the rest of the "hud-" properties. ::: apps/system/js/devtools/developer_hud.js @@ +17,5 @@ > + > + SettingsListener.observe('devtools.overlay.system', > + false, (function(value) { > + this.toggleSystemOverlay(value); > + }).bind(this)); Nit: Please bind this.toggleSystemHUD in the DeveloperHUD() constructor, and use it directly as an observer instead of creating and anonymous wrapper function. @@ +26,5 @@ > stop: function() { > window.removeEventListener('developer-hud-update', this); > }, > > + _showSystemOverlay: false, Nit: Please rename to "_showSystemHUD", and move to top of prototype. @@ +27,5 @@ > window.removeEventListener('developer-hud-update', this); > }, > > + _showSystemOverlay: false, > + toggleSystemOverlay: function(enabled) { Nit: Please rename to "toggleSystemHUD". @@ +59,2 @@ > if (!appwindow) { > + if (target === window && this._showSystemOverlay) { Nit: _showSystemHUD @@ +65,3 @@ > } > > + var overlay = appwindow.querySelector(':scope > .developer-hud'); Why do you use ":scope >" here? ::: apps/system/style/zindex.css @@ +25,5 @@ > } > > +/* System developer HUD should be above everything */ > +#screen > .developer-hud { > + z-index: 2147483647; Nit: I guess this doesn't cover the home gesture panel for now, but I'd feel more confident if z-index was one less. @@ +32,5 @@ > #screen > *[data-z-index-level="poweroff-splash"] { > z-index: 65536; > } > > #screen > [data-z-index-level="debug-grid"], Nit: The grid was removed, please remove this useless selector.
Attachment #8437037 - Flags: review?(janx) → review-
Thanks for the review. > @@ +26,5 @@ > > stop: function() { > > window.removeEventListener('developer-hud-update', this); > > }, > > > > + _showSystemOverlay: false, > > Nit: Please rename to "_showSystemHUD", and move to top of prototype. > Renamed but this is a good practice to keep variables close to where they are declared. This makes obvious the link between this property and the code that toggles it. So I kept it here. > > @@ +65,3 @@ > > } > > > > + var overlay = appwindow.querySelector(':scope > .developer-hud'); > > Why do you use ":scope >" here? > :scope is like |this| of css in this case. I needed to select the direct child of the container. Otherwise since the developer HUD for the main window is contained into #screen, the code will have returned 2 HUD or more based on the numbers of developer HUDs. > ::: apps/system/style/zindex.css > @@ +25,5 @@ > > } > > > > +/* System developer HUD should be above everything */ > > +#screen > .developer-hud { > > + z-index: 2147483647; > > Nit: I guess this doesn't cover the home gesture panel for now, but I'd feel > more confident if z-index was one less. > I would like the System stuff to works even for fullscreen apps.
Attached patch devtools.system (obsolete) — Splinter Review
Attachment #8437037 - Attachment is obsolete: true
Attachment #8437584 - Flags: review?(janx)
Attached patch devtools.systemSplinter Review
Oups. Forgot to remove grid from zindex.css
Attachment #8437584 - Attachment is obsolete: true
Attachment #8437584 - Flags: review?(janx)
Attachment #8437593 - Flags: review?(janx)
Comment on attachment 8437593 [details] [diff] [review] devtools.system Review of attachment 8437593 [details] [diff] [review]: ----------------------------------------------------------------- r+ with a nit you forgot to fix :) (In reply to Vivien Nicolas (:vingtetun) (:21) (NOT reading bugmails, needinfo? please) from comment #4) > > Renamed but this is a good practice to keep variables close to where they > are declared. This makes obvious the link between this property and the code > that toggles it. So I kept it here. Good point. > > Why do you use ":scope >" here? > > > > :scope is like |this| of css in this case. > > I needed to select the direct child of the container. Otherwise since the > developer HUD for the main window is contained into #screen, the code will > have returned 2 HUD or more based on the numbers of developer HUDs. Well actually `querySelector` would just return the first HUD it finds, but I guess :scope makes it cleaner. ::: apps/system/js/devtools/developer_hud.js @@ +10,5 @@ > function DeveloperHUD() { > + SettingsListener.observe('devtools.overlay.system', > + false, (function(value) { > + this.toggleSystemHUD(value); > + }).bind(this)); Please, change `(function(value) { this.toggleSystemHUD(value); }).bind(this)` to `this.toggleSystemHUD.bind(this)`.
Attachment #8437593 - Flags: review?(janx) → review+
Assignee: nobody → 21
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Keywords: perf
Whiteboard: [c=devtools p= s= u=] → [c=devtools p= s=2014.06.20.t u=]
Target Milestone: --- → 2.0 S4 (20june)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: