Ejemplo n.º 1
0
        public void CSSStyleDeclarationBoundInboundDirection()
        {
            var element = new HtmlSpanElement(document);
            var text    = "background-color: red; color: black;";

            element.Style.CssText = text;
            Assert.AreEqual(text, element.GetAttribute("style"));
            Assert.AreEqual(2, element.Style.Length);
        }
Ejemplo n.º 2
0
        public void CSSStyleDeclarationBoundInboundDirection()
        {
            var context  = BrowsingContext.New(new Configuration().WithCss());
            var document = new HtmlDocument(context);
            var element  = new HtmlSpanElement(document);
            var text     = "background-color: rgb(255, 0, 0); color: rgb(0, 0, 0);";

            element.Style.CssText = text;
            Assert.AreEqual(text, element.GetAttribute("style"));
            Assert.AreEqual(2, element.Style.Length);
        }