LibWeb: Use correct viewport units for font properties in iframe root el
This commit is contained in:
parent
baecba0d08
commit
90e0e5a0f2
3 changed files with 22 additions and 1 deletions
|
|
@ -1450,7 +1450,7 @@ ComputationContext const& StyleComputer::get_computation_context_for_property(Pr
|
|||
m_cached_font_computation_context = {
|
||||
.length_resolution_context = inheritance_parent.has_value()
|
||||
? Length::ResolutionContext::for_element(inheritance_parent.value())
|
||||
: Length::ResolutionContext::for_window(*m_document->window()),
|
||||
: Length::ResolutionContext::for_document(m_document),
|
||||
.abstract_element = abstract_element
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
40px
|
||||
20
Tests/LibWeb/Text/input/iframe-viewport-font-properties.html
Normal file
20
Tests/LibWeb/Text/input/iframe-viewport-font-properties.html
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<!doctype html>
|
||||
<script src="include.js"></script>
|
||||
<iframe id="frame" style="width: 400px"></iframe>
|
||||
<script>
|
||||
asyncTest(done => {
|
||||
frame.onload = () => {
|
||||
println(getComputedStyle(frame.contentDocument.documentElement).fontSize);
|
||||
done();
|
||||
};
|
||||
|
||||
frame.srcdoc = `
|
||||
<!DOCTYPE html>
|
||||
<style>
|
||||
:root {
|
||||
font-size: 10vw;
|
||||
}
|
||||
</style>
|
||||
`;
|
||||
});
|
||||
</script>
|
||||
Loading…
Reference in a new issue