public void TestMatchesEmpty() { MediaList ssList = new MediaList(String.Empty); MediaList rendList = new MediaList("screen"); Assert.IsTrue(ssList.Matches(rendList)); }
public void TestMatchesAll() { MediaList ssList = new MediaList("all"); MediaList rendList = new MediaList("screen"); Assert.IsTrue(ssList.Matches(rendList)); }
public void TestMatchesNoMatch() { MediaList ssList = new MediaList("dummy"); MediaList rendList = new MediaList("screen"); Assert.IsTrue(!ssList.Matches(rendList)); }
public void TestMatchesMultiple1() { MediaList ssList = new MediaList("foo, screen"); MediaList rendList = new MediaList("screen"); Assert.IsTrue(ssList.Matches(rendList)); }
/// <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); } }