summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2021-05-21Revert "Userland: static vs non-static constexpr variables"Linus Groh
This reverts commit 800ea8ea969835297dc7e7da345a45b9dc5e751a. Booting the system no longer worked after these changes.
2021-05-21Userland: static vs non-static constexpr variablesLenny Maiorani
Problem: - `static` variables consume memory and sometimes are less optimizable. - `static const` variables can be `constexpr`, usually. - `static` function-local variables require an initialization check every time the function is run. Solution: - If a global `static` variable is only used in a single function then move it into the function and make it non-`static` and `constexpr`. - Make all global `static` variables `constexpr` instead of `const`. - Change function-local `static const[expr]` variables to be just `constexpr`.
2021-05-21LibWeb: Fix invalid behaviour of HTMLTokenizer::skip() and restore_to()Ali Mohammad Pur
skip() is supposed to end up keeping the previous iterator only one index behind the current one, and restore_to() should actually do the restore instead of just removing the now-useless source positions. Fixes #7331.
2021-05-21LibGfx: Add missing TextAlignment::BottomLeftLinus Groh
2021-05-21LibWasm: Print instruction arguments tooAli Mohammad Pur
2021-05-21LibWasm: Fix nested structured instruction parsingAli Mohammad Pur
Previously, the ip would not be propagated correctly, and we would produce invalid jumps when more than one level of nesting was involved. This makes loops work :P
2021-05-21LibWasm: Resolve labels starting from the top of the stackAli Mohammad Pur
Otherwise "label index 0" would be the first ever created label, not the last one (as the spec wants) :^(
2021-05-21LibWasm: Implement a very basic linkerAli Mohammad Pur
This will simply "link" any given module instances and produce a list of external values that can be used to instantiate a module. Note that this is extremely basic and cannot resolve circular dependencies, and depends on the instance order.
2021-05-21LibWasm: Make the instantiation process produce an OwnPtrAli Mohammad Pur
Managing the instantiated modules becomes a pain if they're on the stack, since an instantiated module will eventually reference itself. To make using this simpler, just avoid copying the instance.
2021-05-21LibWasm: Decouple ModuleInstance from the AbstractMachineAli Mohammad Pur
This fixes a FIXME and will allow linking only select modules together, instead of linking every instantiated module into a big mess of exported entities :P
2021-05-21LibWasm: Trap instead of VERIFY()'ingAli Mohammad Pur
...unless something really is an assertion.
2021-05-21LibWasm+Meta: Add test-wasm and optionally test the conformance testsAli Mohammad Pur
This only tests "can it be parsed", but the goal of this commit is to provide a test framework that can be built upon :) The conformance tests are downloaded, compiled* and installed only if the INCLUDE_WASM_SPEC_TESTS cmake option is enabled. (*) Since we do not yet have a wast parser, the compilation is delegated to an external tool from binaryen, `wasm-as`, which is required for the test suite download/install to succeed. This *does* run the tests in CI, but it currently does not include the spec conformance tests.
2021-05-20LibCore: Let IODevice::can_read_line() buffer until \n or EOFr-paiva
If a line was larger than 1024 bytes or the file ended without a newline character, can_read_line would return false. IODevice::can_read_line() now reads until a newline is found or EOF is reached. fixes #5907
2021-05-20LibGL: Implement glHint()Stephan Unverwerth
2021-05-20Clipboard+LibGUI: Remove unnecessary client/server greeting messageAndreas Kling
2021-05-20WindowServer+LibGUI: Make client/server greeting fasterAndreas Kling
Instead of doing a full IPC round-trip for the client and server to greet each other upon connecting, the server now automatically sends a "fast_greet" message when a client connects. The client simply waits for that message to arrive before proceeding. (Waiting is necessary since LibGUI relies on the palette information included in the greeting.)
2021-05-20LibGfx: Remove unused current_system_theme() functionAndreas Kling
2021-05-20LibWeb: Deal with Boxes that have a background, border and -radiusTobias Christiansen
This hack allows for Boxes that have a background to be painted and a border to accurately paint their border-radii if needed. For that the box in with the background is drawn is extended to the bordered_rect. The border is later drawn over this regardless. Previously when drawing a Box that had all three, background, border and a border-radius, there could be some white between the filling and the border.
2021-05-20LibWeb: Take border-radius into account when painting bordersTobias Christiansen
This applies to thicker borders. When drawing them we now don't chamfer the corner if there is a border-radius present.
2021-05-20LibWeb: Introduce struct to hold border radii and normalize onceTobias Christiansen
The struct BorderRadiusData contains the four radii of the box. In case the specified borders are too large for the dimensions of the box, they get scaled down.
2021-05-20LibWeb: Draw rounded corners for the backgrounds of BoxesTobias Christiansen
Even if the Box doesn't have a border-radius, we'll pass the rendering of the Box and its corners to the Painter.
2021-05-20LibWeb: Basic rendering of border-radiusTobias Christiansen
It supports all four corners.
2021-05-20LibGfx: Add Painter::draw_circle_arc_intersecting()Tobias Christiansen
This adds a function to draw a circle specified by a center point ( relative to the given Rect) and a radius. The circle arc is only drawn inside the specified Rect as to allow for circle arc segments. Technically this was already possible using draw_elliptical_arc(), but the algorithm is quite involved and lead to wonky arcs when trying to draw circle arc segments.
2021-05-20LibGfx: Add Painter::fill_rect_with_rounded_corners()Tobias Christiansen
This paints a rectangle with rounded corners each specified by a radius.
2021-05-20LibWeb: Resolve shorthand for border-radiusTobias Christiansen
This takes care of the 1, 2, 3 and 4 parameter shorthand of the border- radius identifier. There are more as well as the ominous '/' character but that is for another time. The 2 and 3 parameter versions are weird enough already. I don't think anybody uses anything other than the 1 or 4 parameter version or even the elliptical stuff.
2021-05-20LibWeb: Make border-radius attibutes accessibleTobias Christiansen
2021-05-20LibWeb: Add border-radius to the CSS-parserTobias Christiansen
And resolve the shorthands.
2021-05-20LibWeb: Handle background-painting of Box in seperate functionTobias Christiansen
2021-05-20LibWeb: Move the painting of the border out of paint()Tobias Christiansen
So other Boxes can override this function.
2021-05-20LibWeb: Add a super basic HTML syntax highlighterAli Mohammad Pur
This can currently highlight tag names and attribute names/values.
2021-05-20LibWeb: Add position tracking information to HTML tokensAli Mohammad Pur
2021-05-20LibWeb: Sort CMakeLists SOURCES entriesAli Mohammad Pur
2021-05-20LibGUI: Don't mark "open" FilePicker as done if the file is not foundAndreas Kling
If you type in a filename that doesn't exist, show an error message instead of closing the FilePicker "successfully."
2021-05-20LibGUI: Make GUI::FilePicker handle absolute paths betterAndreas Kling
Some people apparently like to type in full absolute paths into the filename box of GUI::FilePicker. So let's handle that as you'd expect by using the full path as the selected path.
2021-05-20LibGUI: Tweak API for getting the selected pathAndreas Kling
Return a String instead of a LexicalPath. Also call it a path instead of a file since that's what we're really returning.
2021-05-20LibGfx: Remove Gfx::FontDatabase::default_bold_fixed_width_font()Andreas Kling
Ask for a bold_variant() of the default_fixed_width_font() instead.
2021-05-20LibGfx: Remove Gfx::FontDatabase::default_bold_font()Andreas Kling
Instead use default_font().bold_variant() in cases where we want a bold variant of the default font. :^)
2021-05-20Meta: Make generate_state_machine() generate a proper targetAli Mohammad Pur
And use GENERATED_SOURCES (or add_dependencies) to make LibVT depend on that target. Fixes a FIXME.
2021-05-20LibChess: Fixed PGN export bug (#7300)Josh Perry
In cases with ambiguous captures involving pawns (where multiple pieces could have made the capture), we were exporting invalid syntax for the move: `1. e4 e5 2. Bb5 c6 3. Bxc6 ddxc6` Move 3 should be `Bxc6 dxc6`, but we were duplicating the d on the pawn move.
2021-05-19LibMarkdown: Wrap code block language string in escape_html_entities()Linus Groh
This would allow HTML injection as the string was inserted into the HTML output with no sanitation whatsoever. Fixes #7123.
2021-05-19LibWeb: Use -libweb-palette-base-text for text color in default CSSLinus Groh
This makes un-styled text readable when using a dark system theme, previously such text would be black, regardless of the theme background color. Fixes #7274.
2021-05-20LibGUI: Don't invalidate FileSystemModel indices on thumbnail updateAndreas Kling
Finishing a thumbnail generation doesn't affect indices at all.
2021-05-20LibGUI: Add widget registration for GUI::IconViewAndreas Kling
2021-05-19LibHTTP: Relax the assertion on extra reads after transfer is finishedAli Mohammad Pur
This was added in #4831, but it didn't account for extra newlines after the response (seems like some servers like to do this).
2021-05-19LibCpp: Add regression tests for the parserItamar
For each .cpp file in the test suite data, there is a .ast file that represents the "known good" baseline of the parser result. Each .cpp file goes through the parser, and the result of invoking `ASTNode::dump()` on the root node is compared to the baseline to find regressions. We also check that there were no parser errors when parsing the .cpp files.
2021-05-19LibCpp: Fix "NumricLiteral" => "NumericLiteral" typoItamar
2021-05-19LibCpp: Generalize ASTNode::dump() to support redirecting its outputItamar
Previously, ASTNode::dump() used outln() for output, which meant it always wrote its output to stdout. After this commit, ASTNode::dump() receives an 'output' argument (which is stdout by default). This enables writing the output to somewhere else. This will be useful for testing the LibCpp Parser with the output of ASTNode::dump.
2021-05-19LibCpp: Fix match_expression()Itamar
match_expression() will now return true if there's a match for a Name node.
2021-05-19LibCpp: Support 'auto' TypeItamar
2021-05-19LibGL: Implement all of glVertex{2,3,4}{d,dv,f,fv,i,iv,s,sv}Stephan Unverwerth