summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-08-14Kernel+LibC: Share definitions in fcntl.h and sys/types.hAndreas Kling
This patch begins the work of sharing types and macros between Kernel and LibC instead of duplicating them via the kludge in UnixTypes.h. The basic idea is that the Kernel vends various POSIX headers via Kernel/API/POSIX/ and LibC simply #include's them to get the macros.
2021-08-14Mandelbrot: Add a View menu with zoom actionsNico Weber
2021-08-14Mandelbrot: Extract reset() methodNico Weber
2021-08-14Mandelbrot: Extract zoom() methodNico Weber
2021-08-14LibC: Don't flatten `malloc` and `free`Daniel Bertalan
This is no longer needed as per the previous commit, UserspaceEmulator's malloc tracer now correctly handles functions called from within `malloc` and `free`. This might also have a benefit on performance because forcibly inlining all function calls pessimizes cache locality.
2021-08-14UserspaceEmulator+LibC: Use sys$emuctl() to disable auditing in mallocDaniel Bertalan
It was fragile to use the address of the body of the memory management functions to disable memory auditing within them. Functions called from these did not get exempted from the audits, so in some cases UserspaceEmulator reported bogus heap buffer overflows. Memory auditing did not work at all on Clang because when querying the addresses, their offset was taken relative to the base of `.text` which is not the first segment in the `R/RX/RW(RELRO)/RW(non-RELRO)` layout produced by LLD. Similarly to when setting metadata about the allocations, we now use the `emuctl` system call to selectively suppress auditing when we reach these functions. This ensures that functions called from `malloc` are affected too, and no issues occur because of the inconsistency between Clang and GCC memory layouts.
2021-08-14Tests: Re-enable UserspaceEmulator tests on the Clang buildDaniel Bertalan
Now that problems that made UE crash have been fixed, this test should now pass.
2021-08-14UserspaceEmulator: Make call rm32 work with address on the stackDaniel Bertalan
Previously, we pushed the old `eip` on the stack before reading the new address, which made us jump to the wrong place if the destination was relative to the `esp`.
2021-08-14UserspaceEmulator: Prefix MmapRegions' name with '(UE)'Daniel Bertalan
When printing a backtrace, each library's base address is found by walking through all memory regions in the coredump, and selecting the address of the first region whose name begins with the library's soname. This is done to support the Clang toolchain, where .text is not at offset 0. However, because the libraries loaded by the emulated process used the same names, we could not distinguish those with the ones used by UserspaceEmulator, so the backtrace ended up being garbage. Using the libraries mapped by UE would not be a sufficient, as the running application could ask for other libraries too, and doing away with setting names would make debugging issues within UE code more difficult.
2021-08-14Kernel/PCI: Assign a PCI address in the SysFS PCI device directoriesLiav A
This is a bug that went unnoticed for a long time, so the exposed values in SysFS PCI device directories were incorrect because the assigned PCI address was simply the host bridge always. Also, the bus typing should really be two hexadecimal digits and not 4 digits.
2021-08-14DisplaySettings: Pass the parent window to the FilePickerKarol Kosek
Prior this change, closing the Display Settings application didn't close the File Picker.
2021-08-14DisplaySettings: Remove the trailing dot from tooltip and window titleKarol Kosek
2021-08-14DisplaySettings: Open the wallpaper file picker in the wallpaper pathKarol Kosek
This small change can indirectly tell you where wallpapers are saved.
2021-08-14Kernel: Stop allowing implicit conversion from KResult to intAndreas Kling
This patch removes KResult::operator int() and deals with the fallout. This forces a lot of code to be more explicit in its handling of errors, greatly improving readability.
2021-08-14Kernel: Make FileSystem::initialize() return KResultAndreas Kling
This forced me to also come up with error codes for a bunch of situations where we'd previously just panic the kernel.
2021-08-14LibWeb: Treat multi-value CSS properties as StyleValueList by defaultSam Atkins
Some properties, such as `margin`, take multiple values but are not complicated enough to require special-case handling. These no longer parsed after my previous StyleValue changes, so this fixes that. In the future we may want to configure whether to allow this for each property.
2021-08-14Kernel: Make Inode::lookup() return a KResultOr<NonnullRefPtr<Inode>>Andreas Kling
This allows file systems to return arbitrary error codes instead of just an Inode or not an Inode.
2021-08-14Taskbar: Add keyboard shortcuts to the fixed items in the start menuAndreas Kling
2021-08-14Base: Add the serenity-application HackStudio templatesin-ack
This is a template which instantiates into what you'd write to start out a basic Serenity GUI application. It contains a CMakeLists.txt file which describes what each declaration does, a simple GUI application which uses layouts, widgets and callbacks, and comes with a minimal set of pledges which the user can add to as necessary.
2021-08-14LibGL: Implement glDrawElementsStephan Unverwerth
2021-08-14LibGL: Implement glDrawArraysStephan Unverwerth
2021-08-14LibGL: Implement glTexCoord4fvStephan Unverwerth
2021-08-14LibGL: Implement glTexCoordPointerStephan Unverwerth
2021-08-14LibGL: Implement glColorPointerStephan Unverwerth
2021-08-14LibGL: Implement glVertexPointerStephan Unverwerth
2021-08-14LibGL: Implement glEnableClientState and glDisableClientStateStephan Unverwerth
2021-08-14LibGL: Implement glDepthMaskStephan Unverwerth
2021-08-14LibGL: Add missing defines needed for glquakeStephan Unverwerth
2021-08-14PixelPaint: Disable context menu for GuideTool when no guide is foundMarcus Nilsson
Previously the context menu would popup even when closest_guide() returned nullptr, making the Delete action do nothing.
2021-08-14PixelPaint: Show Guides on GuideTool activationMarcus Nilsson
This adds on_tool_activation() to Tool which GuideTool can use to show guides, if they're hidden, when it's activated. Also show guides on mousedown since there's no use in drawing invisible guides.
2021-08-14PixelPaint: Revert update rect tightening for SelectionMarcus Nilsson
Tightening of the update rect when firing the marching ants timer unfortunately meant that only finalized selections would be redrawn, and any new selection drawn outside of the update rect would not update.
2021-08-14LibWeb: Remove ValueListStyleValue :^)Sam Atkins
This was the whole point of this PR. No more dealing with ComponentValues in StyleResolver!
2021-08-14LibWeb: Parse multiple font-family valuesSam Atkins
Apart from now gathering comma-separated font-family names into a StyleValueList, this also corrects the logic for parsing a single font-family. Previously, we did not handle unquoted font names at all, and now they are handled including when they are several words separated by whitespace. Modified the logic for `font` to use `parse_font_family_value()`. `FontStyleValue.font_families()` is now a StyleValueList instead of a vector, so that it can be better handled in StyleResolver. We also finally remove the CSS::ParsingContext in set_property_expanding_shorthands(). :^)
2021-08-14LibWeb: Handle StyleValueList for background-imageSam Atkins
Also removed the string-parsing code I'd accidentally missed removing before. Oops!
2021-08-14LibWeb: Implement and use BackgroundRepeatStyleValueSam Atkins
This wraps an x and y background-repeat value. Potentially, we could use this in place of the background-repeat-x and background-repeat-y pseudo-properties, but for now StyleResolver splits it into those properties, like it did before.
2021-08-14LibWeb: Implement and use OverflowStyleValueSam Atkins
Also added a test page for the `overflow` properties. They apparently don't work, but at least they do parse.
2021-08-14LibWeb: Implement and use BorderRadiusStyleValueSam Atkins
This parses the elliptical border-radius values, though currently we only support circular ones. So, to_length() is overloaded to return the horizontal-radius. This means the code in Layout/Node.cpp does not need to change for now.
2021-08-14Base: Correct flipped values in border-radius.htmlSam Atkins
Box 9 and Box 10 were in the wrong order somehow, so now they are not. :^)
2021-08-14LibWeb: Implement and use BorderStyleValueSam Atkins
2021-08-14LibWeb: Implement and use FlexFlowStyleValueSam Atkins
2021-08-14LibWeb: Correct initial values for flex CSS propertiesSam Atkins
`flex-basis` and `flex-shrink` had different default values than are dictated in the spec.
2021-08-14LibWeb: Implement and use FlexStyleValueSam Atkins
This is not just moving the code from StyleResolver to Parser. The logic has changed to allow for the `flex-basis` to come before or after the `flex-grow/shrink` values, as well as handle the special one-value cases. Also added test cases to flex.html to check the parsing. It does parse correctly, but elements with `flex-basis: auto` do not calculate their width correctly.
2021-08-14LibWeb: Implement and use TextDecorationStyleValueSam Atkins
Modified text-decoration.html to better test that the values can be in any order, and that it adopts the color from the `color` property if no decoration color is specified. Right now, it always does because we do not support a different decoration color. Later, we need to support the `currentcolor` special CSS value for this purpose.
2021-08-14LibWeb: Implement and use ListStyleStyleValueSam Atkins
Yes, the name is silly, but it's a StyleValue for list-style, so... yeah. :^) Since `list-style-type` and `list-style-image` can both have `none` as a value, and can appear in any order, we have to handle it separately, and then assign either or both of those to `none` depending on how many `none`s there are, and whether those sub-properties already have values. Added some extra test cases to lists.html to cover list-style-image and list-style-position parts of the list-style shorthand, and the `none` values.
2021-08-14LibWeb: Implement and use BackgroundStyleValueSam Atkins
This one represents one secton of a `background` property, since it can have multiple background values separated by commas. Eventually, we will represent that as a List of BackgroundStyleValues. Also modified some background-foo properties in StyleResolver so that the is_background_x() functions could be removed. I realized that our handling of var() in shorthand properties is wrong, so have been removing the is_builtin_or_dynamic() calls from the parsing code for shorthands. This broke our var() test page, so I have replaced the use of 'background' with 'background-color' there.
2021-08-14LibWeb: Implement and use FontStyleValueSam Atkins
After working with the code for a while, it makes more sense to put all the parsing in Parser, instead of some of it living in StyleResolver. That means our current ValueListStyleValue needs to be replaced with specific StyleValue types for the properties that are shorthands or otherwise combine several values together. Here we implement FontStyleProperty, which represents a `font` CSS property. Also adjusted the fonts.html test page so that font-weights are featured in test cases without things we do not yet support.
2021-08-14LibWeb: Use new StyleValueList for simple propertiesSam Atkins
Also, moved the repeated code for assigning 1-4 values to top/right/bottom/left properties, into an assign_edge_values() lambda, for convenience.
2021-08-14LibWeb: Implement new StyleValueListSam Atkins
StyleValueList is a list of StyleValues of the same type, for use in properties like `margin` which accept a variable number of arguments. I had originally hoped to simply swap the old ValueListStyleValue from being a list of ComponentValues to one of StyleValues, but I can see now that I will need to have both for a little while, so renamed the old is_value_list() to is_component_value_list() temporarily.
2021-08-14LibWeb: Add StyleValue.is_builtin() convenience functionSam Atkins
2021-08-14LibWeb: Make 'auto' be both a Length and Identifier in CSSSam Atkins
I had accidentally parsed it in `parse_builtin_or_dynamic_value()` instead of `parse_length()` before, which was confusing, so now it's parsed along with other Lengths. Whether it should be a Length is up for debate, and has been tripping me up a few times, but a lot of code expects it to be one. For now, an 'auto' Length value (or any other value which overloads `is_auto()`) also claims to be a `ValueID::Auto` identifier.