summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2021-03-17LibJS: Always synthesize "arguments" object when there's a calleeAndreas Kling
Instead of counting the number of call frames on the VM stack, we now always fake the "arguments" object when the current call frame has a callee value. This fixes an issue with DOM event handlers in LibWeb not being able to access "arguments" since they were called without an outer frame.
2021-03-17LibJS: Add a basic test for arguments.calleeAndreas Kling
2021-03-17LibJS: Actually use eval() in non-string arg eval testLinus Groh
2021-03-17LibJS: eval(x) should return x without evaluation if x is not a stringAndreas Kling
2021-03-17LibJS: Rename GlobalObject::initialize() => initialize_global_object()Andreas Kling
This function was shadowing Object::initialize() which cannot be called on global objects and has a different set of parameters.
2021-03-17Everywhere: Remove pessimizing and redundant move()Andreas Kling
2021-03-17QuickShow: Animate animated images :^)Linus Groh
With a little help (read: copy & paste) from ImageWidget, QuickShow will now cycle through the frames of animated images - enjoy the cat GIFs! Future improvement: cache decoded images like LibWeb's ImageResource to waste less CPU - the same applies to LibGUI though, maybe we can put something shared in LibGfx. Closes #5837.
2021-03-17LibGUI: Animate any image in ImageWidget, not just *.gifLinus Groh
The image decoder already tells us whether the image is animated and it can provide more than one frame, let's not put this behind an artificial "file path must end with lowercase .gif" barrier.
2021-03-16LibGfx: Don't truncate macroblock indices in JPG decoder.Oleg Sikorskiy
2021-03-16LibJS: Ensure SequenceExpression has two or more expressionsLinus Groh
Just a sanity check, as we should be able to make this assumption elsewhere - this way we can catch silly mistakes early.
2021-03-16LibJS: Replace global_object.global_object() with just global_objectLinus Groh
That's just silly...
2021-03-16LibJS: Only set receiver value fallback once in Object::get()Linus Groh
2021-03-16LibCompress: Fail gracefuly on missing huffman codes in DeflateDecompressorIdan Horowitz
2021-03-16LibCompress: Check and fail for input stream errors in DeflateDecompressorIdan Horowitz
Since we were not checking for error flags set by read_bits we would just always read 0 as the bits' value, which in some edge cases could lead to an infinite loop.
2021-03-16Kernel: Add _SC_CLK_TCK to sysconf.thatdutchguy
Unbreaks the hatari port.
2021-03-16LibJS: Throw RangeError on BigInt exponentiation with negative exponentLinus Groh
https://tc39.es/ecma262/#sec-numeric-types-bigint-exponentiate
2021-03-16LibJS: Throw RangeError on BigInt division/modulo by zeroLinus Groh
https://tc39.es/ecma262/#sec-numeric-types-bigint-divide https://tc39.es/ecma262/#sec-numeric-types-bigint-remainder
2021-03-16LibCompress: Allow partial header reads in GzipDecompressorIdan Horowitz
We now read the header into a temporary header byte array that is used as the header once its filled up by the input stream, instead of just ending the stream if we are out of bytes mid header.
2021-03-16LibGfx: Fail gracefuly on invalid interlace method in PNGLoaderIdan Horowitz
This fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=29791
2021-03-16LibLine: Make the DSR response parser a bit more robustAnotherTest
At the cost of using more read() syscalls, process the DSR response character-by-character. This avoids blocking forever waiting for an 'R' that will never come :P
2021-03-16LibWeb: Invalidate element style after setting Element.style.fooAndreas Kling
This makes us recompute style for the element so the change actually takes effect. :^)
2021-03-16LibCpp: Return empty TranslationUnit from Parser::parse() if no tokens existLinus Groh
Fixes #5704. Fixes #5825. Fixes #5827.
2021-03-16LibJS: Don't apply arguments object hack to global execution contextLinus Groh
Checking for the existence of a call frame is not enough to check if we're in a function call, as the global execution context is a regular call frame as well. Found by OSS-Fuzz, where simply accessing "arguments" in the global scope would crash due to call_frame().callee being an empty value (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32115).
2021-03-16LibAudio: decrease WavLoader's size limit to a more reasonable sizeIdan Horowitz
A 4 GiB wav (current size limit) is very unreasonable, and larger than oss-fuzz's 2.5 GiB per-process memory limit.
2021-03-16LibWeb: Dispatch "resize" events on the Window objectAndreas Kling
It's a little awkward that we do this in two places, but IPWV and OOPWV currently implement resizing a little differently from each other so we need to cover both paths.
2021-03-16LibGUI: Remove has_visible_list members from TextEditorthankyouverycool
This was a kludge to paint ComboBox editors before the advent of accessory windows, isn't being used anymore, and was inadvertently letting two ComboBoxes paint as if both had focus.
2021-03-16LibWeb: Add Window.innerWidth and Window.innerHeightAndreas Kling
2021-03-16LibCompress: Handle and propagate stream errors in GzipDecompressorIdan Horowitz
This commit makes read short-circuit if its input stream errored, as well as propagate error handling to wrapped sub streams, similarly to DeflateDecompressor.
2021-03-16LibCompress+AK: Dont short-circuit error handling propagationIdan Horowitz
In the case that both the stream and the wrapped substream had errors to be handled only one of the two would be resolved due to boolean short circuiting. this commit ensures both are handled irregardless of one another.
2021-03-16LibWeb: Use Gfx::Bitmap::RGBA8888 for ImageData bitmapsAndreas Kling
This makes the colors show up correctly when using putImageData() to draw an ImageData onto a CanvasRenderingContext2D. :^)
2021-03-16LibGfx: Add BitmapFormat::RGBA8888Andreas Kling
This will be used by ImageData objects in LibWeb since the web spec says these store colors in RGBA8888 order. The only thing you can do with this format right now is blitting it onto a BGRA8888 bitmap.
2021-03-16LibGfx: Rename 32-bit bitmap StorageFormats to BGRA8888 and BGRx8888Andreas Kling
2021-03-16LibGfx: Rename 32-bit BitmapFormats to BGRA8888 and BGRx888xAndreas Kling
The previous names (RGBA32 and RGB32) were misleading since that's not the actual byte order in memory. The new names reflect exactly how the color values get laid out in bitmap data.
2021-03-16LibJS: Make an RAII helper for entering/exiting AST nodesAndreas Kling
2021-03-16LibJS: Implement non-value-producing statements properlyLinus Groh
For various statements the spec states: Return NormalCompletion(empty). In those cases we have been returning undefined so far, which is incorrect. In other cases it states: Return Completion(UpdateEmpty(stmtCompletion, undefined)). Which essentially means a statement is evaluated and its completion value returned if non-empty, and undefined otherwise. While not actually noticeable in normal scripts as the VM's "last value" can't be accessed from JS code directly (with the exception of eval(), see below), it provided an inconsistent experience in the REPL: > if (true) 42; 42 > if (true) { 42; } undefined This also fixes the case where eval() would return undefined if the last executed statement is not a value-producing one: eval("1;;;;;") eval("1;{}") eval("1;var a;") As a consequence of the changes outlined above, these now all correctly return 1. See https://tc39.es/ecma262/#sec-block-runtime-semantics-evaluation, "NOTE 2". Fixes #3609.
2021-03-16LibJS: Make Interpreter::run() a void functionLinus Groh
With one small exception, this is how we've been using this API already, and it makes sense: a Program is just a ScopeNode with any number of statements, which are executed one by one. There's no explicit return value at the end, only a completion value of the last value-producing statement, which we then access using VM::last_value() if needed (e.g. in the REPL).
2021-03-15LibGfx: Draw window frame icon scaled to title_bar_icon_rect()Linus Groh
Partially fixes #5806.
2021-03-15LibJS: Throw SyntaxError in eval() when parser has error(s)Linus Groh
2021-03-15LibM: Implement fmin/fmaxMițca Dumitru
2021-03-15LibM: Make the gamma family of functions more accurate and conformantMițca Dumitru
This patch makes tgamma use an approximation that is more accurate with regards to floating point arithmetic, and fixes some issues when tgamma was called with positive integer values. It also makes lgamma set signgam to the correct value, and makes its return value be more inline with what the C standard defines.
2021-03-15LibM: Declare rintl in math.hMițca Dumitru
2021-03-15LibJS: Make eval() return the last value from the executed statementAndreas Kling
This is kinda awkward but since the statement we're executing is actually a JS::Program, we have to get the result via VM::last_value().
2021-03-15LibCompress+AK: Propagate error handling to wrapped streamsIdan Horowitz
This ensures that when a DeflateCompressor stream is cleared of any errors its underlying wrapped streams (InputBitStream/InputMemoryStream) will be cleared as well and wont fail a VERIFY on destruction.
2021-03-15LibCompress: Make the Zlib decompressor fail gracefulyIdan Horowitz
This commit adds a verify-less try_create method to the Zlib decompressor to allow for graceful failures of parsing the Zlib headers.
2021-03-15LibWeb: Make sure <script> elements get prepared when connectedAndreas Kling
There's a bit more nuance to how this should really work, but let's at least make sure we execute <script> elements if you insert them into the document.
2021-03-15LibWeb: Add CanvasRenderingContext2D.clearRect()Andreas Kling
Similar to fillRect, except this API fills with transparent black.
2021-03-15LibWeb: Support named CSS properties on CSSStyleDeclaration wrapperAndreas Kling
Use the new CustomGet/CustomPut wrapper mechansim to intercept gets and puts on CSSStyleDeclaration objects. This allows content to get and set individual CSS properties from JavaScript. :^)
2021-03-15LibWeb: Allow JS wrappers to customize get() and put()Andreas Kling
You can now set the CustomGet and/or CustomPut extended attributes on an interface. This allows you to override JS::Object::get/put in the wrapper class.
2021-03-15LibWeb: Make <option> elements display:none in the default CSS for nowAndreas Kling
2021-03-15LibJS: Add arguments.callee to our hack arguments objectAndreas Kling
arguments.callee refers to the currently executing function.