Bug 1291306 - update highlighter CSS selector to avoid leaking styles to content;r=ntim a=lizzard
authorJulian Descottes <jdescottes@mozilla.com>
Sat, 06 Aug 2016 15:04:49 +0200
changeset 349689 deba9752fc422bd5c3c0d611c9d8963c6a727374
parent 349688 93f9fde505f4f3fb3eefce52453663238cda12fa
child 349690 f5a9d33557dd860e74994a3a650e743569883cbb
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersntim, lizzard
bugs1291306
milestone50.0a2
Bug 1291306 - update highlighter CSS selector to avoid leaking styles to content;r=ntim a=lizzard Even though the pseudo :-moz-native-anonymous is only available for chrome content, elements such as INPUT tags were impacted by the reset styles defined with the selector ":-moz-native-anonymous" The selector has to be specialized in order to make sure it only impacts devtools elements. MozReview-Commit-ID: HeHx9i6RJiq
devtools/server/actors/highlighters.css
--- a/devtools/server/actors/highlighters.css
+++ b/devtools/server/actors/highlighters.css
@@ -1,24 +1,26 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 /*
   The :-moz-native-anonymous selector prefix prevents the styles defined here
-  from impacting web content.
-  Indeed, this pseudo-class is only available to chrome code.
+  from impacting web content. Indeed, this pseudo-class is only available to chrome code.
   This stylesheet is loaded as a ua stylesheet via the addon sdk, so having this
   pseudo-class is important.
   Having bug 1086532 fixed would make it possible to load this stylesheet in a
   <style scoped> node instead, directly in the native anonymous container
   element.
+
+  A specific selector should still be specified to avoid impacting non-devtools
+  chrome content.
 */
 
-:-moz-native-anonymous {
+:-moz-native-anonymous .highlighter-container {
   /*
   Content CSS applying to the html element impact the highlighters.
   To avoid that, possible cases have been set to initial.
   */
   text-transform: initial;
   text-indent: initial;
   letter-spacing: initial;
   word-spacing: initial;