Commit Graph

569 Commits

Author SHA1 Message Date
Sviatoslav Peleshko
183ebaee91 LibWeb: Add actual document loading for the CSS (at)import rule 2021-02-28 10:27:32 +01:00
Sviatoslav Peleshko
54617e1a91 LibWeb: Added simple parsing for (at)import rules
For now, the parsing is very crude, and parses only the document url.
The meta queries for the import are ignored.
2021-02-28 10:27:32 +01:00
Sviatoslav Peleshko
04d67d0239 LibWeb: Create base class CSSRule for all CSS rules
This is a foundation for handling other ("at") CSS rules.
2021-02-28 10:27:32 +01:00
Stephan Unverwerth
b807d51598 LibTTF: Fix glyph rasterizer coverage calculation 2021-02-28 10:01:41 +01:00
Andreas Kling
2c1f71055f LibVT: Put TerminalWidget in the VT namespace :^) 2021-02-27 17:49:08 +01:00
thankyouverycool
d8fa479d05 LibGUI: Remove ControlBoxButton widget
ComboBoxes and SpinBoxes were still relying on ascii-to-bitmap
icons instead of PNGs. This makes it easier to theme in the future.
2021-02-27 16:38:36 +01:00
Itamar
54bc9114b3 HackStudio: Support searching symbol declarations in the Locator
The Locator now keeps a cache of the declared symbol in a document.
The language client updates that cache whenever it gets an update from
the language server about declared symbols.

This allows searching for symbol declarations in the Locator, in
addition to file names.

Closes #5478
2021-02-27 16:37:35 +01:00
Itamar
a94b5376bc LanguageServers/Cpp: Update client asynchronously about symbols
As a document is parsed, the language server updates the client
asynchronously about symbol declarations it finds.
2021-02-27 16:37:35 +01:00
Itamar
71c7597130 LanguageServers/Cpp: Add type to Declarations 2021-02-27 16:37:35 +01:00
Itamar
4b483071fb LanguageServers: Add ProjectLoaction, Declaration types and use in IPC
With this we can avoid passing (name, line, column) tuples in many
different places.
2021-02-27 16:37:35 +01:00
Andreas Kling
b7c66233f6 LibVT: Make VT::Line use a Vector for storage
This is preparation for non-destructive terminal resizing which will
require more dynamic storage for lines.
2021-02-27 09:23:06 +01:00
speles
c58570ebaf LibGUI: Make empty TextRange invalid
Having TextRange which is empty doesn't make any sense. So it confuses
the functions that rely on having valid range, and causes them to do
no action.
Fixes #5341
2021-02-27 07:58:09 +01:00
Nick Vella
e241dba8d3 LibGUI: add a rudimentary framework for Wizards.
This patch provides the basic components needed for developers to create
consistent wizard interface experiences in their applications.
`WizardDialog` provides the dialog frame for the wizard, handling navigation
and presentation.
`AbstractWizardPage`s form the base class of Wizard pages, which are
pushed onto the `WizardDialog` page stack via `WizardDialog::push_page`.
`CoverWizardPage` and `WizardPage` are provided to ease the creation of
Wizard interfaces consistent with the Serenity visual language.
2021-02-27 07:31:55 +01:00
AnotherTest
610cec6e72 LibJS: Enable the BrowserExtended ECMA262 regexp flag by default
Fixes #5517.
2021-02-27 07:31:01 +01:00
AnotherTest
e0ac85288e LibRegex: Allow missing high bound in {x,y} quantifiers
Fixes #5518.
2021-02-27 07:31:01 +01:00
AnotherTest
91bf3dc7fe LibRegex: Match the escaped part of escaped syntax characters
Previously, `\^` would've matched `\`, not `^`.
2021-02-27 07:31:01 +01:00
AnotherTest
f05e518cbc LibRegex: Implement section B.1.4. of the ECMA262 spec
This allows the parser to deal with crazy patterns like the one
in #5517.
2021-02-27 07:31:01 +01:00
Luke
ce5fe2a6e8 LibGfx: Fix read buffer overflow in interlaced GIF decode
Unfortunately 10420dee7e didn't quite fix it,
as the buffer overflow was actually happening here:
af22204488/Userland/Libraries/LibGfx/GIFLoader.cpp (L402)

Found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30507
2021-02-27 07:30:39 +01:00
Itamar
85ea60b7f1 LibCpp: Don't fail when encountering #elif statements
However, we currently always treat the expression in #elif as true.
2021-02-26 21:14:41 +01:00
Linus Groh
e265054c12 Everywhere: Remove a bunch of redundant 'AK::' namespace prefixes
This is basically just for consistency, it's quite strange to see
multiple AK container types next to each other, some with and some
without the namespace prefix - we're 'using AK::Foo;' a lot and should
leverage that. :^)
2021-02-26 16:59:56 +01:00
speles
be9df404fd LibJS: Re-enable "reassignment to const" test
It passes now :^)
2021-02-26 16:59:37 +01:00
speles
f7d64e9fa8 LibJS: Set declared for-in and for-of variables as first time.
These declarations might be const, and now when we're handling it
properly, we have to set values to them correctly.
2021-02-26 16:59:37 +01:00
speles
913fd8de13 LibJS: Respect declaration kind for variables inside functions 2021-02-26 16:59:37 +01:00
Andreas Kling
79889ef052 LibELF: Consolidate main executable loading a bit
Merge the load_elf() and commit_elf() functions into a single
load_main_executable() function that takes care of both things.

Also split "stage 3" into two separate stages, keeping the lazy
relocations in stage 3, and adding a stage 4 for calling library
initialization functions.

We also make sure to map the main executable before dealing with
any of its dependencies, to ensure that non-PIE executables get
loaded at their desired address.
2021-02-26 14:49:55 +01:00
thankyouverycool
042152b346 LibGUI: Set correct open action for LinkLabel context menu
Replaces the Open... common action for files with more appropriate
Show in File Manager, as the desktop context menu uses
2021-02-26 13:50:00 +01:00
thankyouverycool
0c4fbcae76 LibGUI: Paint all widgets as toolbars in ToolBarContainer
Fixes missing shadow and highlight threeds for Bookmark bar
2021-02-25 19:23:12 +01:00
Tom
6cdb657493 LibGUI: Improve IconView rubberband performance
Rather than invalidating the entire window, which is very expensive on
the transparent desktop widget, just invalidate the areas that actually
need updating.
2021-02-25 18:04:06 +01:00
Tom
cd0a1fa5b0 LibGUI: Avoid needlessly copying vectors of rects 2021-02-25 18:04:06 +01:00
Tom
3907bacfcd LibGUI: Process pending invalidations when handling paint events
It's possible that pending invalidation rectangles haven't been
flushed when processing a paint event. Handle them right away,
which avoids another round trip.
2021-02-25 18:04:06 +01:00
Tom
35170715bc LibGUI: Constrain widgets to invalidating themselves only 2021-02-25 18:04:06 +01:00
Andreas Kling
eb08a0edd5 LibC: Make it compile on 64-bit
It won't actually work on 64-bit yet, but let's do our future selves
a favor and make it compile.
2021-02-25 16:27:12 +01:00
Andreas Kling
8714f389f9 LibC: Add x86_64 implementation of setjmp() and longjmp() 2021-02-25 16:27:12 +01:00
Andreas Kling
bb9cf083c4 LibC: Avoid double memory clearing in calloc()
calloc() was internally calling malloc_impl() which would scrub out
all the allocated memory with the scrub byte (0xdc). We would then
immediately zero-fill the memory.

This was obviously a waste of time, and our hash tables were doing
it all the time. :^)
2021-02-24 23:03:38 +01:00
Angus Gibson
0c44deeee2 LibGUI: Let cursor start a wrapped line
In line wrapping mode, the same column refers both to the end of a
visual line and the beginning of the subsequent visual line. This
meant that the cursor couldn't move to the beginning of a visual
line. Now, we only let the cursor go to the end of a physical line,
not the visual line.

Closes #4786
2021-02-24 22:30:08 +01:00
Angus Gibson
ae51dea524 LibGUI: Remove redundant cursor update 2021-02-24 22:30:08 +01:00
AnotherTest
ecc8e99a6b LibGUI: Account for the row and column headers when painting a TableView
Otherwise we'd be drawing all the rows, instead of the ones in view.
Fixes #5483.
2021-02-24 21:02:02 +01:00
Andreas Kling
7db8ccc0e4 LibC+DynamicLoader: Move "transactional memory" GCC stubs to LibC
Instead of having a special case in the dynamic loader where we ignore
TM-related GCC symbols, just stub them out in LibC like we already do
for various other things we don't support.
2021-02-24 14:54:26 +01:00
Brian Gianforcaro
069fd58381 LibELF: Convert more string literals to StringView literals.
Most of these won't have perf impact, but the optimization is
practically free, so no harm in fixing these up.
2021-02-24 14:45:34 +01:00
Brian Gianforcaro
141e6724d1 LibELF: Use StringView literal syntax to build section names. 2021-02-24 14:38:31 +01:00
AnotherTest
857cdee0d0 AK: Make dbgln_if() avoid evaluating the arguments when disabled
Naturally, this makes the `enabled` flag on dbgln() obsolete.
2021-02-24 13:07:28 +01:00
AnotherTest
71de5433f8 LibLine: Note that the search() call modifies the buffer
Fixes #5465.
2021-02-24 12:19:20 +01:00
AnotherTest
dd87b14f52 LibLine: Update the drawn cursor value when updating lazily 2021-02-24 12:19:20 +01:00
AnotherTest
21cbcdd7da LibLine: Properly update the main editor when clearing the search editor
This broke after the lazy update change :P
2021-02-24 12:19:20 +01:00
Linus Groh
7dd233b2b6 LibJS: Use const references to avoid some copies in the parser 2021-02-24 11:43:05 +01:00
Linus Groh
e640fdd395 LibJS: Let RegExpPrototype inherit from Object directly
https://tc39.es/ecma262/#sec-properties-of-the-regexp-prototype-object

The RegExp prototype object:
- is an ordinary object.
- is not a RegExp instance and does not have a [[RegExpMatcher]]
  internal slot or any of the other internal slots of RegExp instance
  objects.

In other words: no need to have RegExpPrototype inherit from
RegExpObject (we weren't even calling its initialize()).
2021-02-24 10:22:17 +01:00
Linus Groh
a72276407b LibJS: Make ArrayPrototype an Array object
https://tc39.es/ecma262/#sec-properties-of-the-array-prototype-object

The Array prototype object: [...] is an Array exotic object and has the
internal methods specified for such objects.

NOTE: The Array prototype object is specified to be an Array exotic
object to ensure compatibility with ECMAScript code that was created
prior to the ECMAScript 2015 specification.
2021-02-24 10:22:17 +01:00
Andreas Kling
679cc154e6 Everywhere: Remove unused RELEASE_ASSERT macro 2021-02-23 21:11:53 +01:00
Andreas Kling
5d180d1f99 Everywhere: Rename ASSERT => VERIFY
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)

Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.

We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
2021-02-23 20:56:54 +01:00
Andreas Kling
b33a6a443e LibELF: Inline DynamicObject::hash_section()
This was high up in profiles and gets almost entirely optimized out
when inlined, so let's do that.
2021-02-23 20:33:32 +01:00
Andreas Kling
4ed85e9b9e LibELF: Don't build barely-used section lookup table in ELF::Image
The name-to-section lookup table was only used in a handful of places,
and none of them were calling it nearly enough to justify building
a cache for it in the first place. So let's get rid of it and reduce
startup time by a little bit. :^)
2021-02-23 19:45:29 +01:00