summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-10-22LibJS: Shrink sizeof(LexicalEnvironment) by reorganizing membersAndreas Kling
2020-10-22LibWeb: Add initial implementation of foreign content parsingLuke
Plus sneak in a FIXME for the list of active formatting elements and a test for Element.namespaceURI
2020-10-22LibWeb: Add namespace to ElementLuke
2020-10-22LibWeb: Use modern namespaces and fix clang-format comments in tag namesLuke
2020-10-22LibGUI: Implement searching/jumping as you type in viewsTom
This allows the user to start typing and highlighting and jumping to a match in ColumnsView, IconView, TableView and TreeView if the model supports it.
2020-10-22LibGUI: Fix scroll_into_view flipping between left/top and right/bottomTom
This fixes flipping between left/top and right/bottom when the rectangle to make visible doesn't fit into the visible portion each time the function is called.
2020-10-22LibGfx: Add colors for highlight-searching to palette and themesTom
2020-10-22LibGfx: Reduce code duplication in Painter::draw_textTom
Use the same logic for all variants for Painter::draw_text. Also, add an overload that allows taking a callback function for custom gylph drawing. This allows drawing some glyphs differently in the correct location when drawing more complex strings (e.g. multi-line, elisions, etc).
2020-10-22AK: Enhance String::contains to allow case-insensitive searchesTom
2020-10-22AK: Make Utf8View and Utf32View more consistentTom
This enables use of these classes in templated code.
2020-10-22LibJS: Support all line terminators (LF, CR, LS, PS)Linus Groh
https://tc39.es/ecma262/#sec-line-terminators
2020-10-21LibCore+WebServer+LibWeb: Make MIME type guesser take a StringViewAndreas Kling
This reverts my previous commit in WebServer and fixes the whole issue in a much better way. Instead of having the MIME type guesser take a URL (which we don't actually have in the WebServer at that point), just take a path as a StringView. Also, make use of the case-insensitive StringView::ends_with() :^)
2020-10-21WebServer: Force "text/html" mimetype for directories with index.htmlAndreas Kling
When you GET a directory with an index.html file, we were using the mime type guessing logic from LibCore on the "/" filename, which gave us "text/plain". Force the mime type to "text/html" in these cases so browsers actually interpret it as HTML. :^)
2020-10-21IPv4: Take the socket lock more (fixes TCP connection to localhost)Andreas Kling
This fixes an issue where making a TCP connection to localhost didn't work correctly since the loopback interface is currently synchronous. (Sending something to localhost would enqueue a packet on the same interface and then immediately wake the network task to process that packet.) This was preventing the TCP handshake from working correctly with localhost since we'd send out the SYN packet before moving to the SynSent state. The lock is now held long enough for this operation to be atomic.
2020-10-21TestArray: constexpr_sum using spanLenny Maiorani
Problem: - `constexpr_sum` is implemented using `Array` which means the function needs to be a function template so that the size can be deduced. Solution: - Change the `Array` function argument to a `Span` since `Span` now is `constexpr`.
2020-10-21HashFunctions: constexpr capabilityLenny Maiorani
Problem: - Hash functions can be `constexpr`, but are not. Solution: - Change `inline` keyword to `constexpr`. - Add `static_assert` tests to ensure the hash functions work in a `constexpr` context.
2020-10-21TestHashFunctions: Tests to bind hash functionalityLenny Maiorani
Problem: - The hash functions have no associated tests, so there is nothing binding their behavior. Solution: - Bind the hash function behavior by adding tests. - Use the existing behavior as "correct".
2020-10-20LibJS: Rest parameter in setter functions is a syntax errorLinus Groh
2020-10-20LibJS: Move checks for invalid getter/setter params to parse_function_nodeLinus Groh
This allows us to provide better error messages as we can point the syntax error location to the exact first invalid parameter instead of always the end of the function within a object literal or class definition. Before this change: const Foo = { set bar() {} } ^ Uncaught exception: [SyntaxError]: Object setter property must have one argument (line: 1, column: 28) class Foo { set bar() {} } ^ Uncaught exception: [SyntaxError]: Class setter method must have one argument (line: 1, column: 26) After this change: const Foo = { set bar() {} } ^ Uncaught exception: [SyntaxError]: Setter function must have one argument (line: 1, column: 23) class Foo { set bar() {} } ^ Uncaught exception: [SyntaxError]: Setter function must have one argument (line: 1, column: 21) The only possible downside of this change is that class getters/setters and functions in objects are not distinguished in the message anymore - I don't think that's important though, and classes are (mostly) just syntactic sugar anyway.
2020-10-20LibJS: Refactor parse_function_node() bool parameters into bit flagsLinus Groh
I'm about to add even more options and a bunch of unnamed true/false arguments is really not helpful. Let's make this a single parse options parameter using bit flags.
2020-10-20Userland: Run clang-format on tree.cppAndreas Kling
2020-10-20WindowServer: Return some event members by const referenceAndreas Kling
2020-10-20LibC: Fix a warning when building LibC with -O2Andreas Kling
2020-10-20ICMP: Check that incoming ICMP echo requests are large enoughAndreas Kling
Otherwise, just ignore them.
2020-10-20LibWeb: Tear down layout trees properlyAndreas Kling
Instead of just ripping out the root of the layout tree from its RefPtr in Document, actually go through the DOM and gather up all the layout nodes. Then destroy them all in one swoop. Also, make sure to do this when detaching Document from Frame, to enforce the invariant that layout only occurs in framed documents.
2020-10-20Userland: Use new format functions in some programsAndreas Kling
2020-10-20Everywhere: Redundant inline specifier on constexpr functions (#3807)Lenny Maiorani
Problem: - `constexpr` functions are decorated with the `inline` specifier keyword. This is redundant because `constexpr` functions are implicitly `inline`. - [dcl.constexpr], ยง7.1.5/2 in the C++11 standard): "constexpr functions and constexpr constructors are implicitly inline (7.1.2)". Solution: - Remove the redundant `inline` keyword.
2020-10-20Checked: constexpr supportLenny Maiorani
Problem: - `Checked` is not `constexpr`-aware. Solution: - Decorate member functions with `constexpr` keyword. - Add tests to ensure the functionality where possible.
2020-10-20Checked: Use default compiler-generated functionsLenny Maiorani
Problem: - Compiler-generated functions are being defined which results in extra code to maintain. Solution: - Switch to compiler-generated default functions for default construction, copy assignment, move assignment, copy construction and move construction.
2020-10-20Build: Modify various parts to allow the build to succeed on FreeBSDLaurent Cimon
2020-10-20LibJS: Speed up IndexedPropertyIterator by computing non-empty indicesLinus Groh
This provides a huge speed-up for objects with large numbers as property keys in some situation. Previously we would simply iterate from 0-<max> and check if there's a non-empty value at each index - now we're being smarter and compute a list of non-empty indices upfront, by checking each value in the packed elements vector and appending the sparse elements hashmap keys (for GenericIndexedPropertyStorage). Consider this example, an object with a single own property, which is a number increasing by a factor of 10 each iteration: for (let i = 0; i < 10; ++i) { const o = {[10 ** i]: "foo"}; const start = Date.now(); Object.getOwnPropertyNames(o); // <-- IndexedPropertyIterator const end = Date.now(); console.log(`${10 ** i} -> ${(end - start) / 1000}s`); } Before this change: 1 -> 0.0000s 10 -> 0.0000s 100 -> 0.0000s 1000 -> 0.0000s 10000 -> 0.0005s 100000 -> 0.0039s 1000000 -> 0.0295s 10000000 -> 0.2489s 100000000 -> 2.4758s 1000000000 -> 25.5669s After this change: 1 -> 0.0000s 10 -> 0.0000s 100 -> 0.0000s 1000 -> 0.0000s 10000 -> 0.0000s 100000 -> 0.0000s 1000000 -> 0.0000s 10000000 -> 0.0000s 100000000 -> 0.0000s 1000000000 -> 0.0000s Fixes #3805.
2020-10-20LibX86: clang-formatAndreas Kling
2020-10-19LibX86: malloc a bit lessNico Weber
This reduces malloc()/free() calls in `disasm /bin/id` by 30% according to LIBC_DUMP_MALLOC_STATS. No measurable performance change (the number of empty block hits remains unchanged, and that's what's slow), but maybe a nice change regardless?
2020-10-19Toolchain: Set CACHED_TOOLCHAIN_ARCHIVE after computing hashLinus Groh
2020-10-19Profiler: Implement "Top functions" feature like Instruments.app hasAndreas Kling
This view mode takes every stack frame and turns it into a root in the profile graph. This allows functions that are called from many places to bubble up to the top. It's a very handy way to discover heavy things in a profile that are otherwise obscured by having many callers.
2020-10-19LibJS: Unprefixed octal numbers are a syntax error in strict modeLinus Groh
2020-10-19Toolchain: Remove cached archive and rebuild if extracting failsLinus Groh
This is currently the case on Travis CI: the file exists but fails to extract, breaking all the CI builds.
2020-10-19LibJS: Don't parse arrow function with newline between ) and =>Linus Groh
If there's a newline between the closing paren and arrow it's not a valid arrow function, ASI should kick in instead (it'll then fail with "Unexpected token Arrow")
2020-10-19LibJS: Share parameter parsing between regular and arrow functionsLinus Groh
This simplifies try_parse_arrow_function_expression() and fixes a few cases that should not produce an arrow function AST but did: (a,,) => {} (a b) => {} (a ...b) => {} (...b a) => {} The new parsing logic checks whether parens are expected and uses parse_function_parameters() if so, rolling back if a new syntax error occurs during that. Otherwise it's just an identifier in which case we parse the single parameter ourselves.
2020-10-19LibJS: Fix dump() indentation of UpdateExpression with suffix operatorLinus Groh
2020-10-19LibJS: Multiple 'default' clauses in switch statement are a syntax errorLinus Groh
2020-10-19Base: Update test-js(1) man pageLinus Groh
2020-10-19test-js: Support test262 parser testsLinus Groh
test-js now has a --test262-parser-tests option. Modules are skipped for now, current results: Test Suites: 1309 failed, 4314 passed, 5623 total Tests: 1309 failed, 262 skipped, 4052 passed, 5623 total Files: 5361 total Time: ~100ms (Lagom) / 600-800ms (Serenity) For more info, see: https://github.com/tc39/test262-parser-tests
2020-10-19test-js: Exit with 1 if any test failedLinus Groh
2020-10-19test-js: Include skipped tests in total test countLinus Groh
The current output is a bit strange: Tests: 3 skipped, 979 passed, 979 total This makes more sense to me: Tests: 3 skipped, 979 passed, 982 total
2020-10-19test-js: Add argument for explicit test root directoryLinus Groh
Right now test-js has a hardcoded test root directory when running on Serenity or will get it based on SERENITY_ROOT otherwise. Now it is also possible to pass a path to the command which will take precedence over these mechanisms. This will also be useful for adding test262 support as those files will not have a default location.
2020-10-18Documentation: Remove outdated comment about global git identityAndreas Kling
This was used by the toolchain build script at one point but is now only used when running BuildIt.sh with --dev.
2020-10-18Documentation: Remove "flock" from dependenciesAndreas Kling
The build system no longer uses "flock", so stop telling people they need to install it.
2020-10-18LibJS: Handle continue in switch statement unwindingLinus Groh
2020-10-18LibJS: Handle return value in switch statement unwindingLinus Groh
Fixes #3790.