CSS declarations inside comments are still applied special cases.
Reported by
patrick....@outlook.com,
Oct 19
|
||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36
Steps to reproduce the problem:
body::-webkit-scrollbar {
/* display: none; */
}
scrollbar hidden
What is the expected behavior?
scrollbar visisble:
overflow: scroll;
What went wrong?
scrollbar hidden
Did this work before? N/A
Does this work in other browsers? Yes
Chrome version: 70.0.3538.67 Channel: stable
OS Version: 10.0
Flash Version:
,
Oct 19
,
Oct 19
I'm sorry update: using selector "body::-webkit-scrollbar" will clear default styling scrollbar even if if it contains no declarations.
Comments seem to work fine. The problem here is inconsistent behavior.
1. external stylesheet: scrollbar styles cleared.
2. internal stylesheet: scrollbar visible and styling appears to be unchanged.
1. external
index.html:
<html>
<head>
<link rel="stylesheet" href="test.css" />
<title>
HTML Document
</title>
</head>
<body>
<p>scrollbar test</p>
<div id="overflow"></div>
</body>
</html>
test.css:
body{
overflow: scroll;
}
#overflow {
height: 4000px;
width: 4000px;
}
body::-webkit-scrollbar {
}
2. internal
<html>
<head>
<style>
body{
overflow: scroll;
}
#overflow {
height: 4000px;
width: 4000px;
}
body::-webkit-scrollbar {
}
</style>
<title>
HTML Document
</title>
</head>
<body>
<p>scrollbar test</p>
<div id="overflow"></div>
</body>
</html>
,
Oct 19
Indeed, external stylesheet is the key here. Can reproduce on Linux as well.
,
Oct 19
,
Oct 19
Issue 897148 has been merged into this issue. |
||||
►
Sign in to add a comment |
||||
Comment 1 by futhark@chromium.org
, Oct 19Not enough information to reproduce them problem as content bigger than the viewport or overflow style needs to be applied to have scrollbars in the first place. I tried <!DOCTYPE html> <style></style> body { overflow: scroll; } body::-webkit-scrollbar { /* display: none; */ } </style> text which shows scrollbars, at least on Linux. Re-open if you can reproduce with the example I gave, or have a more complete reproduction example.