mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 13:09:41 +00:00
LibWeb: Use document's viewport when resolving lengths in media queries
Previously we would always use the window's viewport which was incorrect if we were within an iframe. This is likely applicable to all uses of `Length::ResolutionContext::for_window`.
This commit is contained in:
parent
c33be71df9
commit
05c336ea4e
Notes:
github-actions[bot]
2025-10-07 09:34:36 +00:00
Author: https://github.com/Calme1709
Commit: 05c336ea4e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6412
Reviewed-by: https://github.com/AtkinsSJ ✅
23 changed files with 198 additions and 83 deletions
|
@ -161,7 +161,7 @@ public:
|
|||
}));
|
||||
}
|
||||
|
||||
virtual MatchResult evaluate(HTML::Window const*) const override;
|
||||
virtual MatchResult evaluate(DOM::Document const*) const override;
|
||||
virtual String to_string() const override;
|
||||
virtual void dump(StringBuilder&, int indent_levels = 0) const override;
|
||||
|
||||
|
@ -188,7 +188,7 @@ private:
|
|||
{
|
||||
}
|
||||
|
||||
static MatchResult compare(HTML::Window const& window, MediaFeatureValue const& left, Comparison comparison, MediaFeatureValue const& right);
|
||||
static MatchResult compare(DOM::Document const& document, MediaFeatureValue const& left, Comparison comparison, MediaFeatureValue const& right);
|
||||
MediaFeatureValue const& value() const { return m_value.get<MediaFeatureValue>(); }
|
||||
Range const& range() const { return m_value.get<Range>(); }
|
||||
|
||||
|
@ -218,7 +218,7 @@ public:
|
|||
static NonnullRefPtr<MediaQuery> create() { return adopt_ref(*new MediaQuery); }
|
||||
|
||||
bool matches() const { return m_matches; }
|
||||
bool evaluate(HTML::Window const&);
|
||||
bool evaluate(DOM::Document const&);
|
||||
String to_string() const;
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue