Example #1
0
        private bool ApplyGlobalKeyword(StylePropertyReader reader, ComputedStyle parentStyle)
        {
            var handle = reader.GetValue(0).handle;

            if (handle.valueType == StyleValueType.Keyword)
            {
                if ((StyleValueKeyword)handle.valueIndex == StyleValueKeyword.Initial)
                {
                    ApplyInitialValue(reader);
                    return(true);
                }
                if ((StyleValueKeyword)handle.valueIndex == StyleValueKeyword.Unset)
                {
                    if (parentStyle == null)
                    {
                        ApplyInitialValue(reader);
                    }
                    else
                    {
                        ApplyUnsetValue(reader, parentStyle);
                    }
                    return(true);
                }
            }

            return(false);
        }
Example #2
0
        private void ApplyCustomStyleProperty(StylePropertyReader reader)
        {
            dpiScaling = reader.dpiScaling;
            if (customProperties == null)
            {
                customProperties = new Dictionary <string, StylePropertyValue>();
            }

            var styleProperty = reader.property;

            // Custom property only support one value
            StylePropertyValue customProp = reader.GetValue(0);

            customProperties[styleProperty.name] = customProp;
        }
Example #3
0
        private void ApplyCustomStyleProperty(StylePropertyReader reader)
        {
            if (m_CustomProperties == null)
            {
                m_CustomProperties = new Dictionary <string, StylePropertyValue>();
            }

            var styleProperty = reader.property;

            StylePropertyValue customProp = default(StylePropertyValue);

            if (!m_CustomProperties.TryGetValue(styleProperty.name, out customProp))
            {
                // Custom property only support one value
                customProp = reader.GetValue(0);
            }
            m_CustomProperties[styleProperty.name] = customProp;
        }
Example #4
0
        private bool ApplyGlobalKeyword(StylePropertyReader reader, ref ComputedStyle parentStyle)
        {
            var handle = reader.GetValue(0).handle;

            if (handle.valueType == StyleValueType.Keyword)
            {
                switch ((StyleValueKeyword)handle.valueIndex)
                {
                case StyleValueKeyword.Initial:
                    ApplyInitialValue(reader);
                    return(true);

                case StyleValueKeyword.Unset:
                    ApplyUnsetValue(reader, ref parentStyle);
                    return(true);
                }
            }

            return(false);
        }