summaryrefslogtreecommitdiff
path: root/Libraries
AgeCommit message (Collapse)Author
2020-07-23LibWeb: Rename Element::tag_name() => local_name()Andreas Kling
To prepare for fully qualified tag names, let's call this local_name. Note that we still keep an Element::tag_name() around since that's what the JS bindings end up calling into for the Element.tagName property.
2020-07-23LibGUI: Fix build after renaming Image => ImageWidgetAndreas Kling
2020-07-23LibWeb: Add a helper for creating a fake (start tag) HTML tokenAndreas Kling
Sometimes the parsing rules say we need to insert a fake HTML token. Let's have a convenient way of doing that!
2020-07-23LibJS: Simplify Cell::initialize()Andreas Kling
Remove the Interpreter& argument and pass only GlobalObject&. We can find everything we need via the global object anyway.
2020-07-23LibGUI: Rename GUI::Image => GUI::ImageWidgetAndreas Kling
"Image" was a bit too vague, "ImageWidget" is obviously a widget of some sort.
2020-07-23LibWeb: Add tests for atob() and btoa()Nico Weber
2020-07-23LibWeb+test-web: Create test-web program, add doctype testLuke
LibWeb currently has no test suite or program. Let's change that :^) test-web is mostly a copy of test-js, but modified for LibWeb. test-web imports both LibJS/Tests/test-common.js and LibWeb/Test/test-common.js LibWeb's suite provides the ability to specify the page to load, what to do before the page is loaded, and what to do after it's loaded. This also provides a test of document.doctype and its close sibling document.compatMode. Currently, this isn't added to Lagom because of CodeGenerators.
2020-07-23TextEditor: Jump to word break when deleting and holding Ctrl modifierSasan Hezarkhani
2020-07-23LibJS: Add tests for bitwise & and ^Nico Weber
And fix some edge case conversion bugs found by the tests.
2020-07-23LibC: Remove duplicate gs touch during gettid()/getpid() fast pathBrian Gianforcaro
While profiling I noticed that gettid() was hitting gs register twice, once for the initial fetch of s_cache_tid out of TLS for the initialization check, and then again when we return the actual value. Optimize the implementation to cache the value so we avoid the double fetch during the 99% case where it's already set. With this change gettid() goes from being the 3rd most sampled function in test-js, to pretty much disappearing into ~20th place. Additionally add the same optimization to getpid().
2020-07-22LibWeb: Make btoa() and atob() correctly handle values between 128 and 255Nico Weber
btoa() takes a byte string, so it must decode the UTF-8 argument into a Vector<u8> before calling encode_base64. Likewise, in atob() decode_base64 returns a byte string, so that needs to be converted to UTF-8. With this, `btoa(String.fromCharCode(255))` is '/w==' as it should be, and `atob(btoa(String.fromCharCode(255))) == String.fromCharCode(255)` remains true.
2020-07-22AK: Make encode_base64 take a ByteBuffer and return a StringNico Weber
That makes the interface symmetric with decode_base64 and it's what all current callers want (except for one, which is buggy).
2020-07-22LibJS: Fix \x escapes of bytes with high bit setNico Weber
With this, typing `"\xff"` into Browser's console no longer makes the app crash. While here, also make the \u handler call append_codepoint() instead of calling an overload where it's not immediately clear which overload is getting called. This has no behavior change.
2020-07-22LibTextCodec: Simplify Latin1Decoder::to_utf8Nico Weber
No intended behavior change.
2020-07-22LibGUI: Remove unnecessary LibHTTP #includeAnotherTest
This closes #2848.
2020-07-22LibJS: Add FIXMEs to a few functions that need UTF-16 handlingNico Weber
2020-07-22LibJS: Implement String.prototype.charCodeAtNico Weber
It's broken for strings with characters outside 7-bit ASCII, but it's broken in the same way as several existing functions (e.g. charAt()), so that's probably ok for now.
2020-07-22LibWeb: Replaced elements had backwards application of intrinsic ratioAndreas Kling
If we know the width, but not the height, we have to *divide* with the intrinsic ratio to get the height (not multiply.) :^) This makes things like <img width=300 src=image.png> work right.
2020-07-22LibWeb: Set the intrinsic width/height of <img> instead of hacking itAndreas Kling
Images were added before replaced element layout knew about intrinsic sizes, so this was a bit backwards. We now instead transfer the known intrinsic sizes from the ImageLoader to the LayoutImage.
2020-07-22LibWeb: Parse "width" and "height" presentation attributes on <img>Andreas Kling
These are HTML lengths that map to CSS width and height respectively.
2020-07-22LibWeb: Add a dedicated function for parsing HTML length valuesAndreas Kling
Presentation attribute lengths (width, height, etc.) can always be unit-less (e.g "400") so going via the normal CSS parsing path only works when the document is in quirks mode. Add a separate parse_html_length() that always allows unit-less values.
2020-07-22LibWeb: Assert we're parsing a fragment on fragment casesLuke
The specification says that parts labelled as a "fragment case" will only occur when parsing a fragment. It says that if it occurs when not parsing a fragment, then it is a specification error. We should probably assume at this point that it's an implementation error. This fixes a few little mistakes that were caught out by this. Also moves the context element outside insertion mode reset, as other (unimplemented) parts refer to it, such as "adjusted current node". Also cleans up insertion mode reset.
2020-07-21LibC: Make sure malloc chunks are 8-byte alignedAndreas Kling
I noticed this while doing some instruction-level debugging. :^)
2020-07-21LibC: Add a cache for getpid()Andreas Kling
This works the same as gettid(). No sense in making a syscall to the kernel every time you ask for the PID since it won't change. Just like gettid(), the cache is invalidated on fork().
2020-07-21LibDebug: Put DWARF debug logging spam behind DEBUG_SPAMAndreas Kling
With this logging enabled, it takes way too long to load debug info.
2020-07-21AudioServer: Give the AudioClient a way to keep track of the main mix volumeBenoît Lormeau
2020-07-21LibC: Notify UserspaceEmulator about malloc *after* scrubbingAndreas Kling
This makes sure that the emulator marks new malloc memory as uninitialized (even after we've "initialized" it by scrubbing with the scrub byte.)
2020-07-21LibWeb: Use "namespace Web::Foo {" since C++20 allows it :^)Andreas Kling
Thanks @nico for teaching me about this!
2020-07-21LibTLS: Reschedule the timeout if we're too slowAnotherTest
Previously, we would not care if the handshake timer timed out because the server was too slow, or because we were too slow, this caused connections to fail when the system was under heavy load. This patch fixes this behaviour (and closes #2843) by checking if the timeout delay was within margin of error of the max timeout.
2020-07-21UserspaceEmulator+LibX86: Start tracking uninitialized memory :^)Andreas Kling
This patch introduces the concept of shadow bits. For every byte of memory there is a corresponding shadow byte that contains metadata about that memory. Initially, the only metadata is whether the byte has been initialized or not. That's represented by the least significant shadow bit. Shadow bits travel together with regular values throughout the entire CPU and MMU emulation. There are two main helper classes to facilitate this: ValueWithShadow and ValueAndShadowReference. ValueWithShadow<T> is basically a struct { T value; T shadow; } whereas ValueAndShadowReference<T> is struct { T& value; T& shadow; }. The latter is used as a wrapper around general-purpose registers, since they can't use the plain ValueWithShadow memory as we need to be able to address individual 8-bit and 16-bit subregisters (EAX, AX, AL, AH.) Whenever a computation is made using uninitialized inputs, the result is tainted and becomes uninitialized as well. This allows us to track this state as it propagates throughout memory and registers. This patch doesn't yet keep track of tainted flags, that will be an important upcoming improvement to this. I'm sure I've messed up some things here and there, but it seems to basically work, so we have a place to start! :^)
2020-07-21LibPThread: Make pthread_exit a noreturn functionMuhammad Zahalqa
LibPThread: mark pthread_exit a noreturn function using compiler attributes LibThread: remove a call to pthread_exit from Thread::start lambda expression as it make the return of teh lambda unreachable.
2020-07-21LibWeb: Implement quirks mode detectionLuke
This allows us to determine which mode to render the page in. Exposes "doctype" and "compatMode" on Document. Exposes "name", "publicId" and "systemId" on DocumentType.
2020-07-20LibGUI: Use ControlBoxButtons in SpinBox and ComboBoxthankyouverycool
Converts the buttons of these widgets into ControlBoxButtons.
2020-07-20LibGUI: Add ControlBoxButton to LibGUIthankyouverycool
ControlBoxButton consolidates the paint_event for buttons used in composite box widgets like ComboBox and SpinBox. Its button bitmaps are built with create_from_ascii like WindowFrame and ScrollBar controls, making theming more uniform.
2020-07-19LibGUI: Show the special home directory icon in GUI::FilePickerAndreas Kling
2020-07-19LibGUI: Show a special icon for the home directory in FileSystemModelAndreas Kling
2020-07-19LibGUI+FileManager: Add setting for showing/hiding dotfilesAndreas Kling
GUI::FileSystemModel can now be told to display (or not display) files whose name start with a dot (other than . and ..)
2020-07-19LibC: add mkfifo(3)Peter Elliott
2020-07-18LibGUI: Set parent icon, margins and disable resize for InputBoxthankyouverycool
Gives a more compact, uniform appearance to input boxes.
2020-07-18LibGUI: Paint slider knob as indented when disabledthankyouverycool
Better visual feedback when sliders won't budge.
2020-07-17WindowServer: New title bar vars for themesNullspeak
The theming system can now control title bar height, title button size, title stripe color and the title text shadow color. The implemented theme metrics system could be later extended to LibGUI to allow themes to change widget padding, border width, etc.
2020-07-16LibGUI: Turn a heap-allocated event into a stack-allocated oneAndreas Kling
2020-07-16LibCore: Turns some heap-allocated events into stack-allocated onesAndreas Kling
2020-07-16LibC: Notify UserspaceEmulator about BigAllocationBlock mallocsAndreas Kling
We were forgetting to inform UE about these, which caused it to believe subsequent calls to free() were invalid.
2020-07-16LibGfx: Set correct frame type on JPEG imagesstelar7
2020-07-16LibGUI: Add InputBox::show with required parent window argumentTom
Similar to MessageBox::show, this encourages passing in a window.
2020-07-16LibWeb: Require parent window argument for MessageBoxTom
Since the vast majority of message boxes should be modal, require the parent window to be passed in, which can be nullptr for the rare case that they don't. By it being the first argument, the default arguments also don't need to be explicitly stated in most cases, and it encourages passing in a parent window handle. Fix up several message boxes that should have been modal.
2020-07-16LibGUI: Add parent window argument to FilePicker functionsTom
Since FilePicker almost always should be modal, add the parent window as mandatory first argument.
2020-07-16LibGUI: Clear previous main widget's windowTom
2020-07-16WindowServer: Expose window parent information and more modal improvementsTom
* The parent information is necessary by the Taskbar to be able to determine a modal window's parent * Minimize and maximize modal window stacks together