mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:57:34 +00:00
LibWeb: Fix mismatching Resource subclass types
This was a confusing bug: ImageStyleValue loaded its image resource as a Generic resource, while HTMLImageElement loaded as Image. This patch fixes the issue and adds an assertion to verify that we only share resources that have the same C++ client class type.
This commit is contained in:
parent
3337365000
commit
5dc8c4a24c
5 changed files with 13 additions and 3 deletions
|
@ -36,7 +36,7 @@
|
|||
#include <LibGfx/Color.h>
|
||||
#include <LibWeb/CSS/Length.h>
|
||||
#include <LibWeb/CSS/PropertyID.h>
|
||||
#include <LibWeb/Loader/Resource.h>
|
||||
#include <LibWeb/Loader/ImageResource.h>
|
||||
|
||||
namespace Web {
|
||||
|
||||
|
@ -302,7 +302,7 @@ private:
|
|||
|
||||
class ImageStyleValue final
|
||||
: public StyleValue
|
||||
, public ResourceClient {
|
||||
, public ImageResourceClient {
|
||||
public:
|
||||
static NonnullRefPtr<ImageStyleValue> create(const URL& url, Document& document) { return adopt(*new ImageStyleValue(url, document)); }
|
||||
virtual ~ImageStyleValue() override { }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue