diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index 40a4c3f26..9109bff8b 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -217,6 +217,7 @@ css[SO] type RuleList = raw.CSSRuleList css[SO] type StyleDeclaration = raw.CSSStyleDeclaration css[SO] type StyleRule = raw.CSSStyleRule css[SO] type StyleSheet = raw.CSSStyleSheet +css[SO] def CSS = raw.CSS css[SO] def Rule = raw.CSSRule experimental/AbortController[JC] def abort(): Unit experimental/AbortController[JC] val signal: AbortSignal @@ -2460,6 +2461,8 @@ raw/CDATASection[JC] def splitText(offset: Int): Text raw/CDATASection[JC] def substringData(offset: Int, count: Int): String raw/CDATASection[JC] var textContent: String raw/CDATASection[JC] def wholeText: String +raw/CSS[JO] def supports(propertyName: String, value: String): Boolean +raw/CSS[JO] def supports(supportCondition: String): Boolean raw/CSSFontFaceRule[JC] var CHARSET_RULE: Int raw/CSSFontFaceRule[JC] var FONT_FACE_RULE: Int raw/CSSFontFaceRule[JC] var IMPORT_RULE: Int diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index 6ecf9a963..71976723e 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -217,6 +217,7 @@ css[SO] type RuleList = raw.CSSRuleList css[SO] type StyleDeclaration = raw.CSSStyleDeclaration css[SO] type StyleRule = raw.CSSStyleRule css[SO] type StyleSheet = raw.CSSStyleSheet +css[SO] def CSS = raw.CSS css[SO] def Rule = raw.CSSRule experimental/AbortController[JC] def abort(): Unit experimental/AbortController[JC] val signal: AbortSignal @@ -2460,6 +2461,8 @@ raw/CDATASection[JC] def splitText(offset: Int): Text raw/CDATASection[JC] def substringData(offset: Int, count: Int): String raw/CDATASection[JC] var textContent: String raw/CDATASection[JC] def wholeText: String +raw/CSS[JO] def supports(propertyName: String, value: String): Boolean +raw/CSS[JO] def supports(supportCondition: String): Boolean raw/CSSFontFaceRule[JC] var CHARSET_RULE: Int raw/CSSFontFaceRule[JC] var FONT_FACE_RULE: Int raw/CSSFontFaceRule[JC] var IMPORT_RULE: Int diff --git a/src/main/scala/org/scalajs/dom/css.scala b/src/main/scala/org/scalajs/dom/css.scala index 51d61cde4..72437cd3b 100644 --- a/src/main/scala/org/scalajs/dom/css.scala +++ b/src/main/scala/org/scalajs/dom/css.scala @@ -4,6 +4,7 @@ package org.scalajs.dom * Short aliases of all the dom.CSSThing classes */ object css { + @inline def CSS = raw.CSS type FontFaceRule = raw.CSSFontFaceRule type ImportRule = raw.CSSImportRule type KeyframeRule = raw.CSSKeyframeRule diff --git a/src/main/scala/org/scalajs/dom/raw/Css.scala b/src/main/scala/org/scalajs/dom/raw/Css.scala index 13dd2d4ef..1775687e0 100644 --- a/src/main/scala/org/scalajs/dom/raw/Css.scala +++ b/src/main/scala/org/scalajs/dom/raw/Css.scala @@ -12,6 +12,28 @@ package org.scalajs.dom.raw import scala.scalajs.js import scala.scalajs.js.annotation._ +@js.native +@JSGlobal +object CSS extends js.Object { + + /** + * The CSS.supports() method returns a boolean value indicating if the browser supports a given CSS feature, or not. + * Allows to test the support of a pair property-value. + * + * MDN + */ + def supports(propertyName: String, value: String): Boolean = js.native + + /** + * The CSS.supports() method returns a boolean value indicating if the browser supports a given CSS feature, or not. + * Takes one parameter matching the condition of @supports. + * + * MDN + */ + def supports(supportCondition: String): Boolean = js.native + +} + /** * A CSSStyleDeclaration is an interface to the declaration block returned by the * style property of a cssRule in a stylesheet, when the rule is a CSSStyleRule.