public override ApplyState Apply(ComputedStyle style, Value value)
        {
            // special case for list-item as we'll be creating the marker too:
            if (style.DisplayX == DisplayMode.ListItem)
            {
                // Update the marker selector:
                MarkerSelector.Update(style);
            }
            else
            {
                // (Remove marker if there is one)
                style.RemoveVirtual(MarkerSelector.Priority);
            }

            // Ok!
            return(ApplyState.Ok);
        }
Exemple #2
0
        /// <summary>Closes this dropdown.</summary>
        public void Hide()
        {
            if (!Dropped)
            {
                return;
            }

            // Clear the child nodes (we don't want them to think they've been removed from the DOM):
            Dropdown.childNodes_ = null;
            Dropdown             = null;

            // Get the CS of the HTML node:
            ComputedStyle computed = htmlDocument.html.Style.Computed;

            // Remove:
            computed.RemoveVirtual(HtmlDropdownElement.Priority);
        }
        public override ApplyState Apply(ComputedStyle style, Value value)
        {
            int display = 0;

            if (value == null)
            {
                // Assume inline if blank:
                display = DisplayMode.Inline;
            }
            else if (value is ValueSet)
            {
                // Outside + Inside or list-item
                int first = value[0].GetInteger(null, null);

                if (first == DisplayMode.ListItem)
                {
                    // Get outside mode:
                    display = DisplayMode.InternalListItem | value[1].GetInteger(null, null);

                    if (value.Count > 2)
                    {
                        // Get inside mode (just flow or flow-root allowed):
                        int insideMode = value[2].GetInteger(null, null);

                        if ((insideMode & InsideFlowOrRoot) != 0)
                        {
                            display |= insideMode;
                        }
                    }
                }
                else
                {
                    display = first | value[1].GetInteger(null, null);
                }
            }
            else
            {
                // "Legacy" or other shortform.
                display = value.GetInteger(null, null);

                // special case for list-item as we'll be creating the marker too:
                if (display == DisplayMode.ListItem)
                {
                    // Update the marker selector:
                    MarkerSelector.Update(style);
                }
                else
                {
                    // (Remove marker if there is one)
                    style.RemoveVirtual(MarkerSelector.Priority);
                }
            }

            // Write the display value to the style:
            style[GlobalProperty] = new Css.Units.CachedIntegerUnit(value, display);

            style.RequestLayout();

            // Ok!
            return(ApplyState.ReloadValue);
        }