necolas / normalize.css

A modern alternative to CSS resets
http://necolas.github.io/normalize.css/
MIT License
52.32k stars 10.66k forks source link

HR: no need for Firefox normalization #817

Open mattbrundage opened 4 years ago

mattbrundage commented 4 years ago

Firefox no longer needs box-sizing and height rules, as the browser's stylesheet now specifies the correct box-sizing value and does not affect height. Tested in Firefox ESR (v. 68) through Firefox Developer Edition (v. 76).

Paste this into Firefox's address bar to view the browser's default styles: view-source:resource://gre-resources/html.css

SiarheiBobryk commented 4 years ago

Completely agree with @mattbrundage!

I can confirm that the box-sizing and height rules are not required for Firefox anymore. Actually I was going to submit the same changes, but @mattbrundage was first 🙂

According to User Agent Stylesheet there is already defined box-sizing: content-box; style for Firefox.

/* <hr> noshade and color attributes are handled completely by
 * the nsHTMLHRElement attribute mapping code
 */
hr {
  display: block;
  border: 1px inset;
  margin-block-start: 0.5em;
  margin-block-end: 0.5em;
  margin-inline-start: auto;
  margin-inline-end: auto;
  color: gray;
  -moz-float-edge: margin-box;
  box-sizing: content-box;
}

hr[size="1"] {
  border-style: solid none none none;
}
Screen Shot 2020-09-13 at 12 06 13 pm

Also, I can confirm that height calculates properly in Firefox now.

Screen Shot 2020-09-13 at 12 11 54 pm
SiarheiBobryk commented 4 years ago

@necolas up