mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 01:55:07 +00:00
LibWeb: Update visibility when Node was invisible before
This commit is contained in:
parent
d1de7f7782
commit
931458c337
|
@ -24,6 +24,13 @@
|
|||
.red {
|
||||
background: red;
|
||||
}
|
||||
.hover-visible {
|
||||
display: inline-block;
|
||||
opacity: 0;
|
||||
}
|
||||
.hover:hover .hover-visible {
|
||||
opacity: 1;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -66,5 +73,13 @@
|
|||
50% opacity inside 70% opacity
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="red hover">
|
||||
Visible on hover
|
||||
|
||||
<div class="hover-visible">
|
||||
I'm visible!
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -487,8 +487,7 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style)
|
|||
if (auto maybe_visibility = computed_style.visibility(); maybe_visibility.has_value())
|
||||
computed_values.set_visibility(maybe_visibility.release_value());
|
||||
|
||||
if (computed_values.opacity() == 0 || computed_values.visibility() != CSS::Visibility::Visible)
|
||||
m_visible = false;
|
||||
m_visible = computed_values.opacity() != 0 && computed_values.visibility() == CSS::Visibility::Visible;
|
||||
|
||||
if (auto maybe_length_percentage = computed_style.length_percentage(CSS::PropertyID::Width); maybe_length_percentage.has_value())
|
||||
computed_values.set_width(maybe_length_percentage.release_value());
|
||||
|
|
Loading…
Reference in a new issue