Skip to content

dom.style.webkitTransform return empty string #532

Open
@tinys

Description

@tinys

Affected version

main

Flutter versions

3.13.9

No same issues found.

  • 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions