DEV Community

Discussion on: Webdev WTF

Collapse
 
ashleyjsheridan profile image
Ashley Sheridan

For the form elements one, can you not use formElement.elements? That's how it used to work back in the IE 5 days, and to the best of my knowledge, it worked back when Netscape Navigator was still a thing.

As for some of the WTF's that I've encountered:

  • 100vh doesn't work as expected only in Safari on iOS because the browsers footer/action bar is included as par of the available height of vh, meaning the bar covers content
  • File upload button styling. Despite the element being around longer than Chrome has existed, it's still impossible to actually style if properly.
  • Font widths on Safari - text is all displayed just a little bit wider than on any other browser, leading to breaks in text that weren't expected
  • Automatic placement of elements within a CSS grid in IE11. Child elements need to be explicitely placed within the grid, making it a whole lot less useful when dealing with dynamic unknown numbers of children.
  • Trailing commas in array items, I'm just so used to them in other languages. Support for them came so late for Javascript, but because some older browser still don't support them, they're sometimes still just not usable. Oh, and we still can't use them in JSON.
  • String padding functionality. Again, as IE11 doesn't support it, but is still often on our support matrix, we end up using polyfills, or worse (remember the leftpad problem that broke builds everywhere?!)
  • Unicode regular expressions. Being able to use selectors like \p{L} to select any letter (including those from non-ascii, such as Russian Cyrillic or Chinese). Mileage varies greatly between what selectors are supported, and polyfills here are basically a must. Unicode support in JS has always felt a little like a bit of an afterthough in places.
  • Automatic semicolon insertion. This leads to some weird bugs that you can sink hours into figuring out.
  • Math.max() (with no arguments) returns -Infinity and Math.min() returns Infinity, so Math.min() > Math.max(), rather than doing something sane like return NaN or erroring out when there's no arguments.