From 051c21928e1153bb63290a06db2aefdcb11b14ee Mon Sep 17 00:00:00 2001 From: Thomas Wisniewski Date: Tue, 19 Jul 2016 23:13:13 -0400 Subject: [PATCH] Bug 843579 - Unprefix -moz-any-link. r=bz --HG-- extra : rebase_source : d5ad8227cc118491f130e1fef01829c594cc9477 --- b2g/chrome/content/content.css | 2 +- .../inspector/rules/test/browser_rules_user-agent-styles.js | 4 ++-- layout/inspector/inDOMUtils.cpp | 5 +++-- layout/inspector/inIDOMUtils.idl | 2 +- layout/inspector/tests/chrome/test_bug708874.xul | 2 +- layout/mathml/mathml.css | 2 +- layout/style/contenteditable.css | 2 +- layout/style/nsCSSPseudoClassList.h | 2 ++ layout/style/nsLayoutStylesheetCache.cpp | 4 ++-- layout/style/res/ua.css | 4 ++-- layout/svg/svg.css | 4 ++-- mobile/android/themes/core/content.css | 2 +- 12 files changed, 19 insertions(+), 16 deletions(-) diff --git a/b2g/chrome/content/content.css b/b2g/chrome/content/content.css index c32f4dbbf7d0..2b73b16b38e8 100644 --- a/b2g/chrome/content/content.css +++ b/b2g/chrome/content/content.css @@ -297,7 +297,7 @@ select[disabled] > button { padding: 1px 7px 1px 7px; } -*:-moz-any-link:active, +*:any-link:active, *[role=button]:active, button:active, option:active, diff --git a/devtools/client/inspector/rules/test/browser_rules_user-agent-styles.js b/devtools/client/inspector/rules/test/browser_rules_user-agent-styles.js index 1a8a56cc4cee..9a3d4f658b8e 100644 --- a/devtools/client/inspector/rules/test/browser_rules_user-agent-styles.js +++ b/devtools/client/inspector/rules/test/browser_rules_user-agent-styles.js @@ -116,8 +116,8 @@ function* userAgentStylesVisible(inspector, view) { // 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"); diff --git a/layout/inspector/inDOMUtils.cpp b/layout/inspector/inDOMUtils.cpp index 3b3b3c5a3aa3..d1d907737b98 100644 --- a/layout/inspector/inDOMUtils.cpp +++ b/layout/inspector/inDOMUtils.cpp @@ -1216,9 +1216,10 @@ GetStatesForPseudoClass(const nsAString& 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 diff --git a/layout/inspector/inIDOMUtils.idl b/layout/inspector/inIDOMUtils.idl index a4be275024b2..08dfed87c60d 100644 --- a/layout/inspector/inIDOMUtils.idl +++ b/layout/inspector/inIDOMUtils.idl @@ -184,7 +184,7 @@ interface inIDOMUtils : nsISupports [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); diff --git a/layout/inspector/tests/chrome/test_bug708874.xul b/layout/inspector/tests/chrome/test_bug708874.xul index 24056b321cb4..0896d1eca535 100644 --- a/layout/inspector/tests/chrome/test_bug708874.xul +++ b/layout/inspector/tests/chrome/test_bug708874.xul @@ -243,7 +243,7 @@ function testMultiple() { 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]; diff --git a/layout/mathml/mathml.css b/layout/mathml/mathml.css index c4a153a27055..44a4c31c9143 100644 --- a/layout/mathml/mathml.css +++ b/layout/mathml/mathml.css @@ -64,7 +64,7 @@ ms[rquote]:after { /**************************************************************************/ /* Links */ /**************************************************************************/ -:-moz-any-link { +:any-link { text-decoration: none !important; } diff --git a/layout/style/contenteditable.css b/layout/style/contenteditable.css index 436ecb053d7f..c550bc7c90f1 100644 --- a/layout/style/contenteditable.css +++ b/layout/style/contenteditable.css @@ -37,7 +37,7 @@ 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; } diff --git a/layout/style/nsCSSPseudoClassList.h b/layout/style/nsCSSPseudoClassList.h index 624bf41e079f..7d8e85c3c34e 100644 --- a/layout/style/nsCSSPseudoClassList.h +++ b/layout/style/nsCSSPseudoClassList.h @@ -146,6 +146,8 @@ 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) diff --git a/layout/style/nsLayoutStylesheetCache.cpp b/layout/style/nsLayoutStylesheetCache.cpp index 66f25ac34f0d..005b950d06b9 100644 --- a/layout/style/nsLayoutStylesheetCache.cpp +++ b/layout/style/nsLayoutStylesheetCache.cpp @@ -882,7 +882,7 @@ nsLayoutStylesheetCache::BuildPreferenceSheet(StyleSheetHandle::RefPtr* aSheet, 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), @@ -891,7 +891,7 @@ nsLayoutStylesheetCache::BuildPreferenceSheet(StyleSheetHandle::RefPtr* aSheet, 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"); diff --git a/layout/style/res/ua.css b/layout/style/res/ua.css index 944e2c5b91a8..637f0ad31e30 100644 --- a/layout/style/res/ua.css +++ b/layout/style/res/ua.css @@ -112,11 +112,11 @@ /* 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; } diff --git a/layout/svg/svg.css b/layout/svg/svg.css index e367c3cb61f8..fb45b0e05d62 100644 --- a/layout/svg/svg.css +++ b/layout/svg/svg.css @@ -83,11 +83,11 @@ foreignObject { /* 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; } diff --git a/mobile/android/themes/core/content.css b/mobile/android/themes/core/content.css index b85cdc594e83..74a6c5d814ea 100644 --- a/mobile/android/themes/core/content.css +++ b/mobile/android/themes/core/content.css @@ -310,7 +310,7 @@ video:not([controls]) > xul|videocontrols { -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,