Commit Graph

4159 Commits

Author SHA1 Message Date
Nico Weber
d4d9222eea LibJS: Basic implementation of most of Date's constructor arguments
The constructor with a string argument isn't implemented yet, but
this implements the other variants.

The timestamp constructor doens't handle negative timestamps correctly.

Out-of-bound and invalid arguments aren't handled correctly.
2020-08-20 20:53:43 +02:00
Nico Weber
45827cace9 LibCore: Comment that DateTime is in local time.
The timestamp is always in UTC, but hours/minutes are in local time.
2020-08-20 20:53:43 +02:00
Andreas Kling
7903cfa5e4 LibGfx: Support loading GIF local color maps if present :^) 2020-08-20 19:42:06 +02:00
Andreas Kling
28e34ffe38 LibGfx: Initialize some uninitialized things in GIFLoader 2020-08-20 19:41:29 +02:00
Luke
65afb40fc5 LibWeb: Crash instead of spinning if parse_drawto fails to match
If parse_drawto fails to match anything, it will spin forever.
Instead, print out the character that failed to match and assert
false.
2020-08-20 16:31:13 +02:00
asynts
8bbb7e25e6 LibCompress: Turn the DEFLATE implementation into a stream.
Previously, the implementation would produce one Vector<u8> which
would contain the whole decompressed data. That can be a lot and
even exhaust memory.

With these changes it is still necessary to store the whole input data
in one piece (I am working on this next,) but the output can be read
block by block. (That's not optimal either because blocks can be
arbitrarily large, but it's good for now.)
2020-08-20 16:28:31 +02:00
Andreas Kling
413db2d6d5 LibELF: Ignore PT_GNU_STACK headers
We always map stacks R/W (never X), so we can just ignore this header
as far as I understand.
2020-08-20 10:12:45 +02:00
AnotherTest
2c5cc189c5 LibLine: Initialize the search editor when entering search
Prior to this, no keybinding were installed on the search editor, and so
editing wasn't really possible.
Also fixes <C-r> making infinite search editors.
2020-08-20 09:34:55 +02:00
Andreas Kling
6d4016dd01 LibGUI: Use StringBuilder::join() in Shortcut::to_string() 2020-08-19 21:17:02 +02:00
Tom
d4dae49dcd LibHTTP: Fix processing terminating chunk
After encountering the terminating chunk we need to read the
trailing headers line by line, until encountering the final
empty line.

Fixes #3197
2020-08-19 15:28:31 +02:00
Tom
5cd2a37079 LibGfx: Small improvement for DisjointRectSet::shatter
This avoids a call to clone() which would be discarded immediately.
Also, avoid essentially cloning for each hammer rectangle unless
there is actually a need for it.
2020-08-19 11:20:27 +02:00
Sergey Bugaev
1671e1ac92 WindowServer+LibVT: Convert some dbgprintf() to dbg()
These kept annoying me, because these were the only two lines in the default
boot log that went unattributed.
2020-08-18 17:19:52 +02:00
Nico Weber
2460980d2c LibWeb: Implement Element.innerText
Reading the property has a few warts (see FIXMEs in the included
tests), but with this the timestamps on http://45.33.8.238/
get localized :^)

Since the Date() constructor currently ignores all arguments,
they don't get localized correctly but are all set to the current
time, but hey, it's still progress from a certain point of view.
2020-08-18 16:58:46 +02:00
Nico Weber
2f85af2a20 LibWeb: Simplify Node::text_content() 2020-08-18 16:58:46 +02:00
AnotherTest
ae9211037e LibLine: Make actual_rendered_string_metrics() static
This function didn't depend on the editor itself.
2020-08-18 16:58:17 +02:00
AnotherTest
bda1d7fd7b LibLine: Setup the keybindings after initialisation
This makes the keybindings that depend on `m_termios` (^W, ^U, etc) work.
2020-08-18 13:40:44 +02:00
Tom
f8903acea2 LibGfx: Add convenience helpers for Rect 2020-08-18 12:12:27 +02:00
Tom
a43ba348e1 LibGfx: Add convenience method Point::constrained 2020-08-18 12:12:27 +02:00
Tom
790eacfbd1 LibGfx: Add a few convenience methods to DisjointRectSet 2020-08-18 12:12:27 +02:00
AnotherTest
5b9d563b4b LibLine: Allow the user to override (or add) keybinds in the config file 2020-08-18 12:07:32 +02:00
AnotherTest
32839d40e3 LibLine: Make (almost) all key actions configurable
This moves all internal functions to a new file, and defines the old
keybinds with register_key_input_callback().
2020-08-18 12:07:32 +02:00
AnotherTest
d0aab41628 LibLine: Read configuration from a config file 2020-08-18 12:07:32 +02:00
AnotherTest
afbeb8f977 LibCore: Add ConfigFile::get_for_lib() 2020-08-18 12:07:32 +02:00
Luke
c2a2552e46 LibWeb: Add more document tests, add comment, text and mixin tests
Also adds a TypeScript definition file for the test runner object.
2020-08-17 22:57:05 +02:00
Luke
8b807e65d7 LibWeb: Add Comment and DocumentFragment bindings, move querySelector...
...{All} to ParentNode. Exposes createDocumentFragment and
createComment on Document. Stubs out the document.body setter. 

Also adds ParentNode back :^).
2020-08-17 22:57:05 +02:00
Luke
7b755e6a58 LibWeb: Make HTMLPreElement's is_type match "listing" and "xmp"
I forgot to add these when I saw that listing and xmp are mapped to
HTMLPreElement.
2020-08-17 22:57:05 +02:00
Andreas Kling
f0349323c4 LibGUI: Don't require passing model to FileSystemModel::Node APIs
The Node API was obnoxiously requiring you to pass the model into it
all the time, simply because nodes could not find their way back to
the containing model. This patch adds a back-reference to the model
and simplifies the API.
2020-08-17 22:02:21 +02:00
Nico Weber
e9b56b5b9c LibWeb: Add Node.textContent
This requires moving remove_all_children() from ParentNode to
Node, which makes ParentNode.cpp empty, so remove it.

It also co-opts the existing Node::text_content() method and
tweaks it slightly to fit the semantics of Node.textContent.
2020-08-17 21:23:11 +02:00
Nico Weber
a3908732ad LibJS: Add toLocaleString(), toLocaleDateString(), toLocaleTimeString() to Date
These just return a "readable" implementation of the date for now.
2020-08-17 21:23:11 +02:00
Nico Weber
8ebef785eb LibJS: Implement basic functionality of Array.from()
The optional 2nd and 3rd arguments are not yet implemented.

This assumes that `this` is the Array constructor and doesn't yet
implement the more general behavior in the ES6 spec that allows
transferring this method to other constructors.
2020-08-17 21:23:11 +02:00
Andreas Kling
b6e18133ae LibWeb: Rename WebContentView => OutOfProcessWebView 2020-08-17 18:05:35 +02:00
Andreas Kling
56c3748dcc LibWeb: Rename PageView => InProcessWebView 2020-08-17 18:05:35 +02:00
Andreas Kling
ba856c7ebe LibDebug: Don't include <Libraries/...> 2020-08-17 18:05:35 +02:00
Andreas Kling
d62a59d7b8 LibCrypto: Don't include <Libraries/...> 2020-08-17 18:05:35 +02:00
Andreas Kling
ce48de9845 LibGUI: Add WidgetClassRegistration to Forward.h 2020-08-17 18:05:35 +02:00
Luke
c434a91c91 FileManager: Apply wallpaper on startup
I noticed that nothing actually applies the wallpaper on startup.
I wasn't sure where to put the responsibility, so I gave it to
the desktop mode file manager.

Also adds a save_config option to set_wallpaper so it doesn't
needlessly save the config.
2020-08-17 17:47:14 +02:00
AnotherTest
c96b9fdb0a LibLine: Add a getter for num_lines/num_cols 2020-08-17 17:44:02 +02:00
AnicJov
ac4897d613 LibWeb: Change cursor to IBeam when hovering text
This is what most browsers do, hopefully it isn't too silly :^)
2020-08-17 13:07:18 +02:00
Nico Weber
22f701d657 malloc: Keep some stats and dump them at process exit if LIBC_DUMP_MALLOC_STATS is set
Very bare-bones and barely useful. Can go away once the perf_event-based
malloc tracking is further along.
2020-08-17 09:43:23 +02:00
Brian Gianforcaro
6fa76ed2e3 LibCore: Fix unitialized struct member in to_address_in, found by Coverity 2020-08-17 09:17:57 +02:00
Brian Gianforcaro
9ffbe03bdb LibC: Missing varargs cleanup in ioctl 2020-08-17 09:17:57 +02:00
Brian Gianforcaro
dc278c3aa1 LibC: Missing varargs cleanup in fcntl 2020-08-17 09:17:57 +02:00
Brian Gianforcaro
c1fd41c38c LibLine: Uninitialized members in Editor, found by Coverity 2020-08-17 09:17:57 +02:00
Brian Gianforcaro
0ca00639a9 LibThread: Uninitialized member variable in Thread, found by Coverity 2020-08-17 09:17:57 +02:00
Brian Gianforcaro
832b3256d3 LibWeb: Remove unused member in LayoutNodeWithStyle, found by Coverity 2020-08-17 09:17:57 +02:00
Brian Gianforcaro
82b3dab1b5 LibELF: Fix uninitialized member variable in DynamicLoader, found by Coverity 2020-08-17 09:17:57 +02:00
Brian Gianforcaro
82dbf76dee LibCompress: Fix uninitialized member variable in Zlib, found by Coverity 2020-08-17 09:17:57 +02:00
Nico Weber
2030a49a1e malloc: Remove unused Bitmap.h include 2020-08-17 09:10:06 +02:00
Nico Weber
de4a9c61d7 malloc: Fix build with RECYCLE_BIG_ALLOCATIONS not defined 2020-08-17 09:10:06 +02:00
Nico Weber
344090a5b0 malloc: Add comments spelling out the MAGIC_HEADERS in ascii 2020-08-17 09:10:06 +02:00