Bug 1270406 - Remove :-moz-dir support. draft
authorAstley Chen <aschen@mozilla.com>
Tue, 22 Nov 2016 23:05:18 +0800
changeset 442502 76464ad40bcd010f168b7fdac1b07b910a58401f
parent 442501 ff744e7a417c452a3a3b9b8cbd4cfa4915b4222d
child 537801 cfdb42a81c12115c24ced8139df837b9de33af2a
push id36705
push useraschen@mozilla.com
push dateTue, 22 Nov 2016 15:05:57 +0000
bugs1270406
milestone53.0a1
Bug 1270406 - Remove :-moz-dir support. MozReview-Commit-ID: HRBj6YF4hZS
layout/style/nsCSSParser.cpp
layout/style/nsCSSPseudoClassList.h
layout/style/nsCSSPseudoClasses.cpp
layout/style/nsCSSRuleProcessor.cpp
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -6331,17 +6331,16 @@ CSSParserImpl::ParsePseudoClassWithIdent
     UngetToken();
     return eSelectorParsingStatus_Error; // our caller calls SkipUntil(')')
   }
 
   // -moz-locale-dir and dir take an identifier argument.  While
   // only 'ltr' and 'rtl' (case-insensitively) will match anything, any
   // other identifier is still valid.
   if (aType == CSSPseudoClassType::mozLocaleDir ||
-      aType == CSSPseudoClassType::mozDir ||
       aType == CSSPseudoClassType::dir) {
     nsContentUtils::ASCIIToLower(mToken.mIdent); // case insensitive
   }
 
   // Add the pseudo with the language parameter
   aSelector.AddPseudoClass(aType, mToken.mIdent.get());
 
   // close the parenthesis
--- a/layout/style/nsCSSPseudoClassList.h
+++ b/layout/style/nsCSSPseudoClassList.h
@@ -133,19 +133,16 @@ CSS_PSEUDO_CLASS(scope, ":scope", 0, "la
 // :not needs to come at the end of the non-bit pseudo-class list, since
 // it doesn't actually get directly matched on in SelectorMatches.
 CSS_PSEUDO_CLASS(negation, ":not", 0, "")
 
 // :dir(ltr) and :dir(rtl) match elements whose resolved
 // directionality in the markup language is ltr or rtl respectively.
 CSS_STATE_DEPENDENT_PSEUDO_CLASS(dir, ":dir", 0, "",
                                  NS_EVENT_STATE_LTR | NS_EVENT_STATE_RTL)
-// 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)
--- a/layout/style/nsCSSPseudoClasses.cpp
+++ b/layout/style/nsCSSPseudoClasses.cpp
@@ -83,17 +83,16 @@ void nsCSSPseudoClasses::AddRefAtoms()
 
 bool
 nsCSSPseudoClasses::HasStringArg(Type aType)
 {
   return aType == Type::lang ||
          aType == Type::mozEmptyExceptChildrenWithLocalname ||
          aType == Type::mozSystemMetric ||
          aType == Type::mozLocaleDir ||
-         aType == Type::mozDir ||
          aType == Type::dir;
 }
 
 bool
 nsCSSPseudoClasses::HasNthPairArg(Type aType)
 {
   return aType == Type::nthChild ||
          aType == Type::nthLastChild ||
--- a/layout/style/nsCSSRuleProcessor.cpp
+++ b/layout/style/nsCSSRuleProcessor.cpp
@@ -2076,17 +2076,16 @@ static bool SelectorMatches(Element* aEl
             browserFrame = do_QueryInterface(aElement);
           if (!browserFrame ||
               !browserFrame->GetReallyIsBrowser()) {
             return false;
           }
         }
         break;
 
-      case CSSPseudoClassType::mozDir:
       case CSSPseudoClassType::dir:
         {
           if (aDependence) {
             EventStates states = sPseudoClassStateDependences[
               static_cast<CSSPseudoClassTypeBase>(pseudoClass->mType)];
             if (aNodeMatchContext.mStateMask.HasAtLeastOneOfStates(states)) {
               *aDependence = true;
               return false;