24 typedef shared_ptr<html_tag>
ptr;
37 explicit html_tag(
const shared_ptr<document>& doc);
44 string_id
tag()
const override;
45 string_id
id()
const override;
52 void set_attr(
const char*
name,
const char* val)
override;
53 const char*
get_attr(
const char*
name,
const char* def =
nullptr)
const override;
67 bool set_class(
const char* pclass,
bool add)
override;
70 void draw(
uint_ptr hdc,
int x,
int y,
const position *clip,
const std::shared_ptr<render_item> &ri)
override;
72 const std::shared_ptr<render_item> &ri)
override;
75 const Type&
get_property(string_id
name,
bool inherited,
const Type& default_value,
uint_ptr css_properties_member_offset)
const;
81 int select(
const string& selector)
override;
96 void get_text(
string& text)
override;
139 if (
value.is<Type>())
141 return value.get<Type>();
145 if (
auto _parent =
parent())
147 return *(Type*)((
byte*)&_parent->css() + css_properties_member_offset);
149 return default_value;
151 return default_value;
Definition background.h:91
Definition css_selector.h:173
Definition css_selector.h:195
std::vector< css_selector::ptr > vector
Definition css_selector.h:198
Definition stylesheet.h:45
elements_list m_children
Definition element.h:31
element::ptr parent() const
Definition element.h:170
std::shared_ptr< element > ptr
Definition element.h:25
friend class html_tag
Definition element.h:21
Definition iterators.h:29
const background * get_background(bool own_only=false) override
Definition html_tag.cpp:1477
element::ptr find_sibling(const element::ptr &el, const css_selector &selector, bool apply_pseudo=true, bool *is_pseudo=nullptr) override
Definition html_tag.cpp:1291
int select_attribute(const css_attribute_selector &sel)
Definition html_tag.cpp:652
void set_attr(const char *name, const char *val) override
Definition html_tag.cpp:86
void map_to_dimension_property_ignoring_zero(string_id prop_name, string attr_value)
Definition html_tag.cpp:1569
element::ptr find_adjacent_sibling(const element::ptr &el, const css_selector &selector, bool apply_pseudo=true, bool *is_pseudo=nullptr) override
Definition html_tag.cpp:1254
bool is_break() const override
Definition html_tag.cpp:850
element::ptr find_ancestor(const css_selector &selector, bool apply_pseudo=true, bool *is_pseudo=nullptr) override
Definition html_tag.cpp:713
vector< string_id > m_classes
Definition html_tag.h:29
bool is_replaced() const override
Definition html_tag.cpp:1040
bool is_only_child(const element::ptr &el, bool of_type) const override
Definition html_tag.cpp:1324
const Type & get_property(string_id name, bool inherited, const Type &default_value, uint_ptr css_properties_member_offset) const
Definition html_tag.h:135
bool on_mouse_leave() override
Definition html_tag.cpp:781
bool on_mouse_over() override
Definition html_tag.cpp:764
void draw_list_marker(uint_ptr hdc, const position &pos)
Definition html_tag.cpp:1045
void on_click() override
Definition html_tag.cpp:838
bool is_body() const override
Definition html_tag.cpp:754
void apply_stylesheet(const litehtml::css &stylesheet) override
Definition html_tag.cpp:180
void map_to_pixel_length_property_with_default_value(string_id prop_name, string attr_value, int default_value)
Definition html_tag.cpp:1543
element::ptr select_one(const string &selector) override
Definition html_tag.cpp:154
element::ptr get_element_after(const style &style, bool create)
Definition html_tag.cpp:1361
void add_style(const style &style) override
Definition html_tag.cpp:1400
void map_to_dimension_property(string_id prop_name, string attr_value)
Definition html_tag.cpp:1552
const vector< string_id > & classes() const
Definition html_tag.h:49
void set_data(const char *data) override
Definition html_tag.cpp:759
html_tag(const shared_ptr< document > &doc)
bool removeChild(const element::ptr &el) override
Definition html_tag.cpp:45
const string_vector & str_classes() const
Definition html_tag.h:50
bool set_class(const char *pclass, bool add) override
Definition html_tag.cpp:994
bool is_white_space() const override
Definition html_tag.cpp:363
string_id m_tag
Definition html_tag.h:26
void refresh_styles() override
Definition html_tag.cpp:1406
bool appendChild(const element::ptr &el) override
Definition html_tag.cpp:34
bool is_nth_child(const element::ptr &el, int num, int off, bool of_type, const css_selector::vector &selector_list) const override
Definition html_tag.cpp:1188
string dump_get_name() override
Definition html_tag.cpp:1522
vector< string_id > m_pseudo_classes
Definition html_tag.h:32
bool get_custom_property(string_id name, css_token_vector &result) const
Definition html_tag.cpp:324
bool on_lbutton_down() override
Definition html_tag.cpp:802
bool on_lbutton_up() override
Definition html_tag.cpp:819
element::ptr get_element_before(const style &style, bool create)
Definition html_tag.cpp:1345
void handle_counter_properties()
Definition html_tag.cpp:1378
style m_style
Definition html_tag.h:30
string_vector m_str_classes
Definition html_tag.h:28
elements_list & children()
Definition html_tag.h:129
const char * get_tagName() const override
Definition html_tag.cpp:76
string_id m_id
Definition html_tag.h:27
bool is_nth_last_child(const element::ptr &el, int num, int off, bool of_type, const css_selector::vector &selector_list) const override
Definition html_tag.cpp:1221
string get_list_marker_text(int index)
Definition html_tag.cpp:1143
string_id tag() const override
Definition html_tag.cpp:71
void set_tagName(const char *tag) override
Definition html_tag.cpp:81
bool set_pseudo_class(string_id cls, bool add) override
Definition html_tag.cpp:972
void compute_styles(bool recursive=true) override
Definition html_tag.cpp:340
void draw_background(uint_ptr hdc, int x, int y, const position *clip, const std::shared_ptr< render_item > &ri) override
Definition html_tag.cpp:855
void map_to_pixel_length_property(string_id prop_name, string attr_value)
Definition html_tag.cpp:1532
void get_text(string &text) override
Definition html_tag.cpp:746
const char * get_attr(const char *name, const char *def=nullptr) const override
Definition html_tag.cpp:115
void clearRecursive() override
Definition html_tag.cpp:56
void get_content_size(size &sz, int max_width) override
Definition html_tag.cpp:278
shared_ptr< html_tag > ptr
Definition html_tag.h:24
void parse_attributes() override
Definition html_tag.cpp:738
void select_all(const css_selector &selector, elements_list &res) override
Definition html_tag.cpp:140
string_id id() const override
Definition html_tag.cpp:66
void draw(uint_ptr hdc, int x, int y, const position *clip, const std::shared_ptr< render_item > &ri) override
Definition html_tag.cpp:290
string_map m_attrs
Definition html_tag.h:31
int select_pseudoclass(const css_attribute_selector &sel)
Definition html_tag.cpp:538
Definition line_box.h:110
const property_value & get_property(string_id name) const
Definition style.cpp:1431
Definition background.h:12
vector< css_token > css_token_vector
Definition css_tokenizer.h:151
std::uintptr_t uint_ptr
Definition types.h:17
const char * name
Definition encodings.cpp:1358
std::list< std::shared_ptr< element > > elements_list
Definition types.h:32
std::map< string, string > string_map
Definition types.h:31
std::vector< string > string_vector
Definition types.h:34
Definition css_selector.h:150
annotation select
Definition tag_strings.h:116