summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-06-16LibKeyboard: Replace char data type to u32 for code pointHüseyin ASLITÜRK
2020-06-16Base: Typo correction in trq.jsonHüseyin ASLITÜRK
2020-06-16LibC: Declare pthread_sigmask() in signal.h.Nico Weber
That's where it's supposed to be declared.
2020-06-15LibGUI: Use new Bitmap::is_path_a_supported_image_format methodHüseyin ASLITÜRK
2020-06-15QuickShow: Use new Bitmap::is_path_a_supported_image_format methodHüseyin ASLITÜRK
2020-06-15LibGfx: Add a new Bitmap::is_path_a_supported_image_format() methodHüseyin ASLITÜRK
Move the image file detection code to the File class to prevent code duplication.
2020-06-15LibGUI: Don't update cursor, if visual data out-of-dateKevin Meyer
This fixes https://github.com/SerenityOS/serenity/issues/2498 A nullptr dereference was caused by the visual data beeing out of sync with the line data, due to a deferred recompute.
2020-06-15AK: Assert non-empty Utf32View, when initialized with non-zero lengthKevin Meyer
This was useful in debugging a nullptr dereference, which was happening through later, but was caused by this inconsistent initialization.
2020-06-15LibWeb: Fix broken parsing of </form> during "in body" insertionAndreas Kling
2020-06-15LibWeb: Don't load stylesheets with rel="alternate"Andreas Kling
We're not supposed to load these by default. Alternate stylesheets can be offered in a menu or something, if the user is interested.
2020-06-15LibWeb: Fix broken parsing of </select> during "in select" insertionAndreas Kling
2020-06-15LibWeb: Just ignore <script> elements that failed to load the scriptAndreas Kling
We're never gonna be able to run them if we can't load them so just let it go.
2020-06-15LibWeb: Use the URL encoder from AK instead of rolling a custom oneAndreas Kling
2020-06-15LibWeb: Force a full relayout if an element's CSS display changesAndreas Kling
Not doing this was causing the wrong kind of LayoutNode to stay around even though we had the final "display" value.
2020-06-15LibWeb: Allow block children of inlinesAndreas Kling
Hey, why not. We did all the hard work for display:inline-block already and now we can just allow this. This makes <a><h1>Hello friends!</h1></a> work :^)
2020-06-15LibWeb: Respect CSS z-index property while paintingAndreas Kling
To support z-ordering when painting, the layout tree now has a parallel sparse tree of stacking contexts. The rules for which layout boxes establish a stacking context are a bit complex, but the intent is to encapsulate the decision making into establishes_stacking_context(). When we paint, we start from the ICB (LayoutDocument) who always has a StackingContext and then paint the tree of StackingContexts where each node has its children sorted by z-index. This is pretty crude, but gets the basic job done. Note that this does not yet support hit testing; hit testing is still done using a naive treewalk from the root.
2020-06-15LibWeb: Layout nodes without own style can't be absolutely positionedAndreas Kling
The only layout nodes that don't have their own style are LayoutText (they inherit the style from their parent element since text cannot be styled by CSS.) However, it never makes sense for text nodes to have absolute position so don't claim it.
2020-06-15LibC: Add truncate().Nico Weber
Implemented in user space for now.
2020-06-14LibWeb: Make the specificity sort comparator a bit more readableAndreas Kling
2020-06-14LibWeb: Don't assert when containing block doesn't know how to placeAndreas Kling
We can just log that we don't know what to do for now.
2020-06-14LibWeb: Don't animate images outside the visible viewport :^)Andreas Kling
2020-06-14LibWeb: Move "visible in viewport" state tracking to ImageLoaderAndreas Kling
This should technically apply to any LayoutImage, so let's just move it to ImageLoader.
2020-06-14LibWeb: Move bitmap animation from HTMLImageElement to ImageLoaderAndreas Kling
Since ImageLoader manages the image decoder anyway, let it manage animation as well.
2020-06-14LibWeb: Remove some unused functions from LayoutTableAndreas Kling
2020-06-14LibWeb: Remove some unused functions from HTMLImageElementAndreas Kling
2020-06-14LibWeb: Reorganize layout algorithmAndreas Kling
Previously, layout recursively performed these steps (roughly): 1. Compute own width 2. Compute own position 3. Layout in-flow children 4. Compute own height 5. Layout absolutely positioned descendants However, step (2) was pretty inconsistent. Some things computed their own position, others had their parent do it for them, etc. To get closer to CSS spec language, and make things easier in general, this patch reorganizes the algorithm into: 1. Compute own width & height 2. Compute width & height of in-flow managed descendants 3. Move in-flow managed descendants to their final position 4. Layout absolutely positioned descendants Block layout is now driven by the containing block, which will iterate the descendants it's responsible for. There are a lot of inefficient patterns in this logic right now, but they can easily be replaced with better iteration functions once we settle on a long-term architecture. Since the ICB (LayoutDocument) is at (0, 0), it doesn't rely on a containing block to move it into place. This code is still evolving along with my understanding of CSS layout, so it's likely that we'll reorganize this again sooner or later. :^)
2020-06-14LibWeb: Dump layout node style properties in alphabetical orderAndreas Kling
2020-06-14LibWeb: Simplify LayoutBlock::layout_block_children() a little bitAndreas Kling
No need to worry about inline children if children are not inline(!)
2020-06-14LibWeb: Add LayoutNode::frame() reference getterAndreas Kling
Any live layout tree always has a corresponding live Frame, as we will never create a layout tree for a frameless document.
2020-06-14LibWeb: Don't choke when trying to render a document-less <iframe>Andreas Kling
Just paint it like an empty box if there's no document in the frame.
2020-06-14LibWeb: Fully implement HTML parser "in table" insertion modeLuke
Also fixes some little mistakes in the "in body" insertion mode that I found whilst cross-referencing.
2020-06-14LibWeb: Implement HTML parser "in column group" insertion modeLuke
2020-06-14LibWeb: Implement HTML parser "in caption" insertion modeLuke
2020-06-14LibWeb: Implement all CDATA tokenizer statesLuke
Even though we haven't implemented any switches to these states yet, we may as well have them ready for when we do implement the switches.
2020-06-14LibWeb: Fully implement all DOCTYPE tokenizer statesLuke
Also fixes TagOpen having a seperate emit and reconsume in ANYTHING_ELSE.
2020-06-14LibWeb: Fully implement all comment tokenizer statesLuke
2020-06-13LibWeb: Add basic <object> element supportAndreas Kling
This patch implements a simple <object> element with fallback content. If the URL from the data attribute fails to load (including 404), we render the DOM tree inside the <object> as fallback content. This works by generating a different layout tree for the <object> depending on the state and success of the data load. Since we cannot currently do incremental layout tree updates, we have to force a complete layout tree rebuild when the resource load finishes/fails.
2020-06-13LibWeb: Split out image loading logic from HTMLImageElementAndreas Kling
Since more DOM nodes are going to want to load images (<object>, ...) this patch splits out the image loading logic into an ImageLoader class and then HTMLImageElement simply has an ImageLoader. LayoutImage is then given a const ImageLoader& at construction and can then provide layout and rendering for many kinds of DOM nodes.
2020-06-13LibWeb: Add "data" to HTML::AttributeNamesAndreas Kling
2020-06-13ProtocolServer+LibProtocol: Propagate HTTP status codes to clientsAndreas Kling
Clients now receive HTTP status codes like 200, 404, etc. Note that a 404 with content is still considered a "successful" download from ProtocolServer's perspective. It's up to the client to interpret the status code. I'm not sure if this is the best API, but it'll work for now.
2020-06-13LibWeb: Fix LayoutImage stupidly painting backgrounds over itselfAndreas Kling
The good boy fix here would be to implement all of the CSS paint phases but for now, let's at least not paint a background over our image. :^)
2020-06-13LibGfx: Painter::draw_line() can just return early if alpha == 0Andreas Kling
2020-06-13LibWeb: Have DOM nodes start out in "needs style update" stateAndreas Kling
Otherwise we won't get the first fully styled look until you interact with the page (e.g via hovering an element.)
2020-06-13LibWeb: Expand background:none into background-color:transparentAndreas Kling
2020-06-13LibGfx: Add Color::Transparent as a named colorAndreas Kling
2020-06-13LibWeb: <link rel> is actually a space-separated list of tokensAndreas Kling
...so when we check for rel=stylesheet, we have to split it up into parts first. :^)
2020-06-13LibWeb: Sort style properties by name in the inspector windowAndreas Kling
2020-06-13Base: Add some interlaced PNGs to the local copies of the pngsuite testsPaul Roukema
2020-06-13LibGfx: Implement support for decoding interlaced PNGsPaul Roukema
This adds support for decoding the Adam7 interlacing used in some PNGs. Notably this includes many of the images (such as the eyes) used in the acid2 test :^) Note that the HTML engine still doesn't understand the <object> tag well enough to show the eyes on the test.
2020-06-13LibGfx: Fix PNG decoder handling of 16-bit RGB imagesPaul Roukema