summaryrefslogtreecommitdiff
path: root/Libraries
AgeCommit message (Collapse)Author
2020-11-13LibGfx: Add missing stream error handling in GIF frame descriptor parseAndreas Kling
If we try to read a sentinel byte but the stream is fresh out of data, we have to take care of the stream error and bail out right away, or we'll hit an assertion when exiting the function soon after. Fixes #3486.
2020-11-13LibGfx: Refuse to decode PNG images with geometry outside i32 boundsAndreas Kling
Just fail the decode immediately when encountering an IHDR chunk with width and/or height larger than the maximum i32 value. Fixes #3818. Fixes #3819.
2020-11-13LibC: Adjust malloc size classes to ensure 8-byte aligned pointersAndreas Kling
The pointers returned by malloc should always be 8-byte aligned on x86. We were not consistent about this, as some ChunkedBlock size classes were not divisible by 8. This fixes some OOB reads found by running GCC in UE.
2020-11-13LibWeb: Add default values of URL and content type in documentLuke
As per this line in the specification: Unless stated otherwise, a document’s encoding is the utf-8 encoding, content type is "application/xml", URL is "about:blank", origin is an opaque origin, type is "xml", and its mode is "no-quirks". https://dom.spec.whatwg.org/#document
2020-11-13LibWeb: Add initial implementation of document.implementationLuke
2020-11-13LibWeb: Add contentType attribute to DocumentLuke
2020-11-12LibWeb: Make Frame point weakly to PageAndreas Kling
This patch makes Page weakable and allows page-less frames to exist. Page is single-owner, and Frame is multiple-owner, so it's not sound for Frame to assume its containing Page will stick around for its own entire lifetime. Fixes #3976.
2020-11-12LibJS: Handle symbol PropertyName in primitive assignment errorLinus Groh
We can't just to_string() the PropertyName, it might be a symbol. Instead to_value() it and then use to_string_without_side_effects() as usual. Fixes #4062.
2020-11-12LibWeb: Add almost all obsolete but required IDL attributesLuke
As according to https://html.spec.whatwg.org/multipage/obsolete.html Section 16.3 "Requirements for implementations" Not all of these attributes are included due to requiring a bit more functionality.
2020-11-12InputFileStream: Incorrectly defaulted constructorLenny Maiorani
Problem: - The default constructor is is deleted because NonnullRefPtr has no default constructor and there is a member variable of that type, but the function is set as `= default`. Solution: - Remove the code because the function is actually deleted implicitly.
2020-11-12LibJS/Tests: Use canParseSource() for toEval()Linus Groh
We can now enable the "new.target is syntax error outside of function" test :^)
2020-11-12LibJS: Run prettier on test-common.jsLinus Groh
2020-11-12LibJS: Throw TypeError when calling class constructor without 'new'Linus Groh
2020-11-12LibJS: Refactor ScriptFunction::call() a bitLinus Groh
- Get VM reference once - Less nesting - Better variable names
2020-11-11LibGUI: Set vertical distance between icons relative to scroll valueAmusedNetwork
When calculating the vertical distance between icons, we should take into account the value of the vertical scrollbar. Fixes #4040
2020-11-11LibWeb: Advertise to servers that we support gzip encodingLuke
We've had gzip support for a while now, but it never really got used because we never advertised it.
2020-11-11LibWeb: Move innerText from DOM::Element to HTML::HTMLElementLuke
2020-11-11LibWeb+LibJS: Add [LegacyNullToEmptyString] attributeLuke
If specified, to_string() returns an empty string instead of "null" for null values.
2020-11-10LibJS: Use a HashTable to identify potential cell pointers in GC scanAndreas Kling
Previously we would iterate over all the live HeapBlocks in order to learn if an arbitrary pointer-sized value was a pointer into a live HeapBlock. This was quite time-consuming. Instead of that, just put all the live HeapBlock*'s in a HashTable and identify pointers by doing a bit-masked lookup into the table.
2020-11-10LibGUI: Ignore application-global shortcuts in modal windowsAndreas Kling
This is making me question the usefulness of application-global shortcuts, but for now let's just prevent them from triggering while you're looking at a modal message box..
2020-11-10AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safeTom
This makes most operations thread safe, especially so that they can safely be used in the Kernel. This includes obtaining a strong reference from a weak reference, which now requires an explicit call to WeakPtr::strong_ref(). Another major change is that Weakable::make_weak_ref() may require the explicit target type. Previously we used reinterpret_cast in WeakPtr, assuming that it can be properly converted. But WeakPtr does not necessarily have the knowledge to be able to do this. Instead, we now ask the class itself to deliver a WeakPtr to the type that we want. Also, WeakLink is no longer specific to a target type. The reason for this is that we want to be able to safely convert e.g. WeakPtr<T> to WeakPtr<U>, and before this we just reinterpret_cast the internal WeakLink<T> to WeakLink<U>, which is a bold assumption that it would actually produce the correct code. Instead, WeakLink now operates on just a raw pointer and we only make those constructors/operators available if we can verify that it can be safely cast. In order to guarantee thread safety, we now use the least significant bit in the pointer for locking purposes. This also means that only properly aligned pointers can be used.
2020-11-10Kernel+LibC: Add adjtime(2)Nico Weber
Most systems (Linux, OpenBSD) adjust 0.5 ms per second, or 0.5 us per 1 ms tick. That is, the clock is sped up or slowed down by at most 0.05%. This means adjusting the clock by 1 s takes 2000 s, and the clock an be adjusted by at most 1.8 s per hour. FreeBSD adjusts 5 ms per second if the remaining time adjustment is >= 1 s (0.5%) , else it adjusts by 0.5 ms as well. This allows adjusting by (almost) 18 s per hour. Since Serenity OS can lose more than 22 s per hour (#3429), this picks an adjustment rate up to 1% for now. This allows us to adjust up to 36s per hour, which should be sufficient to adjust the clock fast enough to keep up with how much time the clock currently loses. Once we have a fancier NTP implementation that can adjust tick rate in addition to offset, we can think about reducing this. adjtime is a bit old-school and most current POSIX-y OSs instead implement adjtimex/ntp_adjtime, but a) we have to start somewhere b) ntp_adjtime() is a fairly gnarly API. OpenBSD's adjfreq looks like it might provide similar functionality with a nicer API. But before worrying about all this, it's probably a good idea to get to a place where the kernel APIs are (barely) good enough so that we can write an ntp service, and once we have that we should write a way to automatically evaluate how well it keeps the time adjusted, and only then should we add improvements ot the adjustment mechanism.
2020-11-10LibC: Add POSIX1 minimum limits to limits.hBrendan Coles
2020-11-10LibVT: Add TerminalWidget::scroll_to_bottom() APIAndreas Kling
(And use this internally when scrolling to bottom on non-modifier keydown events.)
2020-11-10LibGUI: Limit the height of item text in IconViewAmusedNetwork
Set the max height of the text_rect to be the height difference between two icons. Calculate the number of text lines that can be displayed in this height, and display only that many.
2020-11-10TextEditor: Go-to-line now shows line in middle of view (#4008)Jack Byrne
2020-11-09AK: Rename new_out to out and new_warn to warn.asynts
2020-11-09LibWeb: Add support for reflected boolean valuesLuke
Also throw in some missing reflected DOMString values
2020-11-08LibDebug: Use move semantics when populating abbreviations mapAndreas Kling
2020-11-08LibDebug: Avoid copying AttributeSpecifications when iterating themAndreas Kling
2020-11-08LibDebug: Shrink some of the high-volume data structuresAndreas Kling
We quickly allocate a *ton* of these when loading large executables.
2020-11-08LibGUI: Prevent multiple drag initiations while drag messages are passedAnotherTest
2020-11-08LibGUI+WindowServer: Make DragOperation hold a MimeData instanceAnotherTest
...instead of maybe bitmap + a single mime type and its corresponding data. This allows drag&drop operations to hold multiple different kinds of data, and the views/applications to choose between those. For instance, Spreadsheet can keep the structure of the dragged cells, and still provide text-only data to be passed to different unrelated editors.
2020-11-08LibIPC: Add support for passing around ByteBuffers and HashMap<K, V>AnotherTest
It should be noted that using a shared buffer should still be preferred over passing a raw ByteBuffer over the wire.
2020-11-08LibGfx: Add methods to serialise and deserialise a BitmapAnotherTest
Unlike `to_shared_buffer()` and co, these methods do *not* require extra metadata about the bitmap.
2020-11-08LibGfx: remove debug printfs from GIFLoaderPeter Nelson
2020-11-08LibGfx: gracefully handle GIFs with frame decode errorsPeter Nelson
GIFLoader now tracks the state of errors during the decoding process and will fall back to displaying the first frame of the GIF if any of the subsequent frames fail to decode.
2020-11-08LibGUI: Limit ScrollableWidget::available_size() width/height to 0Linus Groh
The current implementation is lying, it returns negative values if the inner rect has a zero width or height but also a scrollbar - which doesn't mean there's a "negative size" available though; it's still "no size available", i.e. 0.
2020-11-08LibWeb: Don't attempt to create new bitmap for zero-size OOPWVLinus Groh
It's not possible to construct a Gfx::Bitmap with empty size. Let the client know the new viewport rect and return before even attempting to create new front and back bitmaps. Also consider that we might have to paint the widget but not have a front/back bitmap available (e.g. when only part of a scrollbar is visible, and the inner rect is empty).
2020-11-08LibJS: Throw RuntimeError when reaching the end of the stackLinus Groh
This prevents stack overflows when calling infinite/deep recursive functions, e.g.: const f = () => f(); f(); JSON.stringify({}, () => ({ foo: "bar" })); new Proxy({}, { get: (_, __, p) => p.foo }).foo; The VM caches a StackInfo object to not slow down function calls considerably. VM::push_call_frame() will throw an exception if necessary (plain Error with "RuntimeError" as its .name).
2020-11-08LibJS+AK: Move cross-platform stack bounds code from JS::Heap to AK::StackInfoLinus Groh
This will be useful for other things than the Heap, maybe even outside of LibJS.
2020-11-08LibWeb: Don't assume backing store allocation succeeds on OOPWV resizeAndreas Kling
Backing store allocation can fail if the requested size is too small, or too large. We should not crash when this happens. Fixes #3986.
2020-11-08UserspaceEmulator+LibC: Have UE notice realloc() and update accountingAndreas Kling
When a mallocation is shrunk/grown without moving, UE needs to update its precise metadata about the mallocation, since it tracks *exactly* how many bytes were allocated, not just the malloc chunk size.
2020-11-08LibWeb: Use the system theme's button text color for <input> buttonsAndreas Kling
2020-11-08LibC: Add two little assertions in malloc() and malloc_size()Andreas Kling
2020-11-08LibDebug: Handle the "set ISA" standard opcodeAndreas Kling
I don't know what to do with this information, but let's at least skip over the opcode instead of asserting.
2020-11-08LibDebug: Handle AttributeDataForm::SData (DW_FORM_sdata)Andreas Kling
This is a LEB128-encoded signed constant.
2020-11-07LibCore: Run clang-format on ArgsParser.cppAndreas Kling
2020-11-07LibCore: Add an ArgsParser::add_option() overload for doublesNico Weber
2020-11-07LibWeb: Restrict HTML form submissions to permitted URL protocolsBrendan Coles
Form submissions to file:// URLs are now permitted only if the submitting document is also a file:// URL and the form method is "get". Form submissions to URLs with a http(s):// URL protocol are permitted. Form submissions for all other URL protocols are rejected.