From 9f7796e3bb48455a2e1d624df0c423388d0b100f Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 17 Mar 2016 19:14:27 +0100 Subject: [PATCH] Fix style property issue in Safari --- wcfsetup/install/files/js/WoltLab/WCF/Dom/Util.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Dom/Util.js b/wcfsetup/install/files/js/WoltLab/WCF/Dom/Util.js index a230a6c289..5d29a684dc 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/Dom/Util.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/Dom/Util.js @@ -6,7 +6,7 @@ * @license GNU Lesser General Public License * @module WoltLab/WCF/Dom/Util */ -define(['StringUtil'], function(StringUtil) { +define(['Environment', 'StringUtil'], function(Environment, StringUtil) { "use strict"; function _isBoundaryNode(element, ancestor, position) { @@ -208,6 +208,13 @@ define(['StringUtil'], function(StringUtil) { important = false; } + // for a set style property with priority = important, Safari is not able to + // overwrite it with a property != important; removing the property first + // solves the issue + if (Environment.browser() === 'safari' && el.style.getPropertyPriority(property) === 'important' && !important) { + el.style.removeProperty(property); + } + el.style.setProperty(property, styles[property], (important ? 'important' : '')); } } -- 2.20.1