mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 17:47:36 +00:00
LibWeb: Move Window from DOM directory & namespace to HTML
The Window object is part of the HTML spec. :^) https://html.spec.whatwg.org/multipage/window-object.html
This commit is contained in:
parent
2dfb617c5b
commit
1422bd45eb
63 changed files with 133 additions and 133 deletions
|
@ -34,7 +34,7 @@ public:
|
|||
|
||||
NonnullRefPtr<MediaList> const& media() const { return m_media; }
|
||||
|
||||
bool evaluate(DOM::Window const& window) { return m_media->evaluate(window); }
|
||||
bool evaluate(HTML::Window const& window) { return m_media->evaluate(window); }
|
||||
|
||||
private:
|
||||
explicit CSSMediaRule(NonnullRefPtr<MediaList>&&, NonnullRefPtrVector<CSSRule>&&);
|
||||
|
|
|
@ -103,7 +103,7 @@ void CSSRuleList::for_each_effective_style_rule(Function<void(CSSStyleRule const
|
|||
}
|
||||
}
|
||||
|
||||
bool CSSRuleList::evaluate_media_queries(DOM::Window const& window)
|
||||
bool CSSRuleList::evaluate_media_queries(HTML::Window const& window)
|
||||
{
|
||||
bool any_media_queries_changed_match_state = false;
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
|
||||
void for_each_effective_style_rule(Function<void(CSSStyleRule const&)> const& callback) const;
|
||||
// Returns whether the match state of any media queries changed after evaluation.
|
||||
bool evaluate_media_queries(DOM::Window const&);
|
||||
bool evaluate_media_queries(HTML::Window const&);
|
||||
|
||||
private:
|
||||
explicit CSSRuleList(NonnullRefPtrVector<CSSRule>&&);
|
||||
|
|
|
@ -62,7 +62,7 @@ void CSSStyleSheet::for_each_effective_style_rule(Function<void(CSSStyleRule con
|
|||
m_rules->for_each_effective_style_rule(callback);
|
||||
}
|
||||
|
||||
bool CSSStyleSheet::evaluate_media_queries(DOM::Window const& window)
|
||||
bool CSSStyleSheet::evaluate_media_queries(HTML::Window const& window)
|
||||
{
|
||||
return m_rules->evaluate_media_queries(window);
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
|
||||
void for_each_effective_style_rule(Function<void(CSSStyleRule const&)> const& callback) const;
|
||||
// Returns whether the match state of any media queries changed after evaluation.
|
||||
bool evaluate_media_queries(DOM::Window const&);
|
||||
bool evaluate_media_queries(HTML::Window const&);
|
||||
|
||||
private:
|
||||
explicit CSSStyleSheet(NonnullRefPtrVector<CSSRule>);
|
||||
|
|
|
@ -65,7 +65,7 @@ void MediaList::delete_medium(String medium)
|
|||
// FIXME: If nothing was removed, then throw a NotFoundError exception.
|
||||
}
|
||||
|
||||
bool MediaList::evaluate(DOM::Window const& window)
|
||||
bool MediaList::evaluate(HTML::Window const& window)
|
||||
{
|
||||
for (auto& media : m_media)
|
||||
media.evaluate(window);
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
void append_medium(String);
|
||||
void delete_medium(String);
|
||||
|
||||
bool evaluate(DOM::Window const&);
|
||||
bool evaluate(HTML::Window const&);
|
||||
bool matches() const;
|
||||
|
||||
private:
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <LibWeb/CSS/MediaQuery.h>
|
||||
#include <LibWeb/CSS/Serialize.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/Window.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
|
@ -77,7 +77,7 @@ String MediaFeature::to_string() const
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
bool MediaFeature::evaluate(DOM::Window const& window) const
|
||||
bool MediaFeature::evaluate(HTML::Window const& window) const
|
||||
{
|
||||
auto maybe_queried_value = window.query_media_feature(m_name);
|
||||
if (!maybe_queried_value.has_value())
|
||||
|
@ -122,7 +122,7 @@ bool MediaFeature::evaluate(DOM::Window const& window) const
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
bool MediaFeature::compare(DOM::Window const& window, MediaFeatureValue left, Comparison comparison, MediaFeatureValue right)
|
||||
bool MediaFeature::compare(HTML::Window const& window, MediaFeatureValue left, Comparison comparison, MediaFeatureValue right)
|
||||
{
|
||||
if (!left.is_same_type(right))
|
||||
return false;
|
||||
|
@ -298,7 +298,7 @@ String MediaCondition::to_string() const
|
|||
return builder.to_string();
|
||||
}
|
||||
|
||||
MatchResult MediaCondition::evaluate(DOM::Window const& window) const
|
||||
MatchResult MediaCondition::evaluate(HTML::Window const& window) const
|
||||
{
|
||||
switch (type) {
|
||||
case Type::Single:
|
||||
|
@ -369,7 +369,7 @@ String MediaQuery::to_string() const
|
|||
return builder.to_string();
|
||||
}
|
||||
|
||||
bool MediaQuery::evaluate(DOM::Window const& window)
|
||||
bool MediaQuery::evaluate(HTML::Window const& window)
|
||||
{
|
||||
auto matches_media = [](MediaType media) -> MatchResult {
|
||||
switch (media) {
|
||||
|
|
|
@ -140,7 +140,7 @@ public:
|
|||
return feature;
|
||||
}
|
||||
|
||||
bool evaluate(DOM::Window const&) const;
|
||||
bool evaluate(HTML::Window const&) const;
|
||||
String to_string() const;
|
||||
|
||||
private:
|
||||
|
@ -159,7 +159,7 @@ private:
|
|||
{
|
||||
}
|
||||
|
||||
static bool compare(DOM::Window const& window, MediaFeatureValue left, Comparison comparison, MediaFeatureValue right);
|
||||
static bool compare(HTML::Window const& window, MediaFeatureValue left, Comparison comparison, MediaFeatureValue right);
|
||||
|
||||
struct Range {
|
||||
MediaFeatureValue left_value;
|
||||
|
@ -196,7 +196,7 @@ struct MediaCondition {
|
|||
static NonnullOwnPtr<MediaCondition> from_and_list(NonnullOwnPtrVector<MediaCondition>&&);
|
||||
static NonnullOwnPtr<MediaCondition> from_or_list(NonnullOwnPtrVector<MediaCondition>&&);
|
||||
|
||||
MatchResult evaluate(DOM::Window const&) const;
|
||||
MatchResult evaluate(HTML::Window const&) const;
|
||||
String to_string() const;
|
||||
|
||||
private:
|
||||
|
@ -234,7 +234,7 @@ public:
|
|||
static NonnullRefPtr<MediaQuery> create() { return adopt_ref(*new MediaQuery); }
|
||||
|
||||
bool matches() const { return m_matches; }
|
||||
bool evaluate(DOM::Window const&);
|
||||
bool evaluate(HTML::Window const&);
|
||||
String to_string() const;
|
||||
|
||||
private:
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
namespace Web::CSS {
|
||||
|
||||
Screen::Screen(DOM::Window& window)
|
||||
Screen::Screen(HTML::Window& window)
|
||||
: RefCountForwarder(window)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -9,20 +9,20 @@
|
|||
#include <AK/RefCountForwarder.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
#include <LibWeb/Bindings/Wrappable.h>
|
||||
#include <LibWeb/DOM/Window.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
class Screen final
|
||||
: public RefCountForwarder<DOM::Window>
|
||||
: public RefCountForwarder<HTML::Window>
|
||||
, public Bindings::Wrappable {
|
||||
|
||||
public:
|
||||
using WrapperType = Bindings::ScreenWrapper;
|
||||
using AllowOwnPtr = TrueType;
|
||||
|
||||
static NonnullOwnPtr<Screen> create(Badge<DOM::Window>, DOM::Window& window)
|
||||
static NonnullOwnPtr<Screen> create(Badge<HTML::Window>, HTML::Window& window)
|
||||
{
|
||||
return adopt_own(*new Screen(window));
|
||||
}
|
||||
|
@ -35,9 +35,9 @@ public:
|
|||
u32 pixel_depth() const { return 24; }
|
||||
|
||||
private:
|
||||
explicit Screen(DOM::Window&);
|
||||
explicit Screen(HTML::Window&);
|
||||
|
||||
DOM::Window const& window() const { return ref_count_target(); }
|
||||
HTML::Window const& window() const { return ref_count_target(); }
|
||||
|
||||
Gfx::IntRect screen_rect() const;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue