User agent stylesheet redefines style from user's CSS
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
People
(Reporter: kes-kes, Unassigned)
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0
Steps to reproduce:
create HTML (see attached file)
Apply fontsize to the entire page, but my style from CSS is redefined by user agent style sheet.
This happens only when CSS is inlined into HTML.
When I same CSS include via
<link href="/static/css/invoice.css" rel="stylesheet">
then computations done as expected.
Actual results:
see attached screenshots.
you can see that computed font-size is 16
Expected results:
computed font-size MUST BE 12
| Reporter | ||
Comment 1•6 years ago
|
||
| Reporter | ||
Comment 2•6 years ago
|
||
| Reporter | ||
Comment 3•6 years ago
|
||
| Reporter | ||
Comment 4•6 years ago
|
||
chrome says:
table {
white-space: normal;
line-height: normal;
font-weight: normal;
font-size: medium; <<<<<<<<<<<<<<<<
font-style: normal;
color: -internal-quirk-inherit;
text-align: start;
font-variant: normal;
}
I do not think that browser defaults should take precendence over user defined css.
in any case when style sheet is not inlined I got expected results.
Thus you should fix only the case when CSS is inlined.
Comment 5•6 years ago
|
||
Hi, I managed to reproduce this issue in All versions of Firefox on Ubuntu 18.04. Mac OsX and Windows 10.
Comment 6•6 years ago
|
||
This is working as expected (and as you noted, it works the same in other browsers). Tables reset the font-size so that it's not inherited.
Changing it is probably not possible since this rule has been
You should probably just use standards mode (<!doctype html> at the beginning of the page), or table { font-size: inherit; line-height: inherit; ... }.
Comment 7•6 years ago
|
||
Changing it is probably not possible since this rule has been
... there since forever in quirks mode. :)
| Reporter | ||
Comment 8•6 years ago
|
||
@Emilio Cobos Álvarez
This is working as expected
You say that this is expected that same CSS works differently depending on when style is inlined VS included??
I expect that regardless of how CSS defined:
- via <style>
- via <link href="/static/css/invoice.css" rel="stylesheet">
It MUST have same behavior!
Comment 9•6 years ago
|
||
It behaves the same if you use <style> as if you use <link rel="stylesheet"> here. Can you attach or link to a repro that behaves differently? The behavior difference should only happen in quirks mode vs. not.
| Reporter | ||
Comment 10•6 years ago
|
||
I have attached. https://bugzilla.mozilla.org/attachment.cgi?id=9068378&action=edit
copy all CSS from: <style>/*<![CDATA[*/ into separate file invoice.css and add link href="invoice.css" rel="stylesheet"> instead
Comment 11•6 years ago
|
||
I did that, and it looks the same:
Or am I missing something?
| Reporter | ||
Comment 12•6 years ago
|
||
probably something is missing. I will investigate into this.
Comment 13•6 years ago
|
||
Great, please reopen when you figure out, thanks!
Description
•