public bool NeedsExpansion(CssDeclaration declaration, Browser[] browsers) { if (browsers == null || browsers.Length == 0) return false; if (!Compatibility.HasPatches) return false; foreach (var browser in browsers) { if (Compatibility.HasPatch(declaration, browser)) return true; } return false; }
public void WritePatchedDeclaration(CssDeclaration declaration, int level) { var prop = declaration.Info; if (browserSupport != null && prop.Compatibility.HasPatches) { var prefixes = BrowserPrefixKind.None; foreach (var browser in browserSupport) { // Skip the prefix if we've already added it if (prefixes.HasFlag(browser.Prefix.Kind)) continue; if (!prop.Compatibility.HasPatch(declaration, browser)) continue; var patch = prop.Compatibility.GetPatch(browser, declaration); Indent(level); writer.Write(patch.Name); writer.Write(": "); WriteValue(patch.Value); writer.Write(";"); writer.WriteLine(); prefixes |= browser.Prefix.Kind; } } // Finally, write the standards declaration WriteDeclaration(declaration, level); }
public void WriteDeclaration(CssDeclaration declaration, int level) { Indent(level); writer.Write(declaration.Name); writer.Write(": "); WriteValue(declaration.Value); writer.Write(";"); }