summaryrefslogtreecommitdiff
path: root/Base/home/anon/www
AgeCommit message (Collapse)Author
2020-04-03LibWeb: Implement <script src> support for synchronous scriptsAndreas Kling
Scripts loaded in this way will block the parser until they finish executing. This means that they see the DOM before the whole document has been fully parsed. This is all normal, of course. To make this work, I changed the way we notify DOM nodes about tree insertion. The inserted_into() callbacks are now incrementally invoked during parse, as each node is appended to its parent. To accomodate inline scripts and inline style sheets, we now also have a children_changed() callback which is invoked on any parent when it has children added/removed.
2020-04-03LibWeb: Add "navigator" object and expose navigator.userAgentAndreas Kling
A lot of web content looks for this property. We'll probably have to tweak this as we go, but at least now we have it. :^)
2020-03-31Base: Tweak the canvas demo page to stop using fractional RGB valuesAndreas Kling
This is a hack to workaround missing support for fractional values in "rgb(r,g,b)" color parsing.
2020-03-30LibWeb: Support more advanced selectors in document.querySelectorAll()Andreas Kling
I made some mistakes in the selector parsing code. It's now able to parse selectors composed of multiple complex selectors, instead of just one complex selector.
2020-03-30LibWeb: Add naive support for document.querySelectorAll()Andreas Kling
This currently returns a JS::Array of elements matching a selector. The more correct behavior would be to return a static NodeList, but as we don't have NodeLists right now, that'll be a task for the future.
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-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-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-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-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-07LibWeb: Rename directory LibHTML => LibWebAndreas Kling
Let's rename this to LibWeb since it aims to provide more parts of the web platform than just HTML. :^)
2019-12-16LibHTML: Support the :only-child pseudo classAndreas Kling
2019-12-16LibHTML: Support the :empty pseudo classAndreas Kling
2019-12-16LibHTML: Support the :first-child and :last-child pseudo classesAndreas Kling
2019-11-25LibHTML: Implement basic <form> and <input> element supportAndreas Kling
This patch adds "submit" inputs and default (text box) inputs, as well as form elements that can be submitted. Layout of input elements is implemented via a new LayoutWidget class that allows you to put an arbitrary GWidget in the layout tree. At the moment, the DOM node sets the initial size of the LayoutWidget, and then the positioning is done by the normal layout algorithm. We also now support submitting a <form method="GET">, which does a full replacing load with a URL based on the form's action + a query string built from the name/value of input elements within the submitted form. This is pretty neat! :^)
2019-11-25Base: Import the 1st and 2nd Acid tests for web standards complianceAndreas Kling
Getting these to work will take a lot of work, but most of it will be pretty fun, so I guess we start by importing them. :^)
2019-11-25LibHTML: Draw each CSS border edge separately with their own styleAndreas Kling
The borders still look very wrong with any border-width other than 1, but at least we can see that they have the right color, and end up in mostly the right place :^)
2019-11-21LibHTML: Handle stand-alone attribute selectorsAndreas Kling
A selector like "[foo]" is now parsed as a universal selector component with an attribute match type. Pretty neat :^)
2019-11-21LibHTML: Implement some attribute selector supportAndreas Kling
This patch adds a[foo] and a[foo=bar] attribute selectors. Note that an attribute selector is an optional part of a selector component, and not a component on its own.
2019-11-10Base: Add link to bettermotherfuckingwebsite in welcome.htmlMarcel Schneider
2019-11-07Base: Add a local copy of bettermotherfuckingwebsite.com for testingAndreas Kling
2019-10-20LibHTML: Implement "text-align: justify"Andreas Kling
In order for this to work nicely, I made the line box classes use float instead of int for its geometry information. Justification works by distributing all of the whitespace on the line (including the trailing whitespace before the line break) evenly across the spaces in-between words. We should probably use floating point (or maybe fixed point?) for all the layout metrics stuff. But one thing at a time. :^)
2019-10-20LibHTML+Browser: Support scrolling to anchor with <a href="#foo">Andreas Kling
This patch implements basic support for <a href="#foo"> fragment links. To figure out where we actually want to scroll to, we have to do something different based on the layout node's box type. So if it's a regular LayoutBox we can just use the LayoutBox::position(). However, if it's an inline layout node, we use the position of the first line box fragment in the containing block contributed by this layout node or one of its descendants.
2019-10-19LibHTML: Implement basic tiled background image supportAndreas Kling
It's now possible to set a page background image via <body background>. Also, HtmlView now officially handles rendering the body element's background (color, image or both.) LayoutBox is responsible for all other background rendering. Note that it's not yet possible to use CSS background-image properties directly, since we can't parse them yet. :^)
2019-10-16LibHTML: Add the <center> elementAndreas Kling
This is really just "center { display: block; text-align: center; }" in the default stylesheet, but it totally works!
2019-10-16LibHTML: Implement CSS text-align: left/center/rightAndreas Kling
This was easier than I imagined; we just shift each line box to the left based on the alignment and the remaining space on each line. :^)
2019-10-14LibHTML: Implement basic :hover pseudo-class supportAndreas Kling
This is currently very aggressive. Whenever the Document's hovered node changes, we invalidate all style and do a full relayout. It does look cool though. So cool that I'm adding it to the default stylesheet. :^)
2019-10-13LibHTML: Handle comments in the CSS parserAndreas Kling
Turn consume_whitespace() into consume_whitespace_or_comments() and have it swallow /* comments */ as well.
2019-10-12LibHTML: Add Comment and CharacterData nodes and improve HTML parsingAndreas Kling
This patch adds the CharacterData subclass of Node, which is now the parent class of Text and a new Comment class. A Comment node is one of these in HTML: <!--hello friends--> Since these occur somewhat frequently on the web, we need to be able to parse them. This patch also adds a child rejection mechanism to the DOM tree. Nodes can now override is_child_allowed(Node) and return false if they don't want a particular Node to become a child of theirs. This is used to prevent Document from taking on unwanted children.
2019-10-12LibHTML: Implement the <br> element for line breakingAndreas Kling
The <br> element will produce a special LayoutBreak node in the layout tree, which forces a break in the line layout whenever encountered. This patch also makes LayoutBlock use the current line-height as the minimum effective height for each line box. This ensures that having multiple <br> elements in a row doesn't create 0-height line boxes.
2019-10-09LibHTML: Implement the <blink> elementAndreas Kling
Just in time for Serenity's 1st birthday, here is the <blink> element! This patch adds a bunch of different mechanisms to enable partial repaints of the layout tree (LayoutNode::set_needs_display())) It also adds LayoutNode::is_visible(), which can be toggled to prevent a LayoutNode from rendering anything (it still takes up space though.)
2019-10-08LibHTML: Add ResourceLoader to support protocol-agnostic URL loadingAndreas Kling
We now support loading both file:// and http:// URLs. Feel free to visit http://www.serenityos.org/ and enjoy the fancy good times. :^)
2019-10-07LibHTML: Start adding support for <link rel="stylesheet">Andreas Kling
This patch adds basic support for external stylesheets. It currently only works with file:// URLs. We do a synchronous full relayout after loading a stylesheet, which is definitely on the aggressive side, but it gives us something to work on improving. :^)
2019-10-06LibDraw: Parse some more color string formats found on the webAndreas Kling
This patch adds the 17 color names from CSS2.1, as well as support for the "#rgb" shorthand where each component is a hex digit that gets multiplied by 17.
2019-10-06LibHTML: Add adjacent (+) and general (~) sibling combinatorsAndreas Kling
This patch implements two more selector features: - "div + p" matches the <p> sibling immediately after a <div>. - "div ~ p" matches all <p> siblings after a <div>.
2019-10-06LibHTML: Implement immediate-child selectors (#foo > #bar)Andreas Kling
2019-10-06LibHTML: Implement matching for descendant selectorsAndreas Kling
The CSS engine now correctly matches selectors like "#foo #bar #baz".
2019-10-06Base: Add a page for image features to the www directoryConrad Pankoff
2019-10-05Base: Add a little welcome page for the browser at ~/www/welcome.htmlAndreas Kling
2019-10-04Base: Add a little HTML test for presentational hintsAndreas Kling
2019-10-01Base: Rename the "html" test directory to "www"Andreas Kling
It was conflicting with the html program and I'm too lazy to deal with that right now. :^)