Remove Opera & MS prefix

This commit is contained in:
Leilei332
2025-09-30 19:23:05 +08:00
parent d5d6a55fe9
commit e5771c00be

View File

@@ -41,7 +41,7 @@ exports.convertStyleNameToPropertyName = function(styleName) {
var propertyName = $tw.utils.unHyphenateCss(styleName); var propertyName = $tw.utils.unHyphenateCss(styleName);
// Then check if it needs a prefix // Then check if it needs a prefix
if($tw.browser && document.body.style[propertyName] === undefined) { if($tw.browser && document.body.style[propertyName] === undefined) {
var prefixes = ["O","MS","Moz","webkit"]; var prefixes = ["Moz","webkit"];
for(var t=0; t<prefixes.length; t++) { for(var t=0; t<prefixes.length; t++) {
var prefixedName = prefixes[t] + propertyName.substr(0,1).toUpperCase() + propertyName.substr(1); var prefixedName = prefixes[t] + propertyName.substr(0,1).toUpperCase() + propertyName.substr(1);
if(document.body.style[prefixedName] !== undefined) { if(document.body.style[prefixedName] !== undefined) {
@@ -66,8 +66,6 @@ exports.convertPropertyNameToStyleName = function(propertyName) {
// If there's a webkit prefix, add a dash (other browsers have uppercase prefixes, and so get the dash automatically) // If there's a webkit prefix, add a dash (other browsers have uppercase prefixes, and so get the dash automatically)
if(styleName.indexOf("webkit") === 0) { if(styleName.indexOf("webkit") === 0) {
styleName = "-" + styleName; styleName = "-" + styleName;
} else if(styleName.indexOf("-m-s") === 0) {
styleName = "-ms" + styleName.substr(4);
} }
return styleName; return styleName;
}; };
@@ -92,8 +90,6 @@ var eventNameMappings = {
correspondingCssProperty: "transition", correspondingCssProperty: "transition",
mappings: { mappings: {
transition: "transitionend", transition: "transitionend",
OTransition: "oTransitionEnd",
MSTransition: "msTransitionEnd",
MozTransition: "transitionend", MozTransition: "transitionend",
webkitTransition: "webkitTransitionEnd" webkitTransition: "webkitTransitionEnd"
} }
@@ -102,8 +98,6 @@ var eventNameMappings = {
correspondingCssProperty: "animation", correspondingCssProperty: "animation",
mappings: { mappings: {
animation: "animationend", animation: "animationend",
OAnimation: "oAnimationEnd",
MSAnimation: "msAnimationEnd",
MozAnimation: "animationend", MozAnimation: "animationend",
webkitAnimation: "webkitAnimationEnd" webkitAnimation: "webkitAnimationEnd"
} }