예제 #1
0
        private void parsePseudoElement()
        {
            pseudoElementSelector pseudoelement = new pseudoElementSelector();

            pseudoelement.wholeText = _selectorText;

            if (_buffer.Length > 0)
            {
                pseudoelement.elementE = AppendCleanBuffer(_buffer);
            }

            char current = ReadNext();

            while (!stop)
            {
                if (current == ':')
                {
                    if (_buffer.Length > 0)
                    {
                        pseudoelement.elementE += AppendCleanBuffer(_buffer);
                    }
                }
                else
                {
                    _buffer.Append(current);
                }
                current = ReadNext();
            }

            pseudoelement.matchElement = AppendCleanBuffer(_buffer);

            simple = pseudoelement;
        }
예제 #2
0
        private static bool matchPseudoElement(Element element, pseudoElementSelector pseudoElement)
        {
            if (!string.IsNullOrEmpty(pseudoElement.elementE))
            {
                if (!selectorMatch.Match(element, pseudoElement.ElementSelector))
                {
                    return(false);
                }
            }

            //E::first-line	the first formatted line of an E element	The ::first-line pseudo-element	1
            //E::first-letter	the first formatted letter of an E element	The ::first-letter pseudo-element	1
            //E::before	generated content before an E element	The ::before pseudo-element	2
            //E::after	generated content after an E element

            //TODO: when applying style of this class to element, it may requires to alter the element text.
            return(true);
        }