Пример #1
0
        public static string[] GetLonghandPropertyNames(string shorthandName)
        {
            StylePropertyId id;
            bool            flag = StylePropertyUtil.s_NameToId.TryGetValue(shorthandName, out id);

            string[] result;
            if (flag)
            {
                bool flag2 = StyleDebug.IsShorthandProperty(id);
                if (flag2)
                {
                    result = StyleDebug.GetLonghandPropertyNames(id);
                    return(result);
                }
            }
            result = null;
            return(result);
        }
Пример #2
0
        public static Type GetComputedStyleType(string name)
        {
            StylePropertyId id;
            bool            flag = StylePropertyUtil.s_NameToId.TryGetValue(name, out id);
            Type            result;

            if (flag)
            {
                bool flag2 = !StyleDebug.IsShorthandProperty(id);
                if (flag2)
                {
                    result = StyleDebug.GetComputedStyleType(id);
                    return(result);
                }
            }
            result = null;
            return(result);
        }
Пример #3
0
        public static void FindSpecifiedStyles(ComputedStyle computedStyle, IEnumerable <SelectorMatchRecord> matchRecords, Dictionary <StylePropertyId, int> result)
        {
            result.Clear();
            bool flag = computedStyle == null;

            if (!flag)
            {
                foreach (SelectorMatchRecord current in matchRecords)
                {
                    int  value             = current.complexSelector.specificity;
                    bool isUnityStyleSheet = current.sheet.isUnityStyleSheet;
                    if (isUnityStyleSheet)
                    {
                        value = -1;
                    }
                    StyleProperty[] properties = current.complexSelector.rule.properties;
                    StyleProperty[] array      = properties;
                    for (int i = 0; i < array.Length; i++)
                    {
                        StyleProperty   styleProperty = array[i];
                        StylePropertyId stylePropertyId;
                        bool            flag2 = StylePropertyUtil.s_NameToId.TryGetValue(styleProperty.name, out stylePropertyId);
                        if (flag2)
                        {
                            bool flag3 = StyleDebug.IsShorthandProperty(stylePropertyId);
                            if (flag3)
                            {
                                string[] longhandPropertyNames = StyleDebug.GetLonghandPropertyNames(stylePropertyId);
                                string[] array2 = longhandPropertyNames;
                                for (int j = 0; j < array2.Length; j++)
                                {
                                    string          name = array2[j];
                                    StylePropertyId stylePropertyIdFromName = StyleDebug.GetStylePropertyIdFromName(name);
                                    result[stylePropertyIdFromName] = value;
                                }
                            }
                            else
                            {
                                result[stylePropertyId] = value;
                            }
                        }
                    }
                }
                StylePropertyId[] inheritedProperties = StyleDebug.GetInheritedProperties();
                StylePropertyId[] array3 = inheritedProperties;
                for (int k = 0; k < array3.Length; k++)
                {
                    StylePropertyId stylePropertyId2 = array3[k];
                    bool            flag4            = result.ContainsKey(stylePropertyId2);
                    if (!flag4)
                    {
                        object computedStyleValue  = StyleDebug.GetComputedStyleValue(computedStyle, stylePropertyId2);
                        object computedStyleValue2 = StyleDebug.GetComputedStyleValue(InitialStyle.Get(), stylePropertyId2);
                        bool   flag5 = !computedStyleValue.Equals(computedStyleValue2);
                        if (flag5)
                        {
                            result[stylePropertyId2] = 2147483646;
                        }
                    }
                }
            }
        }