Bug 1396073: Remove :-moz-empty-except-children-with-local-name. r=xidorn
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 27 Sep 2017 16:28:10 +0200
changeset 383460 736aac6f2c4d705e7d889b9dbd3cac25a37d4e1a
parent 383459 69d30bc2d04869e2214443e99f62c2986bbc6da8
child 383461 ec77f71780ff6e7f68478e2a22788d51f5ca3187
push id32594
push userkwierso@gmail.com
push dateThu, 28 Sep 2017 22:49:33 +0000
treeherdermozilla-central@6dea0ee45b66 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
bugs1396073
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1396073: Remove :-moz-empty-except-children-with-local-name. r=xidorn <applet> is not a thing anymore, and that selector in our UA sheet will never match anyway, since an <applet> element will never have the BROKEN state. MozReview-Commit-ID: 7UOMKOv55uJ Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
layout/style/nsCSSPseudoClassList.h
layout/style/nsCSSPseudoClasses.cpp
layout/style/nsCSSRuleProcessor.cpp
layout/style/res/html.css
--- a/layout/style/nsCSSPseudoClassList.h
+++ b/layout/style/nsCSSPseudoClassList.h
@@ -63,17 +63,16 @@
 
 // The CSS_PSEUDO_CLASS entries should all come before the
 // CSS_STATE_PSEUDO_CLASS entries.  The CSS_PSEUDO_CLASS entry order
 // must be the same as the order of cases in SelectorMatches.  :not
 // must be the last CSS_PSEUDO_CLASS.
 
 CSS_PSEUDO_CLASS(empty, ":empty", 0, "")
 CSS_PSEUDO_CLASS(mozOnlyWhitespace, ":-moz-only-whitespace", 0, "")
-CSS_PSEUDO_CLASS(mozEmptyExceptChildrenWithLocalname, ":-moz-empty-except-children-with-localname", 0, "")
 CSS_PSEUDO_CLASS(lang, ":lang", 0, "")
 CSS_PSEUDO_CLASS(root, ":root", 0, "")
 CSS_PSEUDO_CLASS(any, ":-moz-any", 0, "")
 
 CSS_PSEUDO_CLASS(firstChild, ":first-child", 0, "")
 CSS_PSEUDO_CLASS(firstNode, ":-moz-first-node", 0, "")
 CSS_PSEUDO_CLASS(lastChild, ":last-child", 0, "")
 CSS_PSEUDO_CLASS(lastNode, ":-moz-last-node", 0, "")
--- a/layout/style/nsCSSPseudoClasses.cpp
+++ b/layout/style/nsCSSPseudoClasses.cpp
@@ -84,17 +84,16 @@ void nsCSSPseudoClasses::AddRefAtoms()
 #include "nsCSSPseudoClassList.h"
 #undef CSS_PSEUDO_CLASS
 }
 
 bool
 nsCSSPseudoClasses::HasStringArg(Type aType)
 {
   return aType == Type::lang ||
-         aType == Type::mozEmptyExceptChildrenWithLocalname ||
          aType == Type::mozSystemMetric ||
          aType == Type::mozLocaleDir ||
          aType == Type::dir;
 }
 
 bool
 nsCSSPseudoClasses::HasNthPairArg(Type aType)
 {
--- a/layout/style/nsCSSRuleProcessor.cpp
+++ b/layout/style/nsCSSRuleProcessor.cpp
@@ -1790,42 +1790,16 @@ nsCSSRuleProcessor::StringPseudoMatches(
       {
         RefPtr<nsIAtom> metric = NS_Atomize(aString);
         if (!nsCSSRuleProcessor::HasSystemMetric(metric)) {
           return false;
         }
       }
       break;
 
-    case CSSPseudoClassType::mozEmptyExceptChildrenWithLocalname:
-      {
-        NS_ASSERTION(aString, "Must have string!");
-        const nsIContent *child = nullptr;
-        int32_t index = -1;
-
-        if (aForStyling) {
-          // FIXME:  This isn't sufficient to handle:
-          //   :-moz-empty-except-children-with-localname() + E
-          //   :-moz-empty-except-children-with-localname() ~ E
-          // because we don't know to restyle the grandparent of the
-          // inserted/removed element (as in bug 534804 for :empty).
-          *aSetSlowSelectorFlag = true;
-        }
-        do {
-          child = aElement->GetChildAt(++index);
-        } while (child &&
-                  (!IsSignificantChildMaybeThreadSafe(child, true, false) ||
-                  (child->GetNameSpaceID() == aElement->GetNameSpaceID() &&
-                    child->NodeInfo()->NameAtom()->Equals(nsDependentString(aString)))));
-        if (child) {
-          return false;
-        }
-      }
-      break;
-
     case CSSPseudoClassType::dir:
       {
         if (aDependence) {
           EventStates states = sPseudoClassStateDependences[
             static_cast<CSSPseudoClassTypeBase>(aPseudo)];
           if (aStateMask.HasAtLeastOneOfStates(states)) {
             *aDependence = true;
             return false;
--- a/layout/style/res/html.css
+++ b/layout/style/res/html.css
@@ -637,19 +637,17 @@ hr {
 }
 
 hr[size="1"] {
   border-style: solid none none none;
 }
 
 img:-moz-broken::before, input:-moz-broken::before,
 img:-moz-user-disabled::before, input:-moz-user-disabled::before,
-img:-moz-loading::before, input:-moz-loading::before,
-applet:-moz-empty-except-children-with-localname(param):-moz-broken::before,
-applet:-moz-empty-except-children-with-localname(param):-moz-user-disabled::before {
+img:-moz-loading::before, input:-moz-loading::before {
   content: -moz-alt-content !important;
   unicode-bidi: isolate;
 }
 
 :-moz-any(object,applet):-moz-any(:-moz-broken,:-moz-user-disabled) > *|* {
   /*
     Inherit in the object's alignment so that if we aren't aligned explicitly
     we'll end up in the right place vertically.  See bug 36997.  Note that this