diff --git a/Tests/LibWeb/Text/expected/css/media-query-serialization-basic.txt b/Tests/LibWeb/Text/expected/css/media-query-serialization-basic.txt new file mode 100644 index 0000000000..6cf4eec5b6 --- /dev/null +++ b/Tests/LibWeb/Text/expected/css/media-query-serialization-basic.txt @@ -0,0 +1,15 @@ +@media screen { + +} +@media screen and ((min-width:20px) and (max-width:40px)) { + +} +@media screen and (min-resolution:1dppx) { + +} +@media screen and (min-resolution:2dppx) { + +} +@media screen and (min-resolution:2.54dppx) { + +} diff --git a/Tests/LibWeb/Text/input/css/media-query-serialization-basic.html b/Tests/LibWeb/Text/input/css/media-query-serialization-basic.html new file mode 100644 index 0000000000..b080975151 --- /dev/null +++ b/Tests/LibWeb/Text/input/css/media-query-serialization-basic.html @@ -0,0 +1,16 @@ +
+ + diff --git a/Userland/Libraries/LibWeb/CSS/Resolution.cpp b/Userland/Libraries/LibWeb/CSS/Resolution.cpp index 1af4072de2..4ca021df64 100644 --- a/Userland/Libraries/LibWeb/CSS/Resolution.cpp +++ b/Userland/Libraries/LibWeb/CSS/Resolution.cpp @@ -23,9 +23,9 @@ double Resolution::to_dots_per_pixel() const { switch (m_type) { case Type::Dpi: - return m_value * 96; // 1in = 2.54cm = 96px + return m_value / 96; // 1in = 2.54cm = 96px case Type::Dpcm: - return m_value * (96.0 / 2.54); // 1cm = 96px/2.54 + return m_value / (96.0 / 2.54); // 1cm = 96px/2.54 case Type::Dppx: return m_value; }