mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 08:05:09 +00:00
LibWeb: Support background attribute on table elements
This commit is contained in:
parent
b1af91d8c4
commit
176baf7cdb
2 changed files with 12 additions and 0 deletions
|
@ -9,6 +9,8 @@
|
||||||
#include <LibWeb/CSS/StyleProperties.h>
|
#include <LibWeb/CSS/StyleProperties.h>
|
||||||
#include <LibWeb/CSS/StyleValues/ColorStyleValue.h>
|
#include <LibWeb/CSS/StyleValues/ColorStyleValue.h>
|
||||||
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
|
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
|
||||||
|
#include <LibWeb/CSS/StyleValues/ImageStyleValue.h>
|
||||||
|
#include <LibWeb/DOM/Document.h>
|
||||||
#include <LibWeb/HTML/HTMLTableCellElement.h>
|
#include <LibWeb/HTML/HTMLTableCellElement.h>
|
||||||
#include <LibWeb/HTML/Parser/HTMLParser.h>
|
#include <LibWeb/HTML/Parser/HTMLParser.h>
|
||||||
|
|
||||||
|
@ -61,6 +63,10 @@ void HTMLTableCellElement::apply_presentational_hints(CSS::StyleProperties& styl
|
||||||
if (auto parsed_value = parse_nonzero_dimension_value(value))
|
if (auto parsed_value = parse_nonzero_dimension_value(value))
|
||||||
style.set_property(CSS::PropertyID::Height, parsed_value.release_nonnull());
|
style.set_property(CSS::PropertyID::Height, parsed_value.release_nonnull());
|
||||||
return;
|
return;
|
||||||
|
} else if (name == HTML::AttributeNames::background) {
|
||||||
|
if (auto parsed_value = document().parse_url(value); parsed_value.is_valid())
|
||||||
|
style.set_property(CSS::PropertyID::BackgroundImage, CSS::ImageStyleValue::create(parsed_value).release_value_but_fixme_should_propagate_errors());
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
#include <LibWeb/Bindings/Intrinsics.h>
|
#include <LibWeb/Bindings/Intrinsics.h>
|
||||||
#include <LibWeb/CSS/StyleProperties.h>
|
#include <LibWeb/CSS/StyleProperties.h>
|
||||||
#include <LibWeb/CSS/StyleValues/ColorStyleValue.h>
|
#include <LibWeb/CSS/StyleValues/ColorStyleValue.h>
|
||||||
|
#include <LibWeb/CSS/StyleValues/ImageStyleValue.h>
|
||||||
|
#include <LibWeb/DOM/Document.h>
|
||||||
#include <LibWeb/DOM/ElementFactory.h>
|
#include <LibWeb/DOM/ElementFactory.h>
|
||||||
#include <LibWeb/DOM/HTMLCollection.h>
|
#include <LibWeb/DOM/HTMLCollection.h>
|
||||||
#include <LibWeb/HTML/HTMLTableCellElement.h>
|
#include <LibWeb/HTML/HTMLTableCellElement.h>
|
||||||
|
@ -43,6 +45,10 @@ void HTMLTableRowElement::apply_presentational_hints(CSS::StyleProperties& style
|
||||||
if (color.has_value())
|
if (color.has_value())
|
||||||
style.set_property(CSS::PropertyID::BackgroundColor, CSS::ColorStyleValue::create(color.value()).release_value_but_fixme_should_propagate_errors());
|
style.set_property(CSS::PropertyID::BackgroundColor, CSS::ColorStyleValue::create(color.value()).release_value_but_fixme_should_propagate_errors());
|
||||||
return;
|
return;
|
||||||
|
} else if (name == HTML::AttributeNames::background) {
|
||||||
|
if (auto parsed_value = document().parse_url(value); parsed_value.is_valid())
|
||||||
|
style.set_property(CSS::PropertyID::BackgroundImage, CSS::ImageStyleValue::create(parsed_value).release_value_but_fixme_should_propagate_errors());
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue