summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2022-03-30LibGfx: Make Font::pixel_metrics() virtualAndreas Kling
This makes it easier for BitmapFont and ScaledFont to implement metrics lookup themselves.
2022-03-30LibGfx: Rename FontMetrics => FontPixelMetricsAndreas Kling
Let's make it clear in the type name that this contains pixel metrics. Also rename Font::metrics() => Font::pixel_metrics().
2022-03-30LibGfx: Make Gfx::FontMetrics include the advance of '0' instead of 'M'Andreas Kling
CSS actually wants the advance of the ASCII '0' character for its "ch" units, so let's include that instead of the arbitrarily chosen 'M'.
2022-03-30LibGfx: Remove code point parameter from Gfx::Font::MetricsAndreas Kling
Everyone was asking for the glyph width of 'M' anyway. We can just make that request implicit and simplify the API.
2022-03-30LibWeb: Add fast_is<T>() for some common DOM Node subclassesAndreas Kling
2022-03-29LibJS: Check type of ShadowRealm.prototype.importValue() 2nd argumentLinus Groh
This is a normative change in the ShadowRealm spec. See: https://github.com/tc39/proposal-shadowrealm/commit/2b45a15
2022-03-29LibJS: Fix sign in PlainYearMonth.prototype.subtract()Linus Groh
This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/6cf421b
2022-03-29LibJS: Update incorrect spec comment in ToRelativeTemporalObjectLinus Groh
This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/4cb192d
2022-03-29LibC: Implement `getdtablesize()`Jelle Raaijmakers
2022-03-30LibHTTP: Append port to Host header if it existsGeekFiftyFive
2022-03-29LibWeb: Ignore empty anonymous block children in height:auto calculationAndreas Kling
This fixes a regression on GitHub from 5da7ebb806cd3be5b126ec22bfda926c7319e4f7. Thanks to Simon for reporting it! :^)
2022-03-29LibJS: Import C++ sources from libjs-test262 :^)Linus Groh
This commit upstreams most of the C++ bits of the LibJS test262 runner at https://github.com/linusg/libjs-test262/, specifically everything but the main.cpp file serving as the actual executable. Since all of these are just regular JS objects, I opted to put them in LibJS itself, in a new Contrib/ directory like many other projects have one. Other code that can end up there in the future is the runtime for esvu, which might even share some functionality with test262's $262 object. The code has been copied verbatim, and only a small number of changes have been made: - Putting everything into the JS::Test262 namespace - Removing now redundant JS namespace prefixes - Updating includes to use absolute <LibJS/...> paths - Updating the SPDX-License-Identifier comments from MIT to BSD-2-Clause I gained permission to change the license and upstream these changes from all the major contributors to this code: Ali, Andrew, David, Idan. The removal of the code from the source repository is here: https://github.com/linusg/libjs-test262/pull/54 This is only the first step, the goal is to eventually upstream the actual libjs-test262-runner executable and supporting Python scripts into SerenityOS as well.
2022-03-29LibWeb: Ignore list-item marker boxes in height:auto calculationAndreas Kling
2022-03-29LibWeb: Make height:auto for non-BFC-root blocks more correctAndreas Kling
Unlike BFC root blocks with height:auto, when the block *isn't* a BFC root, we don't have to look for the "bottommost" block-level child and determine the width from that. Instead, we should just look at the last in-flow block-level child. This was already indicated in the spec comment next to the code, but the code itself was wrong. This makes the body element on Acid3 have the correct height. It also introduces a small regression on Acid2 that we'll have to track down.
2022-03-29LibWeb: Don't round numbers too early when painting backgroundsAndreas Kling
Preserve floating point precision and delay rounding until the last moment when figuring out where to paint background layers. This fixes an issue on Acid3 where a thin sliver of red was visible because the background X position was incorrectly rounded by 1px.
2022-03-29LibGfx: Use llroundf() in Rect<float>::to_rounded()Andreas Kling
No need to drag the values through a float-to-double conversion.
2022-03-29LibWeb: Implement attribute selector case identifierDaniel Glazman
2022-03-29LibWeb: Clarify attribute selectors when needle is emptyDaniel Glazman
2022-03-29LibC: Make prctl() a varargs functionTim Schumacher
2022-03-29LibGUI: Add search API to TextEditor with highlighted resultsItamar
This adds a search API to TextEditor. The API that is similar to "find_text" of TextDocument (which is used internally to do the search). All search results (as well as the current one) are highlighted with a "span collection", which is pretty neat :^)
2022-03-29LibGUI: Add match_case parameter to TextDocument::find_all()Itamar
2022-03-29LibGUI: Support multiple layers of TextDocument spansItamar
TextDocument::set_spans() now also takes a "span collection index" argument. TextDocument keeps a map between a span collection index and its spans. It merges the spans from all collections into a single set of spans whenever set_spans() is called. This allows us to style a document with multiple layers of spans, where as previously we only supported a single layer of spans that was set from the SyntaxHighlighter.
2022-03-29LibGUI: Add operators >,>= to TextPositionItamar
2022-03-29LibGUI: Add DoClamp option to AbstractSlider::set_value()Itamar
2022-03-29LibWeb: Streamline how inline CSS style declarations are constructedAndreas Kling
When parsing the "style" attribute on elements, we'd previously ask the CSS parser for a PropertyOwningCSSStyleDeclaration. Then we'd create a new ElementCSSInlineStyleDeclaration and transfer the properties from the first object to the second object. This patch teaches the parser to make ElementCSSInlineStyleDeclaration objects directly.
2022-03-29LibWeb: Remove unused StyleSheetList::m_generationAndreas Kling
2022-03-29LibWeb: Use rounding instead of enclosing_int_rect() when paintingAndreas Kling
By using enclosing_int_rect(), borders and backgrounds of boxes were sometimes 1 pixel off, making things slightly larger than they should be. Fix this by using to_rounded() instead of enclosing_int_rect(). There's definitely more of these type of issues lurking in the code, and we'll get to them in time.
2022-03-29LibC: Make wchar size definitions available from stdint.hTim Schumacher
POSIX describes WCHAR_MIN and WCHAR_MAX in stdint.h(0P), while wchar.h(0P) only says "as described in stdint.h". As there isn't a trivial path of "may make visible", just move it to a shared header and include it from both files.
2022-03-29LibWeb: Swallow whitespace when it causes us to break the lineAndreas Kling
This fixes an issue seen on Acid3 where the instruction text would shift around when moving from "white-space:pre-wrap" to "white-space:normal".
2022-03-29LibJS: Bring ForIn body evaluation closer to the specificationIdan Horowitz
This fixes 2 bugs in our current implementation: * Properties deleted during iteration were still being iterated * Properties with the same name in both the object and it's prototype were iterated twice
2022-03-29LibJS: Implement the EnumerateObjectProperties AOIdan Horowitz
2022-03-29LibWeb: Make floating boxes in IFC occupy horizontal margin boxAndreas Kling
Previously, we only allowed floats to take up its own border box's worth of horizontal space when laid out inside an IFC. We should instead consume the full margin box horizonally. This fixes an issue where a floated box on Acid3 had {width:20px; margin-right:-20px;} but still consumed 20px of the previously available space, despite being moved out of the way by its own negative margin.
2022-03-29LibWeb: Use LineBox::height() when determining IFC auto heightsAndreas Kling
We don't need to loop through all the fragments on the line to work out how tall it is. Just ask for the height. :^)
2022-03-29LibWeb: Ensure that TextNode::ChunkIterator emits preserved newlinesAndreas Kling
When doing max-content layout, we were not committing newlines even though we were supposed to due to white-space:pre*. This broke the WPT harness due to a VERIFY() in ChunkIterator where we were assuming the commit would always succeed. Thanks to Orphis for reporting this! :^)
2022-03-29LibWeb: Use correct top content edge when calculating auto block heightsAndreas Kling
When the spec tells us to measure from the top content edge of a block, that just means we should measure from Y=0. We don't need to go looking for a child box with a negative top offset and measure from there.
2022-03-29LibPDF: Attempt to unecrypt strings and streamsMatthew Olsson
2022-03-29LibPDF: Require Document* in Parser constructorMatthew Olsson
This makes it a bit easier to avoid calling parser->set_document, an issue which cost me ~30 minutes to find.
2022-03-29LibPDF: Keep track of the current object index/generation while ParsingMatthew Olsson
This information is required to decrypt encrypted strings/streams.
2022-03-29LibPDF: Add implementation of the Standard security handlerMatthew Olsson
Security handlers manage encryption and decription of PDF files. The standard security handler uses RC4/MD5 to perform its crypto (AES as well, but that is not yet implemented).
2022-03-29LibPDF: Get rid of PlainText/Encoded StreamObjectMatthew Olsson
This was a small optimization to allow a stream object to simply hold a reference to the bytes in a PDF document rather than duplicating them. However, as we move into features such as encryption, this optimization does more harm than good. This can be revisited in the future if necessary.
2022-03-29LibPDF: Change CommonNames' enumerator macro parameter nameMatthew Olsson
Apparently "V" is a PDF property. Let's hope "A" isn't!
2022-03-29LibPDF: Store a PDFFont in the Renderer's text stateMatthew Olsson
2022-03-29LibPDF: Add initial support for Type1 fontsMatthew Olsson
This is enough to get a char code -> code point mapping
2022-03-29LibPDF: Add support for builtin and custom EncodingsMatthew Olsson
2022-03-29LibWeb: Load and use fonts described by @font-face rules :^)Andreas Kling
When encountering a @font-face rule, StyleComputer will now fire off a resource request and download the first source URL specified. Once downloaded, we try to parse it as a TrueType font file, and if it works, it's added to a cache in StyleComputer. This effectively makes fonts per-document since every document has its own StyleComputer. This is very unoptimized and could definitely use some caching, etc. But it does work on Acid3. :^)
2022-03-29LibTextCodec: Pass code points instead of bytes on UTF-8 string processKarol Kosek
Previously we were passing raw UTF-8 bytes as code points, which caused CSS content properties to display incorrect characters. This makes bullet separators in Wikipedia templates display correctly.
2022-03-29LibWeb: Size table cells using a combination of min- and max-widthsSimon Wanner
This gets us a bit closer to the recommended algorithms in CSS 2.2 and CSS Table Module 3. A couple of table heavy websites (e.g. news.ycombinator.com, html5test.com, etc.) now look quite okay. :^)
2022-03-29LibWeb: Add HTMLTableCellElement::rowSpanSimon Wanner
2022-03-29LibWeb: Add HTMLTableCellElement::colSpanSimon Wanner
2022-03-29LibWeb: Only size `width: auto` table-cells by min-contentSimon Wanner