web-platform-tests / wpt

Test suites for Web platform specs — including WHATWG, W3C, and others
https://web-platform-tests.org/
Other
4.88k stars 3.05k forks source link

CSS `::file-selector-button` pseudo-element has no visible effect when animation is applied #35575

Open sunkanmii opened 2 years ago

sunkanmii commented 2 years ago

Although the official doc says that

There is no restriction on which properties apply to the ::file-selector-button pseudo-element.

Animations applied via the CSS animation property don't work.

Here's a sample in case you want to recreate it:

HTML:

<body>
  <form>
    <input type="file" accept="image/*"/>
  </form>

  <button>Expand</button>
</body>

CSS:

body{
  display: flex;
  height: 100vh;
  width: 100%;
  background: lightblue;
}
form{
  margin: auto;
}
::-webkit-file-upload-button{
  font-size: 1.5rem;
  border: none;
  background: white;
  border: 1px solid white;
  color: black;
  transition: 1.3s;
  padding: 1rem 2rem;
  transform: scale(0.5);
  animation: expand 5s ease-in infinite;
}
::file-selector-button{
  font-size: 1.5rem;
  border: none;
  background: white;
  border: 1px solid white;
  color: black;
  transition: 1.3s;
  padding: 1rem 2rem;
  transform: scale(0.5);
  animation: expand 5s ease-in infinite;
}

button{
  transform: scale(0.5);
  animation: expand 5s ease-in infinite;
}

@keyframes expand {
  0%{
    transform: scale(0.5);
  }
  50%{
    transform: scale(1);
  }
  100%{
    transform: scale(0.5)
  }
}

The button shows changes, but the ::file-selector-button does not after testing on Chrome.

21pravi commented 1 year ago

Hello there! I am new to the open source world and would like to contribute to some real-world projects. If this issue is not resolved yet, can I be assigned to it?