Bug 1418232 - Part 2: Simplify Gecko_MatchLang a little. r=emilio
authorCameron McCormack <cam@mcc.id.au>
Fri, 17 Nov 2017 16:51:01 +0800
changeset 437094 160983b29535e1c3325d3590192b50edf57d91f6
parent 437093 bc28631ea477a2dd39f20cd28cf5986294e9188a
child 437095 d4753dc14b2ab9c42123b6d60a68106df40f45cd
child 437114 c6ff3a13495eb7143cf2f7ce80db081662686073
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +0000
reviewersemilio
bugs1418232
milestone59.0a1
Bug 1418232 - Part 2: Simplify Gecko_MatchLang a little. r=emilio MozReview-Commit-ID: 9dHoD5KQYvF
layout/style/ServoBindings.cpp
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -895,23 +895,20 @@ bool
 Gecko_MatchLang(RawGeckoElementBorrowed aElement,
                 nsAtom* aOverrideLang,
                 bool aHasOverrideLang,
                 const char16_t* aValue)
 {
   MOZ_ASSERT(!(aOverrideLang && !aHasOverrideLang),
              "aHasOverrideLang should only be set when aOverrideLang is null");
 
-  if (!aHasOverrideLang) {
-    return nsCSSPseudoClasses::LangPseudoMatches(aElement, nullptr, false,
-                                                 aValue, aElement->OwnerDoc());
-  }
-
-  return nsCSSPseudoClasses::LangPseudoMatches(aElement, aOverrideLang, true,
-                                               aValue, aElement->OwnerDoc());
+  return nsCSSPseudoClasses::LangPseudoMatches(
+      aElement,
+      aHasOverrideLang ? aOverrideLang : nullptr,
+      aHasOverrideLang, aValue, aElement->OwnerDoc());
 }
 
 nsAtom*
 Gecko_GetXMLLangValue(RawGeckoElementBorrowed aElement)
 {
   const nsAttrValue* attr =
     aElement->GetParsedAttr(nsGkAtoms::lang, kNameSpaceID_XML);