Andreas Kling
1dd71bd68f
LibJS: Put some more Heap debug logging behind HEAP_DEBUG
2020-03-23 13:45:01 +01:00
Andreas Kling
e31dac3ba4
Lagom: Build LibJS + "js" test program
...
You can now get a full Linux build of the "js" test program by simply
building in Meta/Lagom :^)
2020-03-23 13:15:32 +01:00
Andreas Kling
79e065f0a2
LibJS: Port garbage collector to Linux
...
Well that was easy. LibJS can now run on Linux :^)
2020-03-23 13:14:57 +01:00
Andreas Kling
538537dfd0
LibJS: Use rand() for Math.random() on other systems
...
I bet we could be smarter here and use arc4random() on systems where
it is present. I'm not sure how to detect it though.
2020-03-23 13:14:04 +01:00
Andreas Kling
290ea11739
LibCore: Tweak DateTime.cpp so it compiles on Linux + drive-by bug fix
2020-03-23 13:13:36 +01:00
Shannon Booth
c47ef61ed8
Toolchain/Ports: Update gcc to 9.3.0
...
Ever closer to C++20! Also fix up some of those pesky "'s
2020-03-23 08:22:41 +01:00
Nick Tiberi
ca067e71a3
Taskbar: Remove FIXME re: tooltip rendering since it's now working ( #1502 )
2020-03-23 08:21:34 +01:00
Andreas Kling
6f235ad93f
LibWeb: Implement cancelAnimationFrame()
...
These functions (rAF and cAF) should eventually stop using raw ID's
from GUI::DisplayLink as their identifiers. That's a FIXME for now. :^)
2020-03-22 21:20:40 +01:00
Andreas Kling
39045bfde8
LibWeb: Add basic support for requestAnimationFrame()
...
We now support rAF, driven by GUI::DisplayLink callbacks. It's a bit
strange how we keep registering new callbacks over and over.
That's something we can definitely optimize.
This allows you to update animations/whatever without doing it more
often than the browser can display.
2020-03-22 21:18:03 +01:00
Andreas Kling
424a3f5ac3
WindowServer+LibGUI: Add a way to get notified at display refresh rate
...
This patch adds GUI::DisplayLink, a mechanism for registering callbacks
that will fire at the display refresh rate.
Note that we don't actually know the screen refresh rate, but this is
instead completely driven by WindowServer's compositing timer. For all
current intents and purposes it does the job well enough. :^)
2020-03-22 21:13:23 +01:00
Chris
bb70d0692b
WindowServer: Improve the close button shape
2020-03-22 19:57:58 +01:00
Andreas Kling
beba585f37
LibWeb: Use FlyString for DOM event names
2020-03-22 19:53:22 +01:00
Andreas Kling
7309642ca8
LibWeb: Use FlyString for Element tag names
...
This makes selector matching a lot more efficient, and also reduces the
number of strings on the heap.
2020-03-22 19:12:10 +01:00
Andreas Kling
c4a6d6ae9f
AK: Add FlyString::to_lowercase() and LogStream operator<<(FlyString)
2020-03-22 19:07:02 +01:00
Andreas Kling
7f8dc347b5
LibGUI: Allow constructing Variant from FlyString
2020-03-22 19:06:31 +01:00
Andreas Kling
7f83f77377
LibWeb: Use FlyString for element attribute names
...
Attribute names occur again and again.
2020-03-22 13:10:04 +01:00
Andreas Kling
26bc3d4ea0
AK: Add FlyString::equals_ignoring_case(StringView)
...
And share the code with String by moving the logic to StringUtils. :^)
2020-03-22 13:07:45 +01:00
Andreas Kling
0efa47b7ef
AK: Run clang-format on StringUtils.{cpp,h}
2020-03-22 13:04:04 +01:00
Andreas Kling
cccbe43056
LibJS: Use FlyString for identifiers
...
This makes variable and property lookups a lot faster since comparing
two FlyStrings is O(1).
2020-03-22 13:03:43 +01:00
Andreas Kling
4f72f6b886
AK: Add FlyString, a simple flyweight string class
...
FlyString is a flyweight string class that wraps a RefPtr<StringImpl>
known to be unique among the set of FlyStrings. The class is very
unoptimized at the moment.
When to use FlyString:
- When you want O(1) string comparison
- When you want to deduplicate a lot of identical strings
When not to use FlyString:
- For strings that don't need either of the above features
- For strings that are likely to be unique
2020-03-22 13:03:43 +01:00
Andreas Kling
0395b25e3f
LibWeb: Put selection-related debug spam behind an #ifdef
2020-03-22 13:03:43 +01:00
Shannon Booth
d7133ea326
Kernel: Fix compilation error with ACPI_DEBUG enabled
2020-03-22 08:51:40 +01:00
Shannon Booth
83425b1ac0
LibCore: Wrap commented out debug messages in a preprocessor define
...
We can also remove an outdated FIXME as dbg() does now support unsigned
longs :^)
2020-03-22 08:51:40 +01:00
Shannon Booth
757c14650f
Kernel: Simplify process assertion checking if region is in range
...
Let's use the helper function for this :)
2020-03-22 08:51:40 +01:00
Shannon Booth
81adefef27
Kernel: Run clang-format on files
...
Let's rip off the band-aid
2020-03-22 01:22:32 +01:00
Shannon Booth
d0629d0a8c
Shell: More general tilde expansion
...
Now expanding a tilde isn't hardcoded to just work for `cd`. It is instead
expanded while processing shell arguments. Autocompletion still doesn't
work, but this is definitely an improvement over the last iteration.
2020-03-22 01:15:33 +01:00
Shannon Booth
1ef3d4af69
Shell: Use starts_with() in expand_parameters
...
This reads a little nicer, and makes us care less about an empty String
2020-03-22 01:15:33 +01:00
Shannon Booth
d806dfe801
Shell: Use size_t for SH_DEBUG vector iteration
...
We missed this when switching to size_t for vector sizing as this
code is not normally compiled.
2020-03-22 01:15:33 +01:00
Andreas Kling
ec6e55cfc6
LibGUI: Don't spam WindowServer with SetWindowOverrideCursor messages
...
Remember the override cursor in GUI::Window and avoid sending a message
to WindowServer when possible.
This removes a lot of synchronous IPC between Browser and WindowServer,
which noticeably improves DOM event responsiveness. :^)
2020-03-22 01:07:07 +01:00
Andreas Kling
065db26d7c
Base: Add a demo web page for canvas+setInterval+randomness
...
Click somewhere in the black area and drag for colorful effect! :^)
2020-03-21 19:07:21 +01:00
Andreas Kling
fd5a3b3c39
LibGfx: Parse "rgb(r,g,b)" style color strings
...
This parser is not very lenient, but it does the basic job. :^)
2020-03-21 19:06:38 +01:00
Andreas Kling
e2a38f3aba
LibWeb: Add a naive implementation of setInterval()
...
This implementation leaks a Core::Timer whenever you call setInterval()
so it will definitely need some improvements, but it does kinda work!
2020-03-21 18:55:37 +01:00
Andreas Kling
81e18a9b26
LibWeb: Silence some debug spam about JS event handler invocations
2020-03-21 18:55:12 +01:00
Andreas Kling
7c48c3c8e1
LibJS: Parse "if" statements
...
This patch implements basic parsing of "if" statements. We don't yet
support parsing "else", so I added a FIXME about that.
2020-03-21 18:40:17 +01:00
Andreas Kling
55c845713a
LibWeb: Give MouseEvents the correct offsetX and offsetY values
2020-03-21 18:27:06 +01:00
Andreas Kling
4dde36844b
LibWeb: Add a DOM Event class (instead of events being simple strings)
...
This patch adds the Event base class, along with a MouseEvent subclass.
We now dispatch MouseEvent objects for mousedown, mouseup and mousemove
and these objects have the .offsetX and .offsetY properties.
Both of those properties are hard-coded at the moment. This will be
fixed in the next patch. :^)
2020-03-21 18:17:18 +01:00
Andreas Kling
b196665131
LibWeb: Dispatch "mouseup" event
...
This is a very naive implementation that doesn't account for where the
mousedown happened.
2020-03-21 17:55:41 +01:00
Andreas Kling
8b18674229
LibJS: Add Math.random() :^)
2020-03-21 17:52:12 +01:00
Andreas Kling
c4c549625f
LibWeb: Add HTMLCanvasElement.{width,height} properties
2020-03-21 17:44:01 +01:00
Andreas Kling
f1715bbd5e
LibWeb: Make the "document" global a native property
...
This defers construction of the document wrapper until actually needed.
2020-03-21 14:54:33 +01:00
Andreas Kling
a7d458f76a
Base: Tidy up the events.html test page a little bit
2020-03-21 14:53:13 +01:00
Andreas Kling
08b17d70af
LibJS+LibWeb: Fix some inconsistencies in NativeFunction callbacks
...
These should always pass the arguments in a const Vector<JS::Value>&.
2020-03-21 14:43:44 +01:00
Andreas Kling
324b92fd06
LibJS: Virtualize access to an Object's own properties
...
Object now has virtual get_own_property() and put_own_property() member
functions that can be overridden to provide custom behavior.
We use these virtuals to move Array-specific access behavior to Array.
2020-03-21 14:37:34 +01:00
Andreas Kling
2a7dbac0c5
LibJS: Include the cell size in HeapBlock mmap names
...
HeapBlocks now show up in SystemMonitor as "LibJS: HeapBlock(32)" :^)
2020-03-21 13:12:16 +01:00
Andreas Kling
00feef8642
LibJS: Some optimizations for ObjectExpression
...
- move() the property map when constructing ObjectExpression instead of
making a copy.
- Use key+value iterators to traverse the property map in the execute()
and dump() functions.
2020-03-21 13:11:51 +01:00
Andreas Kling
6c3afca686
LibJS: Round cell sizes up to a multiple of 16 bytes
...
This increases HeapBlock utilization significantly (and reduces overall
memory usage.)
2020-03-21 11:49:18 +01:00
Andreas Kling
2106dafd62
LibJS: Delete fully-empty HeapBlocks after garbage collection
...
We now deallocate GC blocks when they are found to have no live cells
inside them.
2020-03-21 11:46:47 +01:00
0xtechnobabble
bc002f807a
LibJS: Parse object expressions
2020-03-21 10:08:58 +01:00
BenJilks
c64b5e73f5
Build: Add FreeBSD support ( #1492 )
2020-03-21 09:46:30 +01:00
Andreas Kling
bceabd7c4b
LibJS: Add ArrayPrototype and implement Array.prototype.push()
...
This function is ultimately supposed to be generic and allow any |this|
that has a length property, but for now it only works on our own Array
object type.
2020-03-20 21:56:40 +01:00