Bug 1243734: Part 4. Handle mask webkit alias. draft
authorCJKu <cku@mozilla.com>
Thu, 18 Feb 2016 17:58:02 +0800
changeset 331775 46debc28ac7e52c3121bac4fc1dc652a41c0e383
parent 331774 1e55d7f26b8baf16f0a6ff60757e7e309253c99e
child 331776 32a8ded553eb2b4111ecf067ec050c0f39205351
push id11080
push usercku@mozilla.com
push dateThu, 18 Feb 2016 09:58:55 +0000
bugs1243734
milestone47.0a1
Bug 1243734: Part 4. Handle mask webkit alias. MozReview-Commit-ID: IVZjLxGZe14
layout/inspector/inDOMUtils.cpp
layout/style/nsCSSProps.cpp
--- a/layout/inspector/inDOMUtils.cpp
+++ b/layout/inspector/inDOMUtils.cpp
@@ -489,16 +489,17 @@ inDOMUtils::IsInheritedProperty(const ns
   }
 
   nsStyleStructID sid = nsCSSProps::kSIDTable[prop];
   *_retval = !nsCachedStyleData::IsReset(sid);
   return NS_OK;
 }
 
 extern const char* const kCSSRawProperties[];
+extern nsCSSProperty gAliases[];
 
 NS_IMETHODIMP
 inDOMUtils::GetCSSPropertyNames(uint32_t aFlags, uint32_t* aCount,
                                 char16_t*** aProps)
 {
   // maxCount is the largest number of properties we could have; our actual
   // number might be smaller because properties might be disabled.
   uint32_t maxCount;
@@ -543,16 +544,19 @@ inDOMUtils::GetCSSPropertyNames(uint32_t
                                     CSS_PROPERTY_IS_ALIAS)) {
         DO_PROP(prop);
       }
     }
   }
 
   if (aFlags & INCLUDE_ALIASES) {
     for (prop = eCSSProperty_COUNT; prop < eCSSProperty_COUNT_with_aliases; ++prop) {
+      if (!nsCSSProps::IsEnabled(gAliases[prop - eCSSProperty_COUNT])) {
+        continue;
+      }
       DO_PROP(prop);
     }
   }
 
 #undef DO_PROP
 
   *aCount = propCount;
   *aProps = props;
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -149,18 +149,21 @@ SortPropertyAndCount(const void* s1, con
 }
 
 // We need eCSSAliasCount so we can make gAliases nonzero size when there
 // are no aliases.
 enum {
   eCSSAliasCount = eCSSProperty_COUNT_with_aliases - eCSSProperty_COUNT
 };
 
+// required to make the symbol external, so that inDOMUtils.cpp can link with it
+extern nsCSSProperty gAliases[];
+
 // The names are in kCSSRawProperties.
-static nsCSSProperty gAliases[eCSSAliasCount != 0 ? eCSSAliasCount : 1] = {
+nsCSSProperty gAliases[eCSSAliasCount != 0 ? eCSSAliasCount : 1] = {
 #define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_, pref_)  \
   eCSSProperty_##propid_ ,
 #include "nsCSSPropAliasList.h"
 #undef CSS_PROP_ALIAS
 };
 
 nsStaticCaseInsensitiveNameTable*
 CreateStaticTable(const char* const aRawTable[], int32_t aLength)