summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-03-24LibWeb: Parse and compute text-shadow propertySam Atkins
2022-03-24Base: Add a text-shadow test pageSam Atkins
2022-03-24LibWeb: Implement disallowing `inset` when parsing shadowsSam Atkins
`text-shadow` does not support this, so this way we can still use the same parsing code. It's OK that we still assign a ShadowPlacement value to the ShadowStyleValue, since it will just get ignored when painting text-shadows, but if it appears in the property value then that is a syntax error.
2022-03-24LbWeb: Rename BoxShadowFoo => ShadowFooSam Atkins
The `text-shadow` property is almost identical to `box-shadow`: > Values are interpreted as for box-shadow [CSS-BACKGROUNDS-3]. > (But note that the inset keyword are not allowed.) So, let's use the same data structures and parsing code for both. :^)
2022-03-24LibWeb: Ignore application objects until we can support themTimothy Flynn
The HTMLObjectElement spec is set up to ignore application/octet-stream MIME types only. For this to work, we need to implement the MIME type sniffing algorithm so that all unknown MIME types become mapped to the application/octet-stream type. Until then, ignore all application/ MIME types as we won't be able to display them anyways.
2022-03-24LibWeb: Discard an object's nested browsing contexts when falling backTimothy Flynn
2022-03-24LibWeb: Implement falling back early to an object's child representationTimothy Flynn
2022-03-24LibWeb: Conditionally update an object's children when its state changesTimothy Flynn
We should only update the object children of an object when the parent's representation changes to/from falling back to its children.
2022-03-24LibWeb: Correctly handle unknown MIME types in HTMLObjectElementTimothy Flynn
We were using the literal string "unknown" as the unknown MIME type, which caused us to treat the object as a nested browsing context (as "unknown" does not start with "image/"). Use an Optional instead to prevent this mishap.
2022-03-24LibGfx: TrueTypeFont cleanupJelle Raaijmakers
No functional changes.
2022-03-24LibGfx: Implement TTF kerning tablesJelle Raaijmakers
If a TTF font contains kern tables, we now read through all of them and apply any kerning values to character rendering.
2022-03-24Profiler: Render signposts behind histogramsSimon Wanner
Since signposts render along the full height they could hide CPU usage spikes. This way that won't be an issue. :^)
2022-03-24LibWeb: Emit signposts for resource loadsSimon Wanner
2022-03-24LibWeb: Add missing spec comment in focusing logicNukiloco
2022-03-24sql: Re-prompt user for input after unrecognized commandNicholas Cellino
This fixes a bug in the SQL REPL where after a user enters an unrecognized command, the REPL would not print another "> " prompt and would not accept any more input.
2022-03-24readlink: Use StringView instead of const char*Kenneth Myhra
2022-03-24readlink: Port to LibMainKenneth Myhra
2022-03-24Userland+Tests: Convert File::read_link() from String to ErrorOr<String>Kenneth Myhra
This converts the return value of File::read_link() from String to ErrorOr<String>. The rest of the change is to support the potential of an Error being returned and subsequent release of the value when no Error is returned. Unfortunately at this stage none of the places affected can utililize our TRY() macro.
2022-03-24Meta: Add Maciej (sppmacd) to the contributors list :^)Andreas Kling
2022-03-24LibWeb: Begin supporting non-image HTMLObjectElement data representationTimothy Flynn
We currently only supported loading image data from an HTMLObjectElement node. This adds (some) support for non-image data. A big FIXME is to actually paint that data. We will need to make FrameBox and NestedBrowsingContextPaintable work with HTMLObjectElement for this (they currently only work with HTMLIFrameElement).
2022-03-24LibWeb: Move automatic browsing context creation to HTMLIFrameElementTimothy Flynn
We will soon have two DOM nodes which contain nested browsing contexts: HTMLIFrameElement and HTMLObjectElement. Only HTMLIFrameElement should have its nested context created automatically upon insertion, so move the invocation of that logic to HTMLIFrameElement.
2022-03-24LibWeb: Remove inheritance of FormAssociatedElement from HTMLElementTimothy Flynn
HTMLObjectElement will need to be both a FormAssociatedElement and a BrowsingContextContainer. Currently, both of these classes inherit from HTMLElement. This can work in C++, but is generally frowned upon, and doesn't play particularly well with the rest of LibWeb. Instead, we can essentially revert commit 3bb5c62 to remove HTMLElement from FormAssociatedElement's hierarchy. This means that objects such as HTMLObjectElement individually inherit from FormAssociatedElement and HTMLElement now. Some caveats are: * FormAssociatedElement still needs to know when the HTMLElement is inserted into and removed from the DOM. This hook is automatically injected via a macro now, while still allowing classes like HTMLInputElement to also know when the element is inserted. * Casting from a DOM::Element to a FormAssociatedElement is now a sideways cast, rather than directly following an inheritance chain. This means static_cast cannot be used here; but we can safely use dynamic_cast since the only 2 instances of this already use RTTI to verify the cast.
2022-03-24LibMain: Statically link LibMainLenny Maiorani
LibMain is dynamically linked in every binary. This results in a slightly slower load time. In the past people have pegged this at 0.7 ms on some hardware. This change makes it statically linked and eliminates 0.6 ms of run-time on my machine. This is tested by running a script which just executed `/bin/true` in a loop 10,000 times. Before this patch it reliably executed in ~90,000 ms. After this patch it is ~84,000 ms. This is a speed up of 6,000 ms over 10,000 executions, or 0.6 ms per execution.
2022-03-24CMake: Add serenity_lib_staticLenny Maiorani
2022-03-24PixelPaint: Call set_modified on windowGeekFiftyFive
Call set_modified on window in order to reflect unsaved changed in the titlebar's close button
2022-03-23Base: Add a quote from Ali, the mememaster extr'ordinairekleines Filmröllchen
2022-03-23LibWeb: Update HTMLObjectElement's children on fallback state changesTimothy Flynn
This is another event upon which the task to determine an object's respresentation must be queued: * one of the element's ancestor object elements changes to or from showing its fallback content For example, on Acid2, the image for the eyes is nested below an object that is designed to fail to load. This ensures the eyes will render as the fallback of the failed parent object.
2022-03-23LibWeb: Move HTMLObjectElement spec link to correct methodTimothy Flynn
2022-03-23LibWeb: Evict replaced Resource objects from cacheTimothy Flynn
When a Resource is converted to an ImageResource, evict the original resource from cache. The original resource's data has been moved, so on a warm reload of a page, when that resource is loaded from cache, it would not have any data to actually show.
2022-03-23LibWeb: Restore `:is()` and `:where()` selector parsingSam Atkins
This was a casualty in a recent merge-conflict resolution. Oops!
2022-03-23sql: Do not indent next line when current one is blankNicholas Cellino
Previously, if a user pressed Enter without typing a command at the SQL REPL, the next line would be automatically indented. This change makes it so we check if there were any tokens in the command before applying the indentation logic.
2022-03-23Base: Add KASLR to Mitigations(7)Idan Horowitz
2022-03-23Base: Add UMIP to Mitigations(7)Idan Horowitz
2022-03-23Kernel: Use the whole kernel PD range when randomizing the KASLR offsetIdan Horowitz
Now that we reclaim the memory range that is created by KASLR before the start of the kernel image, there's no need to be conservative with the KASLR offset.
2022-03-23LibWeb: Fill the whole viewport with the correct background colorAndreas Kling
CSS2 tells us to use the HTML element's background color if not transparent. Otherwise, the BODY element's background color.
2022-03-23WebContent: Fill OOPWV with palette base color when there's no contentAndreas Kling
2022-03-23LibWeb: Resolve numeric line-heights against element's own font sizeAndreas Kling
For things like "line-height: 2" to work, the font size must be assigned before resolving the line height. Previously, the line-height was resolved first, which meant that numeric and other relative units were resolved against the default font-size instead.
2022-03-23LibWeb: Parse CSS "font-variant" as part of "font"Andreas Kling
This allows us to parse CSS "font" values that contain e.g "small-caps" or "normal", as used on Acid3.
2022-03-23LibWeb: Pass font sizes in pt rather than px to Gfx::FontDatabaseAndreas Kling
Our font database uses point sizes for fonts, and we were passing it px sizes. This caused all fonts to be 1.333x larger than they should be on the web. Of course it wasn't always noticeable with bitmap fonts, but noticeable everywhere with scalable fonts.
2022-03-23LibWeb: Implement HTMLObjectElement's data URL according to the specTimothy Flynn
There are a long list of conditions under which the HTMLObjectElement is to queue an element task to load / determine an object's representation. This handles the case where the data attribute has changed. Much of the spec for determining the object's representation is not implemented here. Namely, anything to do with XML documents or browser plugins are left as FIXMEs.
2022-03-23LibWeb: Allow HTMLObjectElement to convert a Resource to ImageResourceTimothy Flynn
HTMLObjectElement, when implemented according to the spec, does not know the resource type specified by the 'data' attribute until after it has actually loaded (i.e. it may be an image, XML document, etc.). Currently we always use ImageLoader within HTMLObjectElement to load the object, but will need to use ResourceLoader instead to generically load data. However, ImageLoader / ImageResource have image-specific functionality that HTMLObjectElement still needs if the resource turns out to be an image. This patch will allow (only) HTMLObjectElement to convert the generic Resource to an ImageResource as needed.
2022-03-23LibWeb: Make margins in the main dimension work for flex itemsJohannes Laudenberg
The spec at https://www.w3.org/TR/css-flexbox-1/ states that when calculating specific spaces and sizes inside a flex container, the outer size of a flex item needs to be taken into account. This patch adds the margins in the main dimension of a flex item to these calculations such that their margins are actually painted in a lot of common cases. It makes our Github page look marginally better.
2022-03-23LibGUI: Simplify AbstractZoomPanWidget codeJelle Raaijmakers
No functional changes, just making things a bit easier to read.
2022-03-23Applications: Round layer rect before drawing outline in PixelPaintJelle Raaijmakers
This fixes differences in drawing the layer and image outlines.
2022-03-23LibGfx: Implement `Rect::to_rounded<U>()`Jelle Raaijmakers
This replaces the usage of `rounded_int_rect`, whose name did not accurately reflect the rounding operation happening. For example, the position of the rect was not rounded but floored, and the size was pulled through `roundf` before casting to `int` which could result in inadvertent flooring if the resulting floating point could not exactly represent the rounded value.
2022-03-23LibGfx: Calculate source rect once in `do_draw_scaled_bitmap`Jelle Raaijmakers
2022-03-23LibGfx: Draw last row and column of scaled bitmaps in PainterJelle Raaijmakers
There was an off-by-one bug in `Painter::do_draw_scaled_bitmap` where the last column and row of the source bitmap would be skipped. This was especially visible in PixelPaint when zooming in and out on smaller images. Instead of the top/left of the pixel, we now use the bottom/right side of the pixel as a threshold to stop drawing.
2022-03-23LibWeb: Make NodeIterator behave like other browser enginesAndreas Kling
If invoking a NodeFilter ends up deleting a node from the DOM, it's not enough to only adjust the NodeIterator reference nodes in the pre-removing steps. We must also adjust the current traversal pointer. This is not in the spec, but it's how other engines behave, so let's do the same. I've encapsulated the Node + before-or-after-flag in a struct called NodePointer so that we can use the same pre-removing steps for both the traversal pointer and for the NodeIterator's reference node. Note that when invoking the NodeFilter, we have to remember the node we passed to the filter function, so that we can return it if accepted by the filter. This gets us another point on Acid3. :^)
2022-03-23LibWeb: Minor cleanups in NodeIterator and TreeWalkerAndreas Kling
- Use TRY() when invoking the NodeFilter - Say "nullptr" instead of "RefPtr<Node> {}"
2022-03-22LibWeb: Expose SVGEllipseElement attributes to JSSam Atkins