mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Use dimension image source for images
Fixes tiny images on Wikipedia
This commit is contained in:
committed by
Sam Atkins
parent
31cbe2061a
commit
b8f31179b2
Notes:
github-actions[bot]
2026-02-13 10:44:04 +00:00
Author: https://github.com/ChaseKnowlden Commit: https://github.com/LadybirdBrowser/ladybird/commit/b8f31179b22 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7904 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -78,6 +78,7 @@
|
||||
#include <LibWeb/DOM/ShadowRoot.h>
|
||||
#include <LibWeb/HTML/HTMLBRElement.h>
|
||||
#include <LibWeb/HTML/HTMLHtmlElement.h>
|
||||
#include <LibWeb/HTML/HTMLImageElement.h>
|
||||
#include <LibWeb/HTML/HTMLSlotElement.h>
|
||||
#include <LibWeb/HTML/Parser/HTMLParser.h>
|
||||
#include <LibWeb/Layout/Node.h>
|
||||
@@ -1274,8 +1275,11 @@ GC::Ref<CascadedProperties> StyleComputer::compute_cascaded_values(DOM::Abstract
|
||||
auto& element = abstract_element.element();
|
||||
element.apply_presentational_hints(cascaded_properties);
|
||||
if (element.supports_dimension_attributes()) {
|
||||
apply_dimension_attribute(cascaded_properties, element, HTML::AttributeNames::width, CSS::PropertyID::Width);
|
||||
apply_dimension_attribute(cascaded_properties, element, HTML::AttributeNames::height, CSS::PropertyID::Height);
|
||||
auto const& dimension_source = is<HTML::HTMLImageElement>(element)
|
||||
? static_cast<HTML::HTMLImageElement const&>(element).dimension_attribute_source()
|
||||
: element;
|
||||
apply_dimension_attribute(cascaded_properties, dimension_source, HTML::AttributeNames::width, CSS::PropertyID::Width);
|
||||
apply_dimension_attribute(cascaded_properties, dimension_source, HTML::AttributeNames::height, CSS::PropertyID::Height);
|
||||
}
|
||||
|
||||
// SVG presentation attributes are parsed as CSS values, so we need to handle potential custom properties here.
|
||||
|
||||
Reference in New Issue
Block a user