summaryrefslogtreecommitdiff
path: root/Base
AgeCommit message (Collapse)Author
2020-03-27Browser: Let the user add/remove bookmarks to the bookmarks barEmanuel Sprung
This patchset adds a Button to the toolbar (right next to the location field) with a star icon. The star is white if the currently visited url is not yet bookmarked and yellow if a bookmark for the url exists. After adding or removing a bookmark, the bookmark json file is synced to disk. Therefore, some new pledge/unveil's have been added.
2020-03-27Browser: Add bookmarks barEmanuel Sprung
This patchset adds a bookmark bar that is backed by a json file backend. The json file is loaded and checked for the format. According to the format, the bookmarks bar is populated with the bookmark items. If the bookmarks do not fit into one line, an expader button is shown that brings up a menu containing the missing bookmark items. There is currently no way to add or remove bookmarks. A hover over a bookmark is also not yet showing the url in the statusbar.
2020-03-26Base: Add a man page for js(1)Sergey Bugaev
This also changes --ast-dump to --dump-ast, because I like it better and that is what the variable is actually called.
2020-03-26Base: Replace <!DOCTYPE> with <!DOCTYPE html> in a few files (#1511)Elisée Maurer
<!DOCTYPE> by itself is not a valid document type declaration.
2020-03-25LibWeb: Implement getting and setting element.innerHTMLAndreas Kling
Getting the innerHTML property will recurse through the subtree inside the element and serialize it into a string as it goes. Setting it will parse the set value as an HTML fragment. It will then remove all current children of the element and replace them with all the children inside the parsed fragment. Setting element.innerHTML will currently force a complete rebuild of the document's layout tree. This is pretty neat! :^)
2020-03-25Keymap: Add FR keymap layoutredoste
This adds the standard French "AZERTY" keyboard layout. Some keys are unmapped because some characters are not supported : ²éèçà°€¨£¤ùµ§
2020-03-24LibJS: Implement "throw"Andreas Kling
You can now throw an expression to the nearest catcher! :^) To support throwing arbitrary values, I added an Exception class that sits as a wrapper around whatever is thrown. In the future it will be a logical place to store a call stack.
2020-03-24LibJS: Implement basic exception throwingAndreas Kling
You can now throw exceptions by calling Interpreter::throw_exception(). Anyone who calls ASTNode::execute() needs to check afterwards if the Interpreter now has an exception(), and if so, stop what they're doing and simply return. When catching an exception, we'll first execute the CatchClause node if present. After that, we'll execute the finalizer block if present. This is unlikely to be completely correct, but it's a start! :^)
2020-03-24LibJS: Parse "try", "catch" and "finally"Andreas Kling
This is the first step towards support exceptions. :^)
2020-03-23 LibWeb: CSS: Add "position: absolute" with top and leftmyphs
This momentarily handles the CSS property "position: absolute;" in combination with the properties "top" and "left", so that elements can be placed anywhere on the page independently from their parents. Statically positioned elements ignore absolute positioned elements when calculating their position as they don't take up space.
2020-03-22LibWeb: Add basic support for requestAnimationFrame()Andreas Kling
We now support rAF, driven by GUI::DisplayLink callbacks. It's a bit strange how we keep registering new callbacks over and over. That's something we can definitely optimize. This allows you to update animations/whatever without doing it more often than the browser can display.
2020-03-21Base: Add a demo web page for canvas+setInterval+randomnessAndreas Kling
Click somewhere in the black area and drag for colorful effect! :^)
2020-03-21Base: Tidy up the events.html test page a little bitAndreas Kling
2020-03-21LibJS: Delete fully-empty HeapBlocks after garbage collectionAndreas Kling
We now deallocate GC blocks when they are found to have no live cells inside them.
2020-03-21LibJS: Parse object expressions0xtechnobabble
2020-03-20LibJS: Add ArrayPrototype and implement Array.prototype.push()Andreas Kling
This function is ultimately supposed to be generic and allow any |this| that has a length property, but for now it only works on our own Array object type.
2020-03-20LibJS: Support reading/writing elements in an Array via Object get/putAndreas Kling
I'm not completely thrilled about Object::get() and Object::put() doing special-case stuff for arrays, and we should probably come up with a better abstraction for it. But at least it works for now, which is really nice. :^)
2020-03-20LibJS: Parse ArrayExpression and start implementing Array objectsAndreas Kling
Note that property lookup is not functional yet.
2020-03-20LibWeb: Add CSS property 'border'myphs
This makes it possible to write shorter CSS. Instead of writing .foo { border-width: 3px; border-style: solid; border-color: blue; } it is now possible to write .foo { border: 3px solid blue; } while the order of values is irrelevant. Currently only the basic values are supported. More values should be added in the future. Three more value specific parse functions were added: parse_line_width, parse_color, and parse_line_style Additionally a few test cases were added to borders.html.
2020-03-19Base: Add Calendar.afrhin123
2020-03-19Calendar: Add a 16x16 app iconrhin123
2020-03-19LibWeb: Add <canvas> element and start fleshing out CRC2DAndreas Kling
This patch adds HTMLCanvasElement along with a LayoutCanvas object. The DOM and layout parts are very similar to <img> elements. The <canvas> element holds a Gfx::Bitmap which is sized according to the "width" and "height" attributes on the element. Calling .getContext("2d") on a <canvas> element gives you a context object that draws into the underlying Gfx::Bitmap of the <canvas>. The context weakly points to the <canvas> which allows it to outlive the canvas element if needed. This is really quite cool. :^)
2020-03-19LibJS: Prefer FunctionDeclaration if a statement begins with "function"Andreas Kling
2020-03-18LibWeb: Fire "mousedown" and "mousemove" events in the DOM :^)Andreas Kling
2020-03-18LibWeb: Start working on DOM event supportAndreas Kling
This patch adds the EventTarget class and makes Node inherit from it. You can register event listeners on an EventTarget, and when you call dispatch_event() on it, the event listeners will get invoked. An event listener is basically a wrapper around a JS::Function*. This is pretty far from how DOM events should eventually work, but it's a place to start and we'll build more on top of this. :^)
2020-03-18SystemServer: Add WorkingDirectory supportItamar
Services can now have their initial working directory configured via `SystemServer.ini`. This commit also configures Terminal's working directory to be /home/anon
2020-03-17LibJS: Implement typeof operatorConrad Pankoff
2020-03-17Base: Add Joi thememarprok
2020-03-16LibJS: Replace the global print() function with console.log() :^)Andreas Kling
2020-03-16js: Fix simple scopes example0xtechnobabble
Weirdly enough, the "simple-scopes" test doesn't return undefined anymore, at first I thought the scoping was somehow broken, turns out the interpreter doesn't consider the returned y as the last evaluated value anymore, possibly because it's undefined (?).
2020-03-16LibJS: Implement abstract equality and inequality0xtechnobabble
2020-03-16LibGUI: Use themes for syntax highlightingOriko
2020-03-16Keymap: Add a US Dvorak keyboard layoutPřemysl Janouch
It is yet undecided how to name regional variants.
2020-03-15LibJS: Add ObjectPrototype and implement hasOwnProperty()Andreas Kling
All Objects will now have ObjectPrototype as their prototype, unless overridden.
2020-03-15LibJS: Add StringPrototype and make it the prototype of StringObjectAndreas Kling
This patch adds String.prototype.charAt() to demonstrate that prototype property lookup works, and that you can call a prototype function on an object, and it will do what you expect. :^)
2020-03-15Keymap: Add DE keymap layoutmyphs
This makes it easier to work with the german keyboard layout. Some keys are left unset because their corresponding letters aren't supported yet.
2020-03-14LibJS: Unescape strings in Token::string_value()Stephan Unverwerth
2020-03-14LibWeb: Implement Document.getElementById()Andreas Kling
This was pleasantly simple! We don't have an ElementWrapper yet, so it just returns a NodeWrapper, but it still basically works. :^)
2020-03-14LibWeb: Start implementing basic JavaScript DOM bindingsAndreas Kling
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! :^)
2020-03-14LibWeb: Parse <script> elements and run any JavaScript found insideAndreas Kling
This patch begins integrating LibJS into LibWeb. Document holds the JS::Interpreter for now, and it is created on demand when you first call Document::interpreter(). We also add a simple "alert()" function to the global object.
2020-03-14LibJS: Lex single quote strings, escaped chars and unterminated stringsStephan Unverwerth
2020-03-14LibJS: Add operator precedence parsingStephan Unverwerth
Obey precedence and associativity rules when parsing expressions with chained operators.
2020-03-13HackStudio: Add Javascript projectsOriko
2020-03-13Solitaire: Add about dialog and 32x32 iconTill Mayer
2020-03-12LibJS: Replace $gc() hack with a NativeFunction on the global objectAndreas Kling
To make this work, also start passing Interpreter& to native functions.
2020-03-12LibJS: Add NativeFunction, a callable wrapper around a C++ lambdaAndreas Kling
This can be used to implement arbitrary functionality, callable from JavaScript. To make this work, I had to change the way CallExpression passes arguments to the callee. Instead of a HashMap<String, Value>, we now pass an ordered list of Argument { String name; Value value; }. This patch includes a native "print(argument)" function. :^)
2020-03-12Meta: Add for-loop JavaScript test programConrad Pankoff
2020-03-12LibJS: Add test for function with argumentshowar6hill
2020-03-12LibJS: Implement basic MemberExpression parsingAndreas Kling
At last we can parse "hello friends".length :^)
2020-03-12js: Take the script file as a command-line argumentAndreas Kling
Now that we have the beginnings of a parser, let's take the script to run as a command-line argument and move all the test scripts into /home/anon/js :^) To run a script, simply use "js": $ js my-script.js To get an AST dump before execution, you can use "js -A"