webf icon indicating copy to clipboard operation
webf copied to clipboard

dom.style.webkitTransform return empty string

Open tinys opened this issue 2 years ago • 0 comments

Affected version

main

Flutter versions

3.13.9

No same issues found.

  • [X] Yes, I search all issues but not found.

Steps to Reproduce

When getting a non-existent style attribute through dom.style, an empty string is returned, which should return undefined. This is inconsistent with the browser's return. It fails when determining whether the browser supports standard attributes, and finally fails to set the style.

Code example

var vendor = function () {
  if (!inBrowser) {
    return false;
  }
  var transformNames = {
    webkit: 'webkitTransform',
    Moz: 'MozTransform',
    O: 'OTransform',
    ms: 'msTransform',
    standard: 'transform',
  };
  for (var key in transformNames) {
    if (elementStyle[transformNames[key]] !== undefined) {
      return key;
    }
  }
  
  return false;
}();

// vernder = webkit

Expected results

webkit

Actual results

standard

tinys avatar Dec 08 '23 03:12 tinys