summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2022-03-01LibWeb: Fix incorrect check in BrowsingContext::is_top_levelLuke Wilde
A top level browsing context is a browsing context with no parent browsing context. However, we considered a top level browsing context to be a browsing context with no associated browsing context container.
2022-03-01LibWeb: Always include floats when computing height:auto for blocksAndreas Kling
I'm not sure why we had two modes for this, but floats should always be included in the auto height AFAICT.
2022-03-01LibWeb: Fix wrong height:auto computation for block with floating childAndreas Kling
If an element with height:auto has any floating descendants whose bottom margin edge is below the element's bottom content edge, then the height is increased to include those edges. Before this patch, we were stopping at the bottom *content* edge of floating descendants.
2022-03-01LibWeb: Add origin property to window objectAlex M
2022-02-28LibC: Define offsetof in stddef.h instead of sys/cdefs.hAndrew Kaster
Just like Dr. POSIX ordered. Move the macro where it belongs, but make sure it's visible to Userland files compiled with -DKERNEL. Parts of LibEDID that are compiled into the Kernel use offsetof to parse the EDID information given to us by hardware.
2022-02-28LibC: Don't export ALWAYS_INLINE from sys/cdefs.hAndrew Kaster
POSIX doesn't tell us to export a macro like this, and it's largely going to never be defined when compiling a serenity-native C++ file, since AK defines it already. This does raise a strange issue where some futex-related helpers in serenity.h are declared with ALWAYS_INLINE. Whether these helpers belong in a C-visible header as file-static methods is questionable, but let's work around the issue but adding some preprocessor magic to make sure these declarations get the behavior they used to have without leaking macros.
2022-02-28LibJS: Spin the event loop until await has completeddavidot
Before this the event loop was spun until the state of the promise was not pending, however it is possible that a promise has already been fulfilled/rejected when awaiting it. This could then lead to a crash below as it would not pump the event loop in such cases. Although this change is in LibJS, it really only impacts any usage of LibJS within a EventLoop environment such as LibWeb. Instead of checking the state of the promise we know check that success has a value which can only happen if either the fulfilled or rejected closure set up by await are called.
2022-02-28LibWeb: Also apply default button styles to <button>, not just <input>Linus Groh
2022-02-28LibC: Add a wrapper for the getrusage syscallLucas CHOLLET
2022-02-28LibWeb: Add support for 'view-box' attribute to SVGsTobias Christiansen
This patch begins the support for the 'view-box' attribute that can be attached to <svg>'s. The FormattingContext determines the size of the Element according to the specified 'width' and 'height' or if they are not given by the 'viewbox' or by the bounding box of the path if nothing is specified. When we try to paint a SVG Path that belongs to a <svg> that has the 'view-box' and a specified 'height'/'width', all the parts of the path get scaled/moved accordingly. There probably are many edge cases and bugs still to be found, but this is a nice start. :^)
2022-02-28LibWeb: Make SVGSVGElement's view_box() constTobias Christiansen
2022-02-28LibWeb: Allow <input type="button/submit/reset"> to be styledVrins
Previously we used a native ui button to draw the buttons. These buttons can however not be styled with css. To allow these to be styled with css, we create a button with the UA stylesheet that resembles the system ui button.
2022-02-28LibWeb: Remove unused variable in required_box_type_transformation()Andreas Kling
2022-02-28LibWeb: Store box's containing line box fragment in FormattingStateAndreas Kling
Layout should not change any properties of a box until the moment a FormattingState is committed.
2022-02-28LibWeb: Use copy-on-write to make cloning a FormattingState much cheaperAndreas Kling
Instead of making a full copy of every NodeState when cloning a FormattingState, we make NodeState ref-counted and implement a basic copy-on-write mechanism. FormattingState::get_mutable() now makes a deep copy of the NodeState when first accessed *if* it is shared with other FormattingStates.
2022-02-28LibWeb: Don't crash on content with SVG elements outside of <svg>Andreas Kling
We'll have to do something more proper to support this scenario eventually, but for now let's at least not crash just because somebody put an SVG <path> inside an HTML element.
2022-02-28LibWeb: Move some of PaintContext out of lineAndreas Kling
2022-02-28LibWeb: Don't blockify or inlinify boxes with already-correct typeAndreas Kling
If something is already a block on the outside, we don't want to overwrite its inside display type.
2022-02-28LibWeb: Blockify children of parents with display:grid or display:flexAndreas Kling
2022-02-28LibWeb: Split CSS box type transformations into a helper functionAndreas Kling
Let's have one function that determines the type of transformation needed, and another to actually perform the transformation. This makes it much easier to read, and we don't have to duplicate the logic for doing the transformation.
2022-02-28LibWeb: Improve Layout::Box has-definite-size? computationAndreas Kling
We now consider a layout box as having definite size in these cases: - The size is a <length>. - The size is a <percentage> and the containing block has definite size. This is not complete, but a bit more accurate than what we had before.
2022-02-28LibWeb: Store bottom edge location with each LineBoxAndreas Kling
Previously we were computing the bottom edge of a line box by finding the bottommost fragment on the line. That method didn't give correct results for line boxes with no fragments (which is exactly what you get when inserting a bunch of <br> elements.) To cover all situations, we now keep track of the bottommost edge in the LineBox object itself.
2022-02-28LibWeb: For height:auto blocks, measure from top of *top* line boxAndreas Kling
We were incorrectly checking for negative top edges in the *last* line box only.
2022-02-28LibWeb: Add FormattingState::clone()Andreas Kling
This makes a deep copy of a FormattingState.
2022-02-28LibWeb: Store Layout::Box overflow data in Optional instead of OwnPtrAndreas Kling
2022-02-28LibWeb: Use Vector<LineBoxFragment> instead of NonnullOwnPtrVectorAndreas Kling
This removes one step of indirection, but more importantly, makes it easy to copy these objects. :^)
2022-02-28LibWeb: Use coordinate instead of WeakPtr for box->fragment connectionAndreas Kling
Using WeakPtr to remember which LineBoxFragment owns which Box was imposing some annoying constraints on the layout code. Importantly, it was forcing us to heap-allocate fragments, which makes it much harder to clone a FormattingState. This patch replaces the WeakPtr with a coordinate system instead. Fragments are referred to by their line box index + fragment index within the line box.
2022-02-28LibWeb: Pass state to create_independent_formatting_context_if_needed()Andreas Kling
Instead of using the current m_state implicitly, make this function take a FormattingState&. This will allow us to use it for throwaway layouts.
2022-02-28TextEditor: Support multiline highlighting for trailing spaceLucas CHOLLET
The last commit fixes a bug, but also exposes the fact that trailing space highlighting isn't really supported on multiple lines. This patch correct the wrong behavior by adding an offset to adjust rectangle's position.
2022-02-28TextEditor: Fix highlighting bug in wrapping modeLucas CHOLLET
Before this patch the highlighted rectangle wasn't placed on the right spot. Now the red highlighting is correctly placed at the end of the line. This was due to a function called with a wrong argument.
2022-02-28LibDSP: Allow ProcessorRangeParameter to specify if it's a log valuekleines Filmröllchen
This doesn't affect the parameter's own behavior but is part of the parameter meta-data, just as the name. If a parameter is logarithmic, UI elements should represent it with an interface that scales logarithmically.
2022-02-28LibCore: Add rmdir system call wrapperLenny Maiorani
2022-02-28LibVT: Fix crash from integer overflow in text wrappingMacDue
Fixes #12786
2022-02-27LanguageServers/Cpp: Make find declaration of enums workItamar
2022-02-27LibCpp: Set end position for the return type node of FunctionType nodesItamar
Previously we didn't set the end position for the return type node of function FunctionType nodes. This caused a VERIFY failure crash when dumping an AST that contains such nodes.
2022-02-27Everywhere: Make JSON serialization fallibleIdan Horowitz
This allows us to eliminate a major source of infallible allocation in the Kernel, as well as lay down the groundwork for OOM fallibility in userland.
2022-02-26LibGUI: Set Editors to wrap at words when MultiLinethankyouverycool
And default to NoWrap when they are type SingleLine.
2022-02-27LibLine: Update inline search cursor after kill_line (^U) commandNícolas F. R. A. Prado
After the kill_line (^U) command was used, searching backwards in the history would still filter based on the text previous to the deletion. Update the inline search cursor like already done in other internal functions, so the text used for search is the current one.
2022-02-26LibMain: Update header includesLenny Maiorani
2022-02-26LibCrypto: Simplify and move CRC32 table to cpp fileLenny Maiorani
CRC32 table is generated at compile-time and put into a static variable in the header file. This can be moved to be a function instead of a class, be moved to the `.cpp` file` and generated as an array instead of a class which only implements `operator[]`.
2022-02-26LibAudio: Add an array conversion transitional API to Bufferkleines Filmröllchen
Of course, Buffer is going to be removed very soon, but much of the WavLoader behavior still depends on it. Therefore, this intermediary API will allow adopting the Loader infrastructure without digging too deep into the WavLoader legacy code. That's for later :^)
2022-02-26LibAudio: Allow resampling from any array-like typekleines Filmröllchen
2022-02-26LibAudio: Split Buffer.{h, cpp} into three fileskleines Filmröllchen
The Buffer files had contained both the ResampleHelper and the sample format utilities. Because the Buffer class (and its file) is going to be deleted soon, this commit separates those two things into their own files.
2022-02-26LibWeb: Validate the qualified name in createDocumentType()Andreas Kling
1% progression on ACID3. :^)
2022-02-26LibWeb: Add simple ad-hoc version of window.postMessage()Andreas Kling
This allows us to use the wpt.live copy of the ACID3 test, which is kept updated, unlike the acidtests.org version.
2022-02-26LibWeb: Reorganize window.parent so it looks a bit more like the specAndreas Kling
2022-02-26LibAudio: Add basic MP3 DecoderArne Elster
This is a basic MPEG-1 layer 3 audio decoder. It supports all sample rates and stereo modes except for freeformat.
2022-02-26LibDSP: Add IMDCTArne Elster
This implements a generic IMDCT to be used by the MP3 decoder.
2022-02-26LibAudio: Add decoding tables for MPEG-1 layer 3 audioArne Elster
All data is taken straight from ISO/IEC 11172-3. These are tables necessary for decoding MP3.
2022-02-26LibAudio: Add huffman tables for MPEG-1 layer 3 audioArne Elster
The data is taken straight from the ISO/IEC 11172-3 standard. For decoding efficiency the tables are transformed into trees at compile time using a constexpr approach. That way no runtime initialization is necessary and decoding can be faster than searching through tables.