MediaListExtensions.Validate(IMediaList, IRenderDevice) is
public static Boolean Validate(this IMediaList list, IRenderDevice device) => !list.Any(m => !m.Validate(device));
so a media query list matches only when every query in it matches. Media Queries Level 4 §2.1: "A media query list is true if any of its component media queries are true, and false only if all of its component media queries are false." An empty list is true, which the current code also gets right, so the fix is list.Count == 0 || list.Any(m => m.Validate(device)).
Observable in the cascade and, once #228 lands, in matchMedia:
var device = new DefaultRenderDevice { Category = DeviceCategory.Screen };
var list = new CssParser().ParseMedia("screen, print");
list.Validate(device); // false; browsers: true
@media screen, print { } is therefore inactive on a screen device. Found while writing #228; left out of it because the same path decides the cascade.
src/AngleSharp.Css/Extensions/MediaListExtensions.cs. Independent of the other evaluation issues filed alongside.
MediaListExtensions.Validate(IMediaList, IRenderDevice)isso a media query list matches only when every query in it matches. Media Queries Level 4 §2.1: "A media query list is true if any of its component media queries are true, and false only if all of its component media queries are false." An empty list is true, which the current code also gets right, so the fix is
list.Count == 0 || list.Any(m => m.Validate(device)).Observable in the cascade and, once #228 lands, in
matchMedia:@media screen, print { }is therefore inactive on a screen device. Found while writing #228; left out of it because the same path decides the cascade.src/AngleSharp.Css/Extensions/MediaListExtensions.cs. Independent of the other evaluation issues filed alongside.