Auto merge of #14789 - Manishearth:supports, r=SimonSapin

Support @supports

fixes #14786

cc @heycam @upsuper
r? @SimonSapin

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14789)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-01-09 10:54:38 -08:00 committed by GitHub
commit 50bba770d6
98 changed files with 638 additions and 218 deletions

View file

@ -11,3 +11,9 @@ interface CSS {
[Throws]
static DOMString escape(DOMString ident);
};
// https://drafts.csswg.org/css-conditional-3/#the-css-interface
partial interface CSS {
static boolean supports(DOMString property, DOMString value);
static boolean supports(DOMString conditionText);
};

View file

@ -0,0 +1,9 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// https://drafts.csswg.org/css-conditional/#cssconditionrule
[Abstract, Exposed=Window]
interface CSSConditionRule : CSSGroupingRule {
attribute DOMString conditionText;
};

View file

@ -3,7 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// https://drafts.csswg.org/cssom/#the-cssmediarule-interface
// https://drafts.csswg.org/css-conditional/#cssmediarule
[Exposed=Window]
interface CSSMediaRule : CSSGroupingRule {
interface CSSMediaRule : CSSConditionRule {
[SameObject, PutForwards=mediaText] readonly attribute MediaList media;
};

View file

@ -31,3 +31,7 @@ partial interface CSSRule {
const unsigned short VIEWPORT_RULE = 15;
};
// https://drafts.csswg.org/css-conditional-3/#extentions-to-cssrule-interface
partial interface CSSRule {
const unsigned short SUPPORTS_RULE = 12;
};

View file

@ -0,0 +1,8 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// https://drafts.csswg.org/css-conditional/#csssupportsrule
[Exposed=Window]
interface CSSSupportsRule : CSSConditionRule {
};