summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-06-24LibWeb: Move the offset, margin and padding boxes into LayoutStyleAndreas Kling
2020-06-24LibWeb: Move white-space into LayoutStyleAndreas Kling
2020-06-24LibWeb: Add CSS::Display enum and StyleProperties::display()Andreas Kling
The display property is not interesting after we've built the layout tree, so we don't have to move it into LayoutStyle.
2020-06-24LibWeb: Move height, min-height and max-height into LayoutStyleAndreas Kling
2020-06-24LibWeb: Move min-width and max-width into LayoutStyleAndreas Kling
2020-06-24LibWeb: Move width into LayoutStyleAndreas Kling
This patch also adds the ability for Length to contain percentage values. This is a little off-spec, but will make storing and dealing with lengths a lot easier. To resolve a Length to a px-or-auto Length, there are now helpers for that. After calling them, you no longer have to think about em, rem, %, and such things.
2020-06-24LibWeb: Move position and text-align to LayoutStyleAndreas Kling
2020-06-24LibWeb: Add LayoutStyle, a place to store style info for layout & paintAndreas Kling
StyleProperties is really only the specified "input" to what eventually becomes the used/computed style we use for layout and painting. Unlike StyleProperties, LayoutStyle will have strongly typed values for everything it contains (i.e no CSS::ValueID or strings, etc.) This first patch moves z-index into LayoutStyle.
2020-06-24LibWeb: Rename LayoutNode::style() => specified_style()Andreas Kling
Let's make way for a slightly-more-cooked style() that will eventually replace the raw specified_style() for layout and paint purposes.
2020-06-24LibWeb: Add an "undefined" state to LengthAndreas Kling
A default-constructed Length now gives you an undefined length value, which can be used to signify the absence of a value.
2020-06-24LibWeb: Turn BoxModelMetrics into a simple structAndreas Kling
Using getters for this thing was just cumbersome and didn't achieve anything of value so just turn it into a plain struct.
2020-06-24LibWeb: Remove default Length constructor and add make_auto()/make_px()Andreas Kling
To prepare for adding an undefined/empty state for Length, let's first move away from Length() creating an auto value.
2020-06-24LibWeb: Use the cached text-align value in LineBox::add_fragment()Andreas Kling
2020-06-23LibWeb: Cache the used CSS text-align property on LayoutNodeWithStyleAndreas Kling
2020-06-23LibWeb: Always inline absolute Length to_px() conversionAndreas Kling
Only do the relative Length units out of line.
2020-06-23LibWeb: Always inline is<LayoutBox>() and is<LayoutBlock>()Andreas Kling
2020-06-23LibWeb: Cache the used CSS 'position' value on LayoutNodeWithStyleAndreas Kling
This avoids having to query the StyleProperties hash map whenever we need to know if an element is absolutely positioned. This was extremely hot in interactive window resize profiles.
2020-06-23LibWeb: Handle empty inputs to the CSS parserAndreas Kling
Empty inputs -> empty outputs.
2020-06-23LibWeb: Handle position:absolute with both left and right specifiedAndreas Kling
In this case, we need to undo the right-side offsetting, since the width computation algorithm will already have stretched the width to accomodate both the side constraints.
2020-06-23AK: Inline the basics of VectorIteratorAndreas Kling
Inlining these allows the compiler to optimize out the assertions in favor of a static range check in many cases.
2020-06-23Meta: Add Hüseyin to contributors list :^)Andreas Kling
He recently passed 100 commits in the projects!
2020-06-23LibWeb: Make sure BoxModelMetrics are set for position:absolute boxesAndreas Kling
This is all very redundant and we should find a way to share this code between at least some of the positioning modes.
2020-06-23LibWeb: Take margin into account when positioning absolute descendantsAndreas Kling
2020-06-23LibWeb: Respect specified width when computing shrink-to-fit candidatesAndreas Kling
Previously we would always just use the combined content width as the shrunken width in shrink-to-fit width calculations, but if the element has a non-auto specified width, we should just let that take over. This is far from perfect and doesn't take stuff like min/max-width into account. Will need more work, this just covers the basic case.
2020-06-23LibJS: Explicitly invoke Cell constructor in Object(Object& prototype)Andreas Kling
2020-06-23LibWeb: Update PageView content size on page relayoutAndreas Kling
If the layout changes and the page becomes taller or shorter for some reason, we need to update the PageView's scrollable content size.
2020-06-23LibJS: Make NativeProperty a plain Cell instead of an ObjectAndreas Kling
This removes the need for NativeProperty objects to have a prototype, which just made things confusing.
2020-06-23LibJS: Clarify Object (base class) construction somewhatAndreas Kling
Divide the Object constructor into three variants: - The regular one (takes an Object& prototype) - One for use by GlobalObject - One for use by objects without a prototype (e.g ObjectPrototype)
2020-06-23LibWeb: Make wrapper factory functions take JS::GlobalObject&Andreas Kling
Instead of taking the JS::Heap&. This allows us to get rid of some calls to JS::Interpreter::global_object(). We're getting closer and closer to multiple global objects. :^)
2020-06-23LibWeb: Let HTMLScriptElement call Document::run_javascript()Andreas Kling
The fewer places we invoke the JS parser the better. Unless we have some specific reason to parse manually, we can just call Document.
2020-06-23LibWeb: Remove hacky old ways of running <script> element contentsAndreas Kling
Now that we're using the new HTML parser, we don't have to do the weird "run the script when inserted into the document, uhh, or when the text content of the script element changes" dance. Instead, we just follow the spec, and scripts run the way they should.
2020-06-23LibWeb: Fix tokenization of attributes with URL query strings in themAndreas Kling
<a href="/foo&amp=bar"> was being tokenized into <a href="/foo&=bar">. The spec mentions this but I had overlooked it. The bug happens because we interpreted the "&amp" as a named character reference.
2020-06-23SystemServer: Fix typo (exist -> exit) (#2615)Ruairidh MacLeod
Small typo that I noticed on the latest OS hacking video!
2020-06-23WebContent: Unveil access to the ImageDecoder service :^)Andreas Kling
2020-06-23LibWeb: Remove Gfx::ImageDecoder from ImageLoaderAndreas Kling
We still use a Gfx::ImageDecoder for GIF images, but there's no need for the ImageLoader object to have its own pointer to it. Just grab the ImageDecoder from the ImageResource when needed.
2020-06-23LibWeb: Use ImageLoader::has_image() in HTMLObjectElementAndreas Kling
This makes ACID2 load the eyes image again. :^)
2020-06-23LibWeb: Decode CSS image values out-of-process as wellAndreas Kling
2020-06-23LibWeb: Give ImageResource::bitmap(frame_index) default frame_index = 0Andreas Kling
2020-06-23Ports: Make ninja use ppoll instead of pselectNico Weber
2020-06-23LibC+Kernel: Implement ppollNico Weber
ppoll() is similar() to poll(), but it takes its timeout as timespec instead of as int, and it takes an additional sigmask parameter. Change the sys$poll parameters to match ppoll() and implement poll() in terms of ppoll().
2020-06-23JPGLoader: Move JPGLoader internal structs and #defines to JPGLoader.cppdevashish
2020-06-23LibGfx: Integrate JPEG decoder with rest of the systemdevashish
This patch adds functions like `load_jpeg` to JPGLoader to make the JPEG decoder conform to the API that bitmap loader uses :^)
2020-06-23LibGfx+LibWeb: Add JPEG decoder and integrate with LibWebDevashish
This patch adds support for JPEG decoding. The JPEG decoder is capable of handling standard 2x1 horizontal, 2x1 vertical and quartered chroma subsampling. The implemented Inverse DCT performs with a decent speed. As of interchange formats, since we tend to ignore the metadata in APPn markers, the decoder can handle any format compatible with JFIF, which includes EXIFs and sometimes WebMs too. The decoder does not support progressive JPEGs yet.
2020-06-22LibWeb+Browser: Decode non-animated images out-of-process :^)Andreas Kling
We now use the ImageDecoder service in LibWeb for everything except GIF images (we'll have to deal with them later, ofc.) This has a little bit of overhead but we should be able to optimize it until it becomes negligible.
2020-06-22LibIPC: Silence some debug spamAndreas Kling
2020-06-22ImageDecoder: Add a new service for out-of-process image decoding :^)Andreas Kling
The new ImageDecoder service (available for members of "image" via /tmp/portal/image) allows you to decode images in a separate process. This will allow programs to confidently load untrusted images, since the bulk of the security concerns are sandboxed to a separate process. The only API right now is a synchronous IPC DecodeImage() call that takes a shbuf with encoded image data and returns a shared buffer and metadata for the decoded image. It also comes with a very simple library for interfacing with the ImageDecoder service: LibImageDecoderClient. The name is a bit of a mouthful but I guess we can rename it later if we think of something nicer to call it. There's obviously a bit of overhead to spawning a separate process for every image decode, so this is mostly only appropriate for untrusted images (e.g stuff downloaded from the web) and not necessary for trusted local images (e.g stuff in /res)
2020-06-22LibCore: Remove some debug spam in Local{Server,Socket}Andreas Kling
2020-06-22LibCore: Put safe_syscall() debug spam behind #ifdefAndreas Kling
2020-06-22SystemServer: Put some debug spam behind #ifdefsAndreas Kling
2020-06-22Kernel: Silence debug spam on execAndreas Kling