Commit Graph

10335 Commits

Author SHA1 Message Date
Andreas Kling
21957745f7 LibWeb: Special-case initialization of HTML::AttributeNames::class_
Just do it after all the others instead of trying to be clever.
2020-06-03 22:06:52 +02:00
Andreas Kling
6c09420571 KeyboardMapper: Add missing #pragma once 2020-06-03 22:06:08 +02:00
Andreas Kling
c40de9275a LibWeb: Buffer text node character insertions in the new parser
Instead of appending character-at-a-time, we now buffer character
insertions in a StringBuilder, and flush them to the relevant node
whenever we start inserting into a new node (and when parsing ends.)
2020-06-03 21:53:08 +02:00
Andreas Kling
2149820260 LibWeb: Use HTML::AttributeNames::foo instead of FlyString("foo")
To avoid the costly instantiation of FlyStrings whenever we're looking
up attributes, use the premade HTML::AttributeNames globals. :^)
2020-06-03 21:53:00 +02:00
Hüseyin ASLITÜRK
ff55d00261 Base: Fix incorrect json value for escape character 2020-06-03 21:52:40 +02:00
Hüseyin ASLITÜRK
d3578fdf9b Applications: Add new KeyboardMapper application
New editing app for keymap files.
2020-06-03 21:52:40 +02:00
Hüseyin ASLITÜRK
92d03931d6 Userland: keymap, use LibKeyboard to read keymap files 2020-06-03 21:52:40 +02:00
Hüseyin ASLITÜRK
3bf5602521 LibKeyboard: Add new library for keyboard applications
Move shared code base from keymap and KeyboardMapper to this library.
2020-06-03 21:52:40 +02:00
Hüseyin ASLITÜRK
9ec6ac31b8 WindowsServer: Add scancode value to KeyEvent 2020-06-03 21:52:40 +02:00
Hüseyin ASLITÜRK
c6f1962919 LibGUI: Add scancode value to KeyEvent 2020-06-03 21:52:40 +02:00
Hüseyin ASLITÜRK
46b92fa173 Kernel: Add scancode value to KeyEvent 2020-06-03 21:52:40 +02:00
Hüseyin ASLITÜRK
ed20800320 Base: New icon for KeyboardMapper application 2020-06-03 21:52:40 +02:00
Hüseyin ASLITÜRK
eead3878a1 LibGUI: Add save action to CommonActions list 2020-06-03 21:52:40 +02:00
Hüseyin ASLITÜRK
8e9776165f AK: JSON, Escape spacial character in string serialization 2020-06-03 21:52:40 +02:00
Marcin Gasperowicz
0b74ea3d6a LibJS: Make typeof return undefined for undefined variables
This makes `typeof i_dont_exist` return `undefined` instead of 
throwing an error.
2020-06-03 19:31:44 +02:00
Jack Karamanian
b0932b0aec LibJS: Allow null or undefined as a bound |this| value in strict mode 2020-06-03 08:19:03 +02:00
FalseHonesty
870bcaeef6 LibDebug: Add all Dwarf v5 attributes, tags, and form enum values 2020-06-03 08:12:50 +02:00
FalseHonesty
f958c693ee HackStudio: Support debugging variables with Enum types
Variables with enum types can now be both viewed and modified in the
variables view!
2020-06-03 08:12:50 +02:00
FalseHonesty
a4f23429aa LibDebug: Add support for enum value types
Additionally, we will parse and expose the types of variables
if they are complex, like Enums or Structs. Variables of an enum
type are special in that they do not store all the members of said
enum in their own VariableInfo like Structs do, rather, all of the
values are stored in the VariableInfo for the Enum.
2020-06-03 08:12:50 +02:00
Andreas Kling
b750843797 LibWeb: Remove assertion in HTMLImageElement::resource_did_load()
We might end up here with a non-null decoder if the Resource fires load
callbacks again for the resource. It's harmless since we'll just get
the same decoder again.
2020-06-02 22:05:29 +02:00
Andreas Kling
ffae239e91 Base: Fix bad URL in welcome page 2020-06-02 22:05:29 +02:00
Sergey Bugaev
e651af21f8 Calculator: Set text color through the palette
Unfortunately, this means the Calculator won't pick up system theme changes
dynamically.

Fixes https://github.com/SerenityOS/serenity/issues/1077
2020-06-02 21:49:47 +02:00
Sergey Bugaev
f49e83c565 LibGfx: Fix debug-printing colors
The operator has to live in the namespace Gfx.
2020-06-02 21:49:47 +02:00
Sergey Bugaev
1e266aec27 Kernel: Always inline some KResult / KResultOr<> methods
Namely, those that contain assertions that can be easily eliminated at call site.
2020-06-02 21:49:47 +02:00
Sergey Bugaev
1b4e88fb59 Kernel: Allow File::close() to fail
And pass the result through to sys$close() return value.

Fixes https://github.com/SerenityOS/serenity/issues/427
2020-06-02 21:49:47 +02:00
Andreas Kling
d4ddb0013c LibWeb: Share decoded images at the Resource level :^)
This patch adds ImageResource as a subclass of Resource. This new class
also keeps a Gfx::ImageDecoder so that we can share decoded bitmaps
between all clients of an image resource inside LibWeb.

With this, we now share both encoded and decoded data for images. :^)

I had to change how the purgeable-volatile flag is updated to keep the
volatile-images-outside-the-visible-viewport optimization working.
HTMLImageElement now inherits from ImageResourceClient (a subclass of
ResourceClient with additional image-specific stuff) and informs its
ImageResource about whether it's inside the viewport or outside.

This is pretty awesome! :^)
2020-06-02 20:32:38 +02:00
Andreas Kling
1c6e4e04a8 Meta: Time for a new screenshot! :^)
This one is pretty similar to the previous one, but the increase in
polish is noticeable.
2020-06-02 19:29:31 +02:00
Andreas Kling
8ea4375d4a LibGfx: Templatize some of the scanline unpacking code 2020-06-02 19:28:55 +02:00
Andreas Kling
19587934f3 LibGfx: Consolidate some types in the PNG decoder 2020-06-02 19:28:55 +02:00
Linus Groh
6c89303e7e js: Print call stack on exception thrown outside the global context 2020-06-02 15:22:34 +02:00
Linus Groh
4f6912c605 LibJS: Store basic traceback in Exception
Nothing fancy like line numbers, but Exception now stores a list of
function names up to the current call frame.
2020-06-02 15:22:34 +02:00
Linus Groh
a48080f62d LibJS: Move Interpreter::get_trace() to ConsoleClient
Having it globally on the interpreter is confusing as the last call frame
is skipped, which is specific to console.trace().
2020-06-02 15:22:34 +02:00
Linus Groh
9e3127785e LibJS: Remove dummy implementations from Console methods
Having these duplicated is not really useful, either we want console
output to go somewhere then implementing a console client is the way to
go, or we don't care about console output - in that case we don't need
to dbg() either.
2020-06-02 15:22:34 +02:00
Linus Groh
871d88cd91 FontEditor: Fix typo in comment
s/Ediyor/Editor/
2020-06-02 14:38:17 +02:00
Andreas Kling
a3936f10eb LibWeb: Fix tokenizing scripts with '<' in them
The EMIT_CHARACTER_AND_RECONSUME_IN was emitting the current token
instead of the specified codepoint.
2020-06-02 14:27:53 +02:00
Andreas Kling
f3799b501e LibWeb: Port ImageStyleValue to the ResourceClient interface 2020-06-02 14:26:10 +02:00
Andreas Kling
ca8398bc19 LibWeb: Avoid an unnecessary temporary variable in HTMLImageElement 2020-06-02 13:51:57 +02:00
Andreas Kling
7197adbd55 LibWeb: Port HTMLLinkElement to the ResourceClient interface 2020-06-02 13:51:57 +02:00
Linus Groh
b32761f2e0 LibJS: Consider non-extensible objects in Reflect.setPrototypeOf() 2020-06-02 13:51:02 +02:00
Linus Groh
c1248a7fd8 LibJS: Implement Reflect.{isExtensible,preventExtensions}() 2020-06-02 13:51:02 +02:00
Linus Groh
b958e4f573 LibJS: Disallow changing the prototype of non-extensible objects
Object::set_prototype() now returns a boolean indicating success.
Setting the prototype to an identical object is always considered
successful, even if the object is non-extensible.
2020-06-02 13:51:02 +02:00
Linus Groh
8cf1ded478 LibJS: Don't assume Object.setPrototypeOf() prototype value is an object
We're crashing otherwise. Also it was not possible to set the prototype
to null.
2020-06-02 13:51:02 +02:00
Linus Groh
1a64bdd80c LibJS: Return specified object from Object.setPrototypeOf()
We were leaking an empty value.
2020-06-02 13:51:02 +02:00
Marcin Gasperowicz
a60a5bc70a Userland/js: Add global property to the global object + help fix
This adds a `global` property to the global object so that 
`global == this` when typed into the REPL.

This matches what Node.js does and helps with testing on existing 
JS code that uses `global` to detect its environment.
2020-06-02 13:50:19 +02:00
Andreas Kling
59adccb987 LibCore: Put some annoying debug spam behind EVENTLOOP_DEBUG 2020-06-02 12:46:52 +02:00
Andreas Kling
410fa5abe0 LibWeb: Parse barebones document without doctype, <html>, etc.
Last night I tried making a little test page that had a bunch of <img>
elements and nothing else. It didn't work.

Fix this by correctly adding a synthesized <html> element to the
document if we get something else in the "before html insertion mode.
2020-06-02 08:50:33 +02:00
Matthew Olsson
d5ae73a63b LibJS: Add Object.{isExtensible,preventExtensions}() 2020-06-02 08:50:26 +02:00
Keith
daa3f59a55
Base: Fix misspelling in getopt(3) (#2473) 2020-06-02 07:40:26 +02:00
Andreas Kling
9170edf541 LibWeb: Protect ourselves during ResourceClient iteration
Notifying a Resource's clients may lead to arbitrary JS execution,
so we can't rely on the ResourceClient pointers remaining valid.
Use WeakPtr to avoid this problem.
2020-06-01 22:09:38 +02:00
Andreas Kling
e5ddb76a67 LibWeb: Support "td" and "th" start tags during "in table body"
This makes it possible to load Google Image Search results. You can't
see the images yet, but it's still something. :^)
2020-06-01 22:09:09 +02:00