public bool TransferFromBlock(nsCSSExpandedDataBlock aFromBlock, CssProperty aPropID,
     bool aIsImportant, bool aOverrideImportant, bool aMustCallValueAppended, CssDeclaration aDeclaration)
 {
     if (!nsCSSProps.IsShorthand(aPropID))
         return DoTransferFromBlock(aFromBlock, aPropID, aIsImportant, aOverrideImportant, aMustCallValueAppended, aDeclaration);
     bool changed = false;
     foreach (CssProperty p in nsCSSProps.SubpropertyEntryFor(aPropID, true))
         changed |= DoTransferFromBlock(aFromBlock, p, aIsImportant, aOverrideImportant, aMustCallValueAppended, aDeclaration);
     return changed;
 }
        public bool TryReplaceValue(CssProperty aProperty, nsCSSExpandedDataBlock aFromBlock, ref bool aChanged)
        {
            CssValue newValue = aFromBlock.mValues[(int)aProperty];

            int oldValue = IndexFor(aProperty);
            if (oldValue == -1) {
                aChanged = false;
                return false;
            }

            aChanged = MoveValue(ref newValue, ref mData[oldValue].mValue);
            aFromBlock.mPropertiesSet.RemoveProperty(aProperty);
            return true;
        }
        public bool TransferFromBlock(nsCSSExpandedDataBlock aFromBlock, CssProperty aPropID,
                                      bool aIsImportant, bool aOverrideImportant, bool aMustCallValueAppended, CssDeclaration aDeclaration)
        {
            if (!nsCSSProps.IsShorthand(aPropID))
            {
                return(DoTransferFromBlock(aFromBlock, aPropID, aIsImportant, aOverrideImportant, aMustCallValueAppended, aDeclaration));
            }
            bool changed = false;

            foreach (CssProperty p in nsCSSProps.SubpropertyEntryFor(aPropID, true))
            {
                changed |= DoTransferFromBlock(aFromBlock, p, aIsImportant, aOverrideImportant, aMustCallValueAppended, aDeclaration);
            }
            return(changed);
        }
Example #4
0
        public bool TryReplaceValue(CssProperty aProperty, nsCSSExpandedDataBlock aFromBlock, ref bool aChanged)
        {
            CssValue newValue = aFromBlock.mValues[(int)aProperty];

            int oldValue = IndexFor(aProperty);

            if (oldValue == -1)
            {
                aChanged = false;
                return(false);
            }

            aChanged = MoveValue(ref newValue, ref mData[oldValue].mValue);
            aFromBlock.mPropertiesSet.RemoveProperty(aProperty);
            return(true);
        }
Example #5
0
        internal bool TryReplaceValue(CssProperty aProperty, bool aIsImportant, nsCSSExpandedDataBlock aFromBlock, ref bool aChanged)
        {
            AssertMutable();
            Debug.Assert(mData != null, "called while expanded");

            if (nsCSSProps.IsShorthand(aProperty))
            {
                aChanged = false;
                return(false);
            }
            nsCSSCompressedDataBlock block = aIsImportant ? mImportantData : mData;

            if (block == null)
            {
                aChanged = false;
                return(false);
            }
            return(block.TryReplaceValue(aProperty, aFromBlock, ref aChanged));
        }
        private bool DoTransferFromBlock(nsCSSExpandedDataBlock aFromBlock, CssProperty aPropID,
                                         bool aIsImportant, bool aOverrideImportant, bool aMustCallValueAppended, CssDeclaration aDeclaration)
        {
            bool changed = false;

            if (aIsImportant)
            {
                if (!mPropertiesImportant.HasProperty(aPropID))
                {
                    changed = true;
                }
                mPropertiesImportant.AddProperty(aPropID);
            }
            else
            {
                if (mPropertiesImportant.HasProperty(aPropID))
                {
                    if (!aOverrideImportant)
                    {
                        aFromBlock.ClearLonghandProperty(aPropID);
                        return(false);
                    }
                    changed = true;
                    mPropertiesImportant.RemoveProperty(aPropID);
                }
            }

            if (aMustCallValueAppended || !mPropertiesSet.HasProperty(aPropID))
            {
                aDeclaration.ValueAppended(aPropID);
            }

            mPropertiesSet.AddProperty(aPropID);
            aFromBlock.mPropertiesSet.RemoveProperty(aPropID);
            changed |= MoveValue(ref aFromBlock.mValues[(int)aPropID], ref mValues[(int)aPropID]);

            return(changed);
        }
Example #7
0
 internal void ExpandTo(nsCSSExpandedDataBlock aExpandedData)
 {
     AssertMutable();
     aExpandedData.AssertInitialState();
     aExpandedData.Expand(mData, mImportantData);
 }
Example #8
0
 internal void CompressFrom(nsCSSExpandedDataBlock aExpandedData)
 {
     aExpandedData.Compress(out mData, out mImportantData);
     aExpandedData.AssertInitialState();
 }
Example #9
0
 internal void ExpandTo(nsCSSExpandedDataBlock aExpandedData)
 {
     AssertMutable();
     aExpandedData.AssertInitialState();
     aExpandedData.Expand(mData, mImportantData);
 }
Example #10
0
 internal void CompressFrom(nsCSSExpandedDataBlock aExpandedData)
 {
     aExpandedData.Compress(out mData, out mImportantData);
     aExpandedData.AssertInitialState();
 }
Example #11
0
        internal bool TryReplaceValue(CssProperty aProperty, bool aIsImportant, nsCSSExpandedDataBlock aFromBlock, ref bool aChanged)
        {
            AssertMutable();
            Debug.Assert(mData != null, "called while expanded");

            if (nsCSSProps.IsShorthand(aProperty)) {
                aChanged = false;
                return false;
            }
            nsCSSCompressedDataBlock block = aIsImportant ? mImportantData : mData;
            if (block == null) {
                aChanged = false;
                return false;
            }
            return block.TryReplaceValue(aProperty, aFromBlock, ref aChanged);
        }
        private bool DoTransferFromBlock(nsCSSExpandedDataBlock aFromBlock, CssProperty aPropID,
            bool aIsImportant, bool aOverrideImportant, bool aMustCallValueAppended, CssDeclaration aDeclaration)
        {
            bool changed = false;
            if (aIsImportant) {
                if (!mPropertiesImportant.HasProperty(aPropID))
                    changed = true;
                mPropertiesImportant.AddProperty(aPropID);
            }
            else {
                if (mPropertiesImportant.HasProperty(aPropID)) {
                    if (!aOverrideImportant) {
                        aFromBlock.ClearLonghandProperty(aPropID);
                        return false;
                    }
                    changed = true;
                    mPropertiesImportant.RemoveProperty(aPropID);
                }
            }

            if (aMustCallValueAppended || !mPropertiesSet.HasProperty(aPropID)) {
                aDeclaration.ValueAppended(aPropID);
            }

            mPropertiesSet.AddProperty(aPropID);
            aFromBlock.mPropertiesSet.RemoveProperty(aPropID);
            changed |= MoveValue(ref aFromBlock.mValues[(int)aPropID], ref mValues[(int)aPropID]);

            return changed;
        }