summaryrefslogtreecommitdiffstats
path: root/layout/style/nsICSSUnprefixingService.idl
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /layout/style/nsICSSUnprefixingService.idl
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'layout/style/nsICSSUnprefixingService.idl')
-rw-r--r--layout/style/nsICSSUnprefixingService.idl76
1 files changed, 76 insertions, 0 deletions
diff --git a/layout/style/nsICSSUnprefixingService.idl b/layout/style/nsICSSUnprefixingService.idl
new file mode 100644
index 000000000..11c3bf43f
--- /dev/null
+++ b/layout/style/nsICSSUnprefixingService.idl
@@ -0,0 +1,76 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* 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/. */
+
+/* interface for a service that converts certain vendor-prefixed CSS properties
+ to their unprefixed equivalents */
+
+#include "nsISupports.idl"
+
+[scriptable, uuid(a5d6e2f4-d3ec-11e4-b002-782bcbaebb28)]
+interface nsICSSUnprefixingService : nsISupports
+{
+ /**
+ * This function helps to convert unsupported vendor-prefixed CSS into
+ * supported unprefixed CSS. Given a vendor-prefixed property name and a
+ * value (or e.g. value + trailing junk like " !important;}"), this function
+ * will attempt to produce an equivalent CSS declaration that uses a
+ * supported unprefixed CSS property.
+ *
+ * @param aPropName
+ * The vendor-prefixed property name.
+ *
+ * @param aRightHalfOfDecl
+ * Everything after the ":" in the CSS declaration. This includes
+ * the property's value, along with possibly some leading whitespace
+ * and trailing text like "!important", and possibly a ';' and/or
+ * '}' (along with any other bogus text the author happens to
+ * include before those, which will probably make the decl invalid).
+ *
+ * @param aUnprefixedDecl[out]
+ * The resulting unprefixed declaration, if we return true.
+ *
+ * @return true if we were able to unprefix -- i.e. if we were able to
+ * convert the property to a known unprefixed equivalent, and we also
+ * performed any known-to-be-necessary fixup on the value, and we put
+ * the result in aUnprefixedDecl.
+ * Otherwise, this function returns false.
+ */
+ boolean generateUnprefixedDeclaration(in AString aPropName,
+ in AString aRightHalfOfDecl,
+ out AString aUnprefixedDecl);
+
+ /**
+ * @param aPrefixedFuncName
+ * The webkit-prefixed gradient function: either
+ * "-webkit-gradient", "-webkit-linear-gradient", or
+ * "-webkit-radial-gradient".
+ *
+ * @param aPrefixedFuncBody
+ * The body of the gradient function, inside (& not including) the
+ * parenthesis.
+ *
+ * @param aUnprefixedFuncName[out]
+ * The resulting unprefixed gradient function name:
+ * either "linear-gradient" or "radial-gradient".
+ *
+ * @param aUnprefixedFuncBody[out]
+ * The resulting unprefixed gradient function body, suitable for
+ * including in a "linear-gradient(...)" or "radial-gradient(...)"
+ * expression.
+ *
+ * @returns true if we were able to successfully parse aWebkitGradientStr
+ * and populate the outparams accordingly; false otherwise.
+ *
+ */
+ boolean generateUnprefixedGradientValue(in AString aPrefixedFuncName,
+ in AString aPrefixedFuncBody,
+ out AString aUnprefixedFuncName,
+ out AString aUnprefixedFuncBody);
+};
+
+%{C++
+#define NS_CSSUNPREFIXINGSERVICE_CONTRACTID \
+ "@mozilla.org/css-unprefixing-service;1"
+%}