Gaia/System/Contribution: Difference between revisions

From MozillaWiki
< Gaia‎ | System
Jump to navigation Jump to search
(Created page with "== System App Review/Contribution Notes == * Use Service.query/Service.request instead of direct module access like |window.appWindowManager._activeApp| * Service.query is fo...")
 
No edit summary
Line 6: Line 6:
* Avoid polluting #screen element anymore. We are having a class disaster now. If your view needs to know whether other's view, try using events and update your own element instead of the high level screen.
* Avoid polluting #screen element anymore. We are having a class disaster now. If your view needs to know whether other's view, try using events and update your own element instead of the high level screen.
* Avoid using stopImmediatePropagation to control the event ordering. If you do need it, implement an event priority manager like https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/hierarchy_manager.js
* Avoid using stopImmediatePropagation to control the event ordering. If you do need it, implement an event priority manager like https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/hierarchy_manager.js
* Escape HTML
* Escape HTML before you inject!

Revision as of 03:11, 12 December 2014

System App Review/Contribution Notes

  • Use Service.query/Service.request instead of direct module access like |window.appWindowManager._activeApp|
* Service.query is for synchronous information check
* Service.request is to request certain asynchronous action to other module.

Read https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/service.js for more infomation

  • Avoid polluting #screen element anymore. We are having a class disaster now. If your view needs to know whether other's view, try using events and update your own element instead of the high level screen.
  • Avoid using stopImmediatePropagation to control the event ordering. If you do need it, implement an event priority manager like https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/hierarchy_manager.js
  • Escape HTML before you inject!