Esempio n. 1
0
            internal string InternalGetExplicitRuleSelector()
            {
                // X:\jsc.svn\examples\javascript\CSS\Test\CSSSelectorReuse\CSSSelectorReuse\Application.cs

                //      page.Header.setAttribute("style-id", "45");
                //IStyleSheet.Default[CSSMediaTypes.print][
                //    //"#" + page.Header.id
                //    "[style-id='45']"

                IHTMLElement that = this;

                if (that == null)
                {
                    throw new InvalidOperationException();
                }

                // there can be only one body it seems.
                if (this.localName.ToLower() == "html")
                {
                    return(this.localName);
                }

                if (this.localName.ToLower() == "body")
                {
                    return(this.localName);
                }



                #region style-id
                var x = (string)that.getAttribute("style-id");


                if (string.IsNullOrEmpty(x))
                {
                    // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2014/201401/20140125/speed
                    // localName: "div"

                    //x = this.tagName + __style_id;
                    // localName: "div"
                    // tagName: "DIV"
                    // className: ""
                    // lassList: DOMTokenList

                    // are we building an Expression<> here?
                    //x = this.localName + "." + this.classList.FirstOrDefault() + "[" + __style_id + "]";
                    x = "" + __style_id;
                    this.setAttribute("style-id", x);

                    // 95ms css.style { selectorText = [style-id="table.__ContentTable[2]"] > tbody > tr > td }

                    __style_id++;
                }
                #endregion


                #region selectorText
                var selectorText = this.localName;

                // looks like cookie api access. lets talk to only the primary class thp
                var className = this.classList.FirstOrDefault();
                if (className != null)
                {
                    // do we need to do css escape?
                    selectorText += "." + className;
                }

                selectorText += "[style-id='" + x + "']";
                #endregion


                return(selectorText);
            }
Esempio n. 2
0
 static IHTMLObject InternalConstructor()
 {
     return((IHTMLObject)IHTMLElement.InternalConstructor(HTMLElementEnum.@object));
 }
Esempio n. 3
0
 static IHTMLFieldset InternalConstructor()
 {
     return((IHTMLFieldset)IHTMLElement.InternalConstructor(HTMLElementEnum.fieldset));
 }
Esempio n. 4
0
 internal static IHTMLUnorderedList InternalConstructor()
 {
     return((IHTMLUnorderedList)IHTMLElement.InternalConstructor(HTMLElementEnum.ul));
 }
Esempio n. 5
0
 static IHTMLAudio InternalConstructor()
 {
     return((IHTMLAudio)IHTMLElement.InternalConstructor(HTMLElementEnum.audio));
 }
Esempio n. 6
0
 internal static IHTMLLabel InternalConstructor()
 {
     return((IHTMLLabel)IHTMLElement.InternalConstructor(HTMLElementEnum.label));
 }
Esempio n. 7
0
 public IHTMLLabel(string e, IHTMLElement f)
 {
 }
 public static IEnumerable <IHTMLScript> ScriptElements(this IHTMLElement i)
 {
     return(i.querySelectorAll(IHTMLElement.HTMLElementEnum.script).Select(k => (IHTMLScript)k));
 }
Esempio n. 9
0
 static IHTMLLegend InternalConstructor()
 {
     return((IHTMLLegend)IHTMLElement.InternalConstructor(HTMLElementEnum.legend));
 }