Bug 1291306 - update highlighter CSS selector to avoid leaking styles to content;r=ntim draft
authorJulian Descottes <jdescottes@mozilla.com>
Sat, 06 Aug 2016 15:04:49 +0200
changeset 397504 e341a991c7583b855c66cdf2700b9ee9ed4c64a6
parent 397304 191f08f8ff31619cde33d411c2b23d1689bf9297
child 527484 f77a8f448d83a6f1489ba627893343c6f6dd75ef
push id25330
push userjdescottes@mozilla.com
push dateSat, 06 Aug 2016 13:09:02 +0000
reviewersntim
bugs1291306
milestone51.0a1
Bug 1291306 - update highlighter CSS selector to avoid leaking styles to content;r=ntim 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;