Пример #1
0
        public void TestMatchesEmpty()
        {
            MediaList ssList   = new MediaList(String.Empty);
            MediaList rendList = new MediaList("screen");

            Assert.IsTrue(ssList.Matches(rendList));
        }
Пример #2
0
        public void TestMatchesAll()
        {
            MediaList ssList   = new MediaList("all");
            MediaList rendList = new MediaList("screen");

            Assert.IsTrue(ssList.Matches(rendList));
        }
Пример #3
0
        public void TestMatchesNoMatch()
        {
            MediaList ssList   = new MediaList("dummy");
            MediaList rendList = new MediaList("screen");

            Assert.IsTrue(!ssList.Matches(rendList));
        }
Пример #4
0
        public void TestMatchesMultiple1()
        {
            MediaList ssList   = new MediaList("foo, screen");
            MediaList rendList = new MediaList("screen");

            Assert.IsTrue(ssList.Matches(rendList));
        }
Пример #5
0
 /// <summary>
 /// Used to find matching style rules in the cascading order
 /// </summary>
 /// <param name="elt">The element to find styles for</param>
 /// <param name="pseudoElt">The pseudo-element to find styles for</param>
 /// <param name="ml">The medialist that the document is using</param>
 /// <param name="csd">A CssStyleDeclaration that holds the collected styles</param>
 protected internal override void GetStylesForElement(XmlElement elt, string pseudoElt, MediaList ml, CssCollectedStyleDeclaration csd)
 {
     if (_media.Matches(ml))
     {
         ((CssStyleSheet)StyleSheet).GetStylesForElement(elt, pseudoElt, ml, csd);
     }
 }