Пример #1
0
        public IEnumerable<CssFunction> ExpandFor(Browser[] browsers)
        {
            foreach (var browser in browsers)
            {
                var args2 = new CssValueList(ValueSeperator.Comma);

                var i = 0;
                foreach (var arg in args)
                {
                    // The legacy syntax didn't contain to on the direction
                    if (i == 0 && arg.ToString().StartsWith("to "))
                    {
                        args2.Add(CssValue.Parse(arg.ToString().Replace("to ", "")));
                    }
                    else
                    {
                        args2.Add(arg);
                    }

                    i++;
                }

                var name = browser.Prefix.Text + "linear-gradient";

                yield return new CssFunction(name, args2);
            }
        }
Пример #2
0
        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;
        }
Пример #3
0
        public static bool NeedsPatch(string value, Browser browser)
        {
            CssCompatibility c;

            if (table.TryGetValue(value, out c))
            {
                if (c.IsPrefixed(browser))
                {
                    return true;
                }
            }

            return false;
        }
Пример #4
0
        private void WriteKeyframesRule(Browser browser, KeyframesRule rule, int level)
        {
            browserSupport = new[] { browser };

            writer.Write("@");
            writer.Write(browser.Prefix.Text);
            writer.Write("keyframes ");
            writer.Write(rule.Name);
            writer.Write(" ");

            WriteBlock(rule, level);

            browserSupport = context.BrowserSupport;
        }