1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:27:35 +00:00

LibWeb: Make attribute hidden have an effect; hide some other elements

This moves LibWeb to using the list of hidden elements from the spec.

Concretely, the following things are now explicitly marked
`display: none` in addition to before:

- elements with the `hidden` attribute
- area
- base
- basefont
- datalist
- param
- rp

The spec also wants `noframes` and `noembed` to be `display: none`,
but since support for frames and embeds doesn't exist yet, these
are omitted for now.

With this, everyone's favorite website http://45.33.8.238/ no longer
displays spans with attribute hidden. (Whitespace handling still
looks a bit off though.)
This commit is contained in:
Nico Weber 2022-01-21 18:56:01 -05:00 committed by Linus Groh
parent a9c80ba33c
commit d670c13a3b

View file

@ -7,15 +7,6 @@ a {
cursor: pointer;
}
head,
link,
meta,
script,
style,
title {
display: none;
}
body {
margin: 8px;
}
@ -186,10 +177,6 @@ colgroup {
display: table-column-group;
}
basefont {
display: block;
}
blockquote {
margin-left: 25px;
margin-right: 25px;
@ -243,3 +230,22 @@ summary {
display: block;
font-weight: bold;
}
/* 15.3.1 Hidden elements
* https://html.spec.whatwg.org/multipage/rendering.html#hidden-elements
*/
/* FIXME: Add `noframes` once frames are implemented. */
/* FIXME: Add `noembed` once <embed> is implemented. */
/* FIXME: Add `rp` once <ruby> is implemented. */
[hidden], area, base, basefont, datalist, head, link, meta, /*noembed,*/
/*noframes,*/ param, /*rp,*/ script, style, template, title {
display: none;
}
embed[hidden] { display: inline; height: 0; width: 0; }
input[type=hidden i] { display: none !important; }
@media (scripting) {
noscript { display: none !important; }
}