mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibWeb: Turn <table width> into the CSS width property
This commit is contained in:
parent
ca41c2e4a0
commit
c5a3d99dd5
Notes:
sideshowbarker
2024-07-19 05:41:35 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c5a3d99dd5c
2 changed files with 14 additions and 1 deletions
|
@ -25,6 +25,7 @@
|
|||
*/
|
||||
|
||||
#include <LibWeb/DOM/HTMLTableElement.h>
|
||||
#include <LibWeb/Parser/CSSParser.h>
|
||||
|
||||
namespace Web {
|
||||
|
||||
|
@ -37,4 +38,13 @@ HTMLTableElement::~HTMLTableElement()
|
|||
{
|
||||
}
|
||||
|
||||
void HTMLTableElement::apply_presentational_hints(StyleProperties& style) const
|
||||
{
|
||||
for_each_attribute([&](auto& name, auto& value) {
|
||||
if (name == HTML::AttributeNames::width) {
|
||||
style.set_property(CSS::PropertyID::Width, parse_css_value(value));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,10 +30,13 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
class HTMLTableElement : public HTMLElement {
|
||||
class HTMLTableElement final : public HTMLElement {
|
||||
public:
|
||||
HTMLTableElement(Document&, const FlyString& tag_name);
|
||||
virtual ~HTMLTableElement() override;
|
||||
|
||||
private:
|
||||
virtual void apply_presentational_hints(StyleProperties&) const override;
|
||||
};
|
||||
|
||||
template<>
|
||||
|
|
Loading…
Reference in a new issue