mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 20:45:14 +00:00
LibWeb: Add HTMLCanvasElement.{width,height} properties
This commit is contained in:
parent
f1715bbd5e
commit
c4c549625f
Notes:
sideshowbarker
2024-07-19 08:12:07 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c4c549625fb
1 changed files with 12 additions and 0 deletions
|
@ -47,6 +47,18 @@ HTMLCanvasElementWrapper::HTMLCanvasElementWrapper(HTMLCanvasElement& element)
|
|||
}
|
||||
return JS::js_undefined();
|
||||
});
|
||||
put_native_property(
|
||||
"width",
|
||||
[this](JS::Object*) {
|
||||
return JS::Value(node().preferred_width());
|
||||
},
|
||||
nullptr);
|
||||
put_native_property(
|
||||
"height",
|
||||
[this](JS::Object*) {
|
||||
return JS::Value(node().preferred_height());
|
||||
},
|
||||
nullptr);
|
||||
}
|
||||
|
||||
HTMLCanvasElementWrapper::~HTMLCanvasElementWrapper()
|
||||
|
|
Loading…
Add table
Reference in a new issue