summaryrefslogtreecommitdiff
path: root/libs/litehtml/src/el_td.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/litehtml/src/el_td.cpp')
-rw-r--r--libs/litehtml/src/el_td.cpp35
1 files changed, 23 insertions, 12 deletions
diff --git a/libs/litehtml/src/el_td.cpp b/libs/litehtml/src/el_td.cpp
index 679d9212ab..659bfb1bc7 100644
--- a/libs/litehtml/src/el_td.cpp
+++ b/libs/litehtml/src/el_td.cpp
@@ -1,19 +1,26 @@
#include "html.h"
#include "el_td.h"
-
-litehtml::el_td::el_td(const std::shared_ptr<document>& doc) : html_tag(doc)
+namespace litehtml
{
+el_td::el_td(const shared_ptr<document>& doc) : html_tag(doc)
+{
}
-void litehtml::el_td::parse_attributes()
+void el_td::parse_attributes()
{
+ // https://html.spec.whatwg.org/multipage/rendering.html#tables-2:attr-tdth-width
const char* str = get_attr("width");
- if(str)
- {
- m_style.add_property(_width_, str);
- }
+ if (str)
+ map_to_dimension_property_ignoring_zero(_width_, str);
+
+ // https://html.spec.whatwg.org/multipage/rendering.html#tables-2:attr-tdth-height
+ str = get_attr("height");
+ if (str)
+ map_to_dimension_property_ignoring_zero(_height_, str);
+
+ // https://html.spec.whatwg.org/multipage/rendering.html#tables-2:attr-background
str = get_attr("background");
if(str)
{
@@ -22,11 +29,6 @@ void litehtml::el_td::parse_attributes()
url += "')";
m_style.add_property(_background_image_, url);
}
- str = get_attr("align");
- if(str)
- {
- m_style.add_property(_text_align_, str);
- }
str = get_attr("bgcolor");
if (str)
@@ -34,10 +36,19 @@ void litehtml::el_td::parse_attributes()
m_style.add_property(_background_color_, str, "", false, get_document()->container());
}
+ str = get_attr("align");
+ if(str)
+ {
+ m_style.add_property(_text_align_, str);
+ }
+
str = get_attr("valign");
if(str)
{
m_style.add_property(_vertical_align_, str);
}
+
html_tag::parse_attributes();
}
+
+} // namespace litehtml \ No newline at end of file