mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:17:36 +00:00
LibWeb: Start implementing basic JavaScript DOM bindings
This patch introduces the Wrapper and Wrappable classes. Node now inherits from Wrappable, and can be wrapped in a GC-allocated Bindings::NodeWrapper object. The only property we expose right now is the very simple nodeName property. When a Document's JS::Interpreter is first instantiated, we add a "document" property with a DocumentWrapper object to the global object. This is pretty cool! :^)
This commit is contained in:
parent
9c9d3f0904
commit
1c406294fc
14 changed files with 196 additions and 1 deletions
12
Base/home/anon/www/dom.html
Normal file
12
Base/home/anon/www/dom.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE>
|
||||
<html>
|
||||
<head></head>
|
||||
<body>
|
||||
<div id="foo"></div>
|
||||
<script>
|
||||
alert(document.nodeName);
|
||||
//var e = document.getElementById("foo");
|
||||
//alert(e.nodeName);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -23,6 +23,7 @@ h1 {
|
|||
<p>This is a very simple browser built on the LibWeb engine.</p>
|
||||
<p>Some small test pages:</p>
|
||||
<ul>
|
||||
<li><a href="dom.html">simple DOM JS test</a></li>
|
||||
<li><a href="alert.html">alert() test</a></li>
|
||||
<li><a href="small.html">small</a></li>
|
||||
<li><a href="first-child.html">:first-child</a></li>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue