public virtual void TestDisabledSelector()
        {
            String filename = sourceFolder + "disabled.html";
            CssPseudoClassDisabledSelectorItem item = CssPseudoClassDisabledSelectorItem.GetInstance();
            IXmlParser    htmlParser   = new JsoupHtmlParser();
            IDocumentNode documentNode = htmlParser.Parse(new FileStream(filename, FileMode.Open, FileAccess.Read), "UTF-8"
                                                          );
            IElementNode disabledInput = new JsoupElementNode(((JsoupDocumentNode)documentNode).GetDocument().GetElementsByTag
                                                                  ("input").First());
            IElementNode enabledInput = new JsoupElementNode(((JsoupDocumentNode)documentNode).GetDocument().GetElementsByTag
                                                                 ("input")[1]);

            NUnit.Framework.Assert.IsFalse(item.Matches(documentNode));
            NUnit.Framework.Assert.IsTrue(item.Matches(disabledInput));
            NUnit.Framework.Assert.IsFalse(item.Matches(enabledInput));
            NUnit.Framework.Assert.IsFalse(item.Matches(null));
        }
        public static iText.StyledXmlParser.Css.Selector.Item.CssPseudoClassSelectorItem Create(String pseudoClass
                                                                                                , String arguments)
        {
            switch (pseudoClass)
            {
            case CommonCssConstants.EMPTY: {
                return(CssPseudoClassEmptySelectorItem.GetInstance());
            }

            case CommonCssConstants.FIRST_CHILD: {
                return(CssPseudoClassFirstChildSelectorItem.GetInstance());
            }

            case CommonCssConstants.FIRST_OF_TYPE: {
                return(CssPseudoClassFirstOfTypeSelectorItem.GetInstance());
            }

            case CommonCssConstants.LAST_CHILD: {
                return(CssPseudoClassLastChildSelectorItem.GetInstance());
            }

            case CommonCssConstants.LAST_OF_TYPE: {
                return(CssPseudoClassLastOfTypeSelectorItem.GetInstance());
            }

            case CommonCssConstants.NTH_CHILD: {
                return(new CssPseudoClassNthChildSelectorItem(arguments));
            }

            case CommonCssConstants.NTH_OF_TYPE: {
                return(new CssPseudoClassNthOfTypeSelectorItem(arguments));
            }

            case CommonCssConstants.NOT: {
                CssSelector selector = new CssSelector(arguments);
                foreach (ICssSelectorItem item in selector.GetSelectorItems())
                {
                    if (item is CssPseudoClassNotSelectorItem || item is CssPseudoElementSelectorItem)
                    {
                        return(null);
                    }
                }
                return(new CssPseudoClassNotSelectorItem(selector));
            }

            case CommonCssConstants.ROOT: {
                return(CssPseudoClassRootSelectorItem.GetInstance());
            }

            case CommonCssConstants.LINK: {
                return(new CssPseudoClassSelectorItem.AlwaysApplySelectorItem(pseudoClass, arguments));
            }

            case CommonCssConstants.ACTIVE:
            case CommonCssConstants.FOCUS:
            case CommonCssConstants.HOVER:
            case CommonCssConstants.TARGET:
            case CommonCssConstants.VISITED: {
                return(new CssPseudoClassSelectorItem.AlwaysNotApplySelectorItem(pseudoClass, arguments));
            }

            case CommonCssConstants.DISABLED: {
                return(CssPseudoClassDisabledSelectorItem.GetInstance());
            }

            default: {
                //Still unsupported, should be addressed in DEVSIX-1440
                //case CommonCssConstants.CHECKED:
                //case CommonCssConstants.ENABLED:
                //case CommonCssConstants.IN_RANGE:
                //case CommonCssConstants.INVALID:
                //case CommonCssConstants.LANG:
                //case CommonCssConstants.NTH_LAST_CHILD:
                //case CommonCssConstants.NTH_LAST_OF_TYPE:
                //case CommonCssConstants.ONLY_OF_TYPE:
                //case CommonCssConstants.ONLY_CHILD:
                //case CommonCssConstants.OPTIONAL:
                //case CommonCssConstants.OUT_OF_RANGE:
                //case CommonCssConstants.READ_ONLY:
                //case CommonCssConstants.READ_WRITE:
                //case CommonCssConstants.REQUIRED:
                //case CommonCssConstants.VALID:
                return(null);
            }
            }
        }