From d7fa9781fac5f837a6a33c69219cb9e6f821f599 Mon Sep 17 00:00:00 2001 From: Koppany Papp Date: Fri, 24 Sep 2021 18:34:04 +0200 Subject: [PATCH 1/2] fix parameter order --- src/Web/CSSOM/CSSStyleDeclaration.js | 22 +++++++++++----------- src/Web/CSSOM/CSSStyleDeclaration.purs | 10 +++++----- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Web/CSSOM/CSSStyleDeclaration.js b/src/Web/CSSOM/CSSStyleDeclaration.js index c51e14c..925db1f 100644 --- a/src/Web/CSSOM/CSSStyleDeclaration.js +++ b/src/Web/CSSOM/CSSStyleDeclaration.js @@ -6,8 +6,8 @@ exports.cssText = function (style) { }; }; -exports.setCssText = function (style) { - return function (newCSS) { +exports.setCssText = function (newCSS) { + return function (style) { return function () { style.cssText = newCSS; }; @@ -20,33 +20,33 @@ exports.length = function (style) { }; }; -exports.getPropertyPriority = function (style) { - return function (propName) { +exports.getPropertyPriority = function (propName) { + return function (style) { return function () { return style.getPropertyPriority(propName); }; }; }; -exports.getPropertyValue = function (style) { - return function (propName) { +exports.getPropertyValue = function (propName) { + return function (style) { return function () { return style.getPropertyValue(propName); }; }; }; -exports.removeProperty = function (style) { - return function (propName) { +exports.removeProperty = function (propName) { + return function (style) { return function () { style.removeProperty(propName); }; }; }; -exports.setProperty = function (style) { - return function (propName) { - return function (propValue) { +exports.setProperty = function (propName) { + return function (propValue) { + return function (style) { return function () { style.setProperty(propName, propValue); }; diff --git a/src/Web/CSSOM/CSSStyleDeclaration.purs b/src/Web/CSSOM/CSSStyleDeclaration.purs index f0bd516..1052d31 100644 --- a/src/Web/CSSOM/CSSStyleDeclaration.purs +++ b/src/Web/CSSOM/CSSStyleDeclaration.purs @@ -13,10 +13,10 @@ import Web.CSSOM.Internal.Types (CSSStyleDeclaration) as Exports import Web.CSSOM.Internal.Types (CSSStyleDeclaration) foreign import cssText :: CSSStyleDeclaration -> Effect String -foreign import setCssText :: CSSStyleDeclaration -> String -> Effect Unit +foreign import setCssText :: String -> CSSStyleDeclaration -> Effect Unit foreign import length :: CSSStyleDeclaration -> Effect Number -foreign import getPropertyPriority :: CSSStyleDeclaration -> String -> Effect String -foreign import getPropertyValue :: CSSStyleDeclaration -> String -> Effect String -foreign import removeProperty :: CSSStyleDeclaration -> String -> Effect Unit -foreign import setProperty :: CSSStyleDeclaration -> String -> String -> Effect Unit +foreign import getPropertyPriority :: String -> CSSStyleDeclaration -> Effect String +foreign import getPropertyValue :: String -> CSSStyleDeclaration -> Effect String +foreign import removeProperty :: String -> CSSStyleDeclaration -> Effect Unit +foreign import setProperty :: String -> String -> CSSStyleDeclaration -> Effect Unit From 950c8699d340af88a2f5b38f93ad285a9cc1b6cc Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 25 Mar 2022 16:13:09 -0500 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3664ba2..a320893 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ Notable changes to this project are documented in this file. The format is based Breaking changes: - Migrate FFI to ES modules (#14 by @JordanMartinez) +- Update `CSSStyleDeclaration` functions to take `style` arg last (#12 by @theqp) + + This follows the convention of "the thing being operated on" occurs + last in function that take multiple arguments. New features: