Bug 843579 - Unprefix -moz-any-link. r=bz
authorThomas Wisniewski <wisniewskit@gmail.com>
Tue, 19 Jul 2016 23:13:13 -0400
changeset 330855 cae3143edbd4d45359acb39fd18989ce986246e3
parent 330854 b5000cae87e9967bcc096ebcc9d693cae8e79b6b
child 330856 875e441f8b804adaf67ad704171c8b2f04015499
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs843579
milestone50.0a1
Bug 843579 - Unprefix -moz-any-link. r=bz
b2g/chrome/content/content.css
devtools/client/inspector/rules/test/browser_rules_user-agent-styles.js
layout/inspector/inDOMUtils.cpp
layout/inspector/inIDOMUtils.idl
layout/inspector/tests/chrome/test_bug708874.xul
layout/mathml/mathml.css
layout/style/contenteditable.css
layout/style/nsCSSPseudoClassList.h
layout/style/nsLayoutStylesheetCache.cpp
layout/style/res/ua.css
layout/svg/svg.css
mobile/android/themes/core/content.css
--- a/b2g/chrome/content/content.css
+++ b/b2g/chrome/content/content.css
@@ -292,17 +292,17 @@ input[type="checkbox"][disabled]:hover:a
   border:1px solid rgba(125,125,125,0.4) !important;
 }
 
 select[disabled] > button {
   opacity: 0.6;
   padding: 1px 7px 1px 7px;
 }
 
-*:-moz-any-link:active,
+*:any-link:active,
 *[role=button]:active,
 button:active,
 option:active,
 select:active,
 label:active {
   background-color: rgba(141, 184, 216, 0.5);
 }
 
--- a/devtools/client/inspector/rules/test/browser_rules_user-agent-styles.js
+++ b/devtools/client/inspector/rules/test/browser_rules_user-agent-styles.js
@@ -111,18 +111,18 @@ function* userAgentStylesVisible(inspect
   }
 
   ok(userRules.some(rule => rule.matchedSelectors.length === 1),
     "There is an inline style for element in user styles");
 
   // These tests rely on the "a" selector being the last test in
   // TEST_DATA.
   ok(uaRules.some(rule => {
-    return rule.matchedSelectors.indexOf(":-moz-any-link") !== -1;
-  }), "There is a rule for :-moz-any-link");
+    return rule.matchedSelectors.indexOf(":any-link") !== -1;
+  }), "There is a rule for :any-link");
   ok(uaRules.some(rule => {
     return rule.matchedSelectors.indexOf("*|*:link") !== -1;
   }), "There is a rule for *|*:link");
   ok(uaRules.some(rule => {
     return rule.matchedSelectors.length === 1;
   }), "Inline styles for ua styles");
 }
 
--- a/layout/inspector/inDOMUtils.cpp
+++ b/layout/inspector/inDOMUtils.cpp
@@ -1211,19 +1211,20 @@ GetStatesForPseudoClass(const nsAString&
   static_assert(MOZ_ARRAY_LENGTH(sPseudoClassStates) ==
                 static_cast<size_t>(CSSPseudoClassType::MAX),
                 "Length of PseudoClassStates array is incorrect");
 
   nsCOMPtr<nsIAtom> atom = NS_Atomize(aStatePseudo);
   CSSPseudoClassType type = nsCSSPseudoClasses::
     GetPseudoType(atom, CSSEnabledState::eIgnoreEnabledState);
 
-  // Ignore :moz-any-link so we don't give the element simultaneous
+  // Ignore :any-link so we don't give the element simultaneous
   // visited and unvisited style state
-  if (type == CSSPseudoClassType::mozAnyLink) {
+  if (type == CSSPseudoClassType::anyLink ||
+      type == CSSPseudoClassType::mozAnyLink) {
     return EventStates();
   }
   // Our array above is long enough that indexing into it with
   // NotPseudo is ok.
   return sPseudoClassStates[static_cast<CSSPseudoClassTypeBase>(type)];
 }
 
 NS_IMETHODIMP
--- a/layout/inspector/inIDOMUtils.idl
+++ b/layout/inspector/inIDOMUtils.idl
@@ -179,17 +179,17 @@ interface inIDOMUtils : nsISupports
    *
    * @param {unsigned long} aCount the number of items returned
    * @param {wstring[]} aNames the names
    */
   void getCSSPseudoElementNames([optional] out unsigned long aCount,
                                 [retval, array, size_is(aCount)] out wstring aNames);
 
   // pseudo-class style locking methods. aPseudoClass must be a valid pseudo-class
-  // selector string, e.g. ":hover". ":-moz-any-link" and non-event-state
+  // selector string, e.g. ":hover". ":any-link" and non-event-state
   // pseudo-classes are ignored.
   void addPseudoClassLock(in nsIDOMElement aElement, in DOMString aPseudoClass);
   void removePseudoClassLock(in nsIDOMElement aElement, in DOMString aPseudoClass);
   bool hasPseudoClassLock(in nsIDOMElement aElement, in DOMString aPseudoClass);
   void clearPseudoClassLocks(in nsIDOMElement aElement);
 
   /**
    * Parse CSS and update the style sheet in place.
--- a/layout/inspector/tests/chrome/test_bug708874.xul
+++ b/layout/inspector/tests/chrome/test_bug708874.xul
@@ -238,17 +238,17 @@ function testMultiple() {
 
     is(div.matches(pseudo), false,
       "doesn't match selector after unlocking");
   }
 }
 
 function testInvalid() {
   var div = document.getElementById("test-div");
-  var pseudos = ["not a valid pseudo-class", ":moz-any-link", ":first-child"];
+  var pseudos = ["not a valid pseudo-class", ":ny-link", ":first-child"];
 
   for (var i = 0; i < pseudos.length; i++) {
     var pseudo = pseudos[i];
 
     // basically make sure these don't crash the browser.
     DOMUtils.addPseudoClassLock(div, pseudo);
 
     is(DOMUtils.hasPseudoClassLock(div, pseudo), false);
--- a/layout/mathml/mathml.css
+++ b/layout/mathml/mathml.css
@@ -59,17 +59,17 @@ ms[lquote]:before {
 }
 ms[rquote]:after {
   content: attr(rquote)
  }
 
 /**************************************************************************/
 /* Links                                                                  */
 /**************************************************************************/
-:-moz-any-link {
+:any-link {
   text-decoration: none !important;
 }
 
 /**************************************************************************/
 /* attributes common to all tags                                          */
 /**************************************************************************/
 
 /* These attributes are mapped to style in nsMathMLElement.cpp:
--- a/layout/style/contenteditable.css
+++ b/layout/style/contenteditable.css
@@ -32,17 +32,17 @@ img:-moz-read-write, img:-moz-read-write
 object:-moz-read-write, object:-moz-read-write[usemap], 
 applet:-moz-read-write, hr:-moz-read-write, button:-moz-read-write,
 select:-moz-read-write,
 a:-moz-read-write:link img, a:-moz-read-write:visited img,
 a:-moz-read-write:active img, a:-moz-read-write:-moz-only-whitespace[name] {
   cursor: default;
 }
 
-*|*:-moz-any-link:-moz-read-write {
+*|*:any-link:-moz-read-write {
   cursor: text;
 }
 
 /* Prevent clicking on links from going to link */
 a:link:-moz-read-write img, a:visited:-moz-read-write img,
 a:active:-moz-read-write img {
   -moz-user-input: none;
 }
--- a/layout/style/nsCSSPseudoClassList.h
+++ b/layout/style/nsCSSPseudoClassList.h
@@ -141,16 +141,18 @@ CSS_STATE_DEPENDENT_PSEUDO_CLASS(dir, ":
 // prefix version is deprecated and will be removed per bug 1270406.
 CSS_STATE_DEPENDENT_PSEUDO_CLASS(mozDir, ":-moz-dir", 0, "",
                                  NS_EVENT_STATE_LTR | NS_EVENT_STATE_RTL)
 
 CSS_STATE_PSEUDO_CLASS(link, ":link", 0, "", NS_EVENT_STATE_UNVISITED)
 // what matches :link or :visited
 CSS_STATE_PSEUDO_CLASS(mozAnyLink, ":-moz-any-link", 0, "",
                        NS_EVENT_STATE_VISITED | NS_EVENT_STATE_UNVISITED)
+CSS_STATE_PSEUDO_CLASS(anyLink, ":any-link", 0, "",
+                       NS_EVENT_STATE_VISITED | NS_EVENT_STATE_UNVISITED)
 CSS_STATE_PSEUDO_CLASS(visited, ":visited", 0, "", NS_EVENT_STATE_VISITED)
 
 CSS_STATE_PSEUDO_CLASS(active, ":active", 0, "", NS_EVENT_STATE_ACTIVE)
 CSS_STATE_PSEUDO_CLASS(checked, ":checked", 0, "", NS_EVENT_STATE_CHECKED)
 CSS_STATE_PSEUDO_CLASS(disabled, ":disabled", 0, "", NS_EVENT_STATE_DISABLED)
 CSS_STATE_PSEUDO_CLASS(enabled, ":enabled", 0, "", NS_EVENT_STATE_ENABLED)
 CSS_STATE_PSEUDO_CLASS(focus, ":focus", 0, "", NS_EVENT_STATE_FOCUS)
 CSS_STATE_PSEUDO_CLASS(hover, ":hover", 0, "", NS_EVENT_STATE_HOVER)
--- a/layout/style/nsLayoutStylesheetCache.cpp
+++ b/layout/style/nsLayoutStylesheetCache.cpp
@@ -877,26 +877,26 @@ nsLayoutStylesheetCache::BuildPreference
 
   // Rules for link styling.
   nscolor linkColor = aPresContext->DefaultLinkColor();
   nscolor activeColor = aPresContext->DefaultActiveLinkColor();
   nscolor visitedColor = aPresContext->DefaultVisitedLinkColor();
 
   sheetText.AppendPrintf(
       "*|*:link { color: #%02x%02x%02x; }\n"
-      "*|*:-moz-any-link:active { color: #%02x%02x%02x; }\n"
+      "*|*:any-link:active { color: #%02x%02x%02x; }\n"
       "*|*:visited { color: #%02x%02x%02x; }\n",
       NS_GET_R_G_B(linkColor),
       NS_GET_R_G_B(activeColor),
       NS_GET_R_G_B(visitedColor));
 
   bool underlineLinks =
     aPresContext->GetCachedBoolPref(kPresContext_UnderlineLinks);
   sheetText.AppendPrintf(
-      "*|*:-moz-any-link%s { text-decoration: %s; }\n",
+      "*|*:any-link%s { text-decoration: %s; }\n",
       underlineLinks ? ":not(svg|a)" : "",
       underlineLinks ? "underline" : "none");
 
   // Rules for focus styling.
 
   bool focusRingOnAnything = aPresContext->GetFocusRingOnAnything();
   uint8_t focusRingWidth = aPresContext->FocusRingWidth();
   uint8_t focusRingStyle = aPresContext->GetFocusRingStyle();
--- a/layout/style/res/ua.css
+++ b/layout/style/res/ua.css
@@ -107,21 +107,21 @@
 
 /* SVG documents don't always load this file but they do have links.
  * If you change the link rules, consider carefully whether to make
  * the same changes to svg.css.
  */
 
 /* Links */
 
-*|*:-moz-any-link {
+*|*:any-link {
   cursor: pointer;
 }
 
-*|*:-moz-any-link:-moz-focusring {
+*|*:any-link:-moz-focusring {
   /* Don't specify the outline-color, we should always use initial value. */
   outline: 1px dotted;
 }
 
 /* Miscellaneous */
 
 *|*::-moz-anonymous-block, *|*::-moz-cell-content {
   display: block !important;
--- a/layout/svg/svg.css
+++ b/layout/svg/svg.css
@@ -78,21 +78,21 @@ foreignObject {
 
 /* nsDocumentViewer::CreateStyleSet doesn't load ua.css.
  * A few styles are common to html and SVG though
  * so we copy the rules below from that file.
  */
 
 /* Links */
 
-*|*:-moz-any-link {
+*|*:any-link {
   cursor: pointer;
 }
 
-*|*:-moz-any-link:-moz-focusring {
+*|*:any-link:-moz-focusring {
   /* Don't specify the outline-color, we should always use initial value. */
   outline: 1px dotted;
 }
 
 /*
  * SVG-as-an-image needs this rule
  */
 *|*::-moz-viewport, *|*::-moz-viewport-scroll, *|*::-moz-canvas, *|*::-moz-scrolled-canvas {
--- a/mobile/android/themes/core/content.css
+++ b/mobile/android/themes/core/content.css
@@ -305,17 +305,17 @@ select:disabled > button {
 }
 
 /* display click to play when autoplay is blocked for videos */
 video:not([controls]) > xul|videocontrols {
   visibility: visible;
   -moz-binding: url("chrome://global/content/bindings/videocontrols.xml#noControls");
 }
 
-*:-moz-any-link:active,
+*:any-link:active,
 *[role=button]:active,
 button:not(:disabled):active,
 input:not(:focus):not(:disabled):active,
 select:not(:disabled):active,
 textarea:not(:focus):not(:disabled):active,
 option:active,
 label:active,
 xul|menulist:active {