Commit graph

5318 commits

Author SHA1 Message Date
Andreas Kling
a34e023a33 LibC: Make getdelim() fail with EINVAL on null input pointers
This matches some other libc's.
2020-12-09 21:12:40 +01:00
asynts
2981f10a5e LibWeb: Apply suggested fixes. 2020-12-09 21:05:06 +01:00
asynts
1c7a834278 LibWeb: Expose DOM::Range to JavaScript. 2020-12-09 21:05:06 +01:00
asynts
10f9c85090 LibWeb: Make DOM::Range more suitable for JS. 2020-12-09 21:05:06 +01:00
asynts
4df0eeaa3d LibWeb: Join start and end after deleting selection. 2020-12-09 21:05:06 +01:00
asynts
a94a1d9f9e LibWeb: Implement deletion of more complex selections. 2020-12-09 21:05:06 +01:00
asynts
b3d7c5bfbc LibWeb: Fix many bugs with the editing. 2020-12-09 21:05:06 +01:00
asynts
78558c9f30 LibWeb: Add support for cursor movement and delete. 2020-12-09 21:05:06 +01:00
asynts
e96faea1a2 LibWeb: Support range delection accross nodes with shared parent. 2020-12-09 21:05:06 +01:00
asynts
43dc47a494 LibWeb: Add support for range deletion. 2020-12-09 21:05:06 +01:00
asynts
bbcc5a9332 LibWeb: Move editing stuff into EditEventHandler. 2020-12-09 21:05:06 +01:00
asynts
82aac98bea IDL: Produce better error messages when parsing IDL files. 2020-12-09 21:05:06 +01:00
Sahan Fernando
8e1bda0e9d LibGUI: Show action shortcut in ToolBarButton tooltip 2020-12-09 15:00:34 +01:00
Linus Groh
50b76e4cc7 LibWeb: Don't allocate XMLHttpRequestConstructor twice
add_constructor() will already allocate an XMLHttpRequestConstructor and
update m_xhr_constructor accordingly, we don't have to do it ourselves.
This is now in line with how all the LibJS constructors work. Also make
the XHR constructor responsible for setting its "prototype" property
itself, for consistency and fail-proofing.
Previously we would only set it on the constructor we allocated manually
but which was then thrown away, leading to the property never being set
properly.
2020-12-09 12:49:30 +01:00
Linus Groh
5e9f6f2e2c LibWeb: Disallow construction of XMLHttpRequest without 'new'
The XMLHttpRequest interface only has a constructor and isn't supposed
to be callable as a function.
https://xhr.spec.whatwg.org/#constructors
2020-12-09 12:47:13 +01:00
Andreas Kling
5b7fb92ede LibWeb: Build the DumpLayoutTree subdirectory 2020-12-08 23:41:56 +01:00
Andreas Kling
35ad102595 LibWeb: Add missing license header to DumpLayoutTree 2020-12-08 23:41:45 +01:00
Andreas Kling
baf4c7d3f2 LibWeb: Remove an empty line from OOPWV 2020-12-08 23:40:45 +01:00
Andreas Kling
f52ce49a36 LibWeb: Add a simple DumpLayoutTree program
This loads a page and, dumps the layout tree to stdout, and exits.
2020-12-08 23:36:19 +01:00
Andreas Kling
cf646badfa LibWeb: Allow dumping layout tree into a StringBuilder 2020-12-08 23:36:19 +01:00
Andreas Kling
eda9fb13cc LibWeb+WebContent: Add on_load_finish hook to web views
This isn't entirely symmetrical with on_load_start as it will also fire
on reloads and back/forward navigations. However, it's good enough for
some basic use cases, and we can do more sophisticated notifications
later on when we need them.
2020-12-08 23:36:19 +01:00
Andreas Kling
e99cfd517c LibJS: Add test for Math.asin() 2020-12-08 23:36:19 +01:00
AnotherTest
f12c98b29f LibRegex: Add a basic Regex<...>::replace() 2020-12-08 23:34:38 +01:00
Andreas Kling
48d2545572 LibJS: Get rid of Argument and ArgumentVector
This was used for a feature where you could pass a vector of arguments
to enter_scope(). Since that way of passing arguments was not GC-aware
(as vectors use C++ heap storage), let's avoid using it and make sure
everything that needs to stay alive is either on the stack or in traced
storage instead.
2020-12-08 18:28:18 +01:00
Andreas Kling
38268f1c53 LibJS: Create lexical scope for "catch" on the spot when throwing 2020-12-08 18:22:47 +01:00
Andreas Kling
fc9e43728b LibJS: Stop creating a redundant lexical scope on function call
We were scoping the arguments twice, first in execute_function_body(),
and then again in enter_scope().
2020-12-08 18:04:54 +01:00
Andreas Kling
6496895b16 LibWeb: <iframe src> same-origin check should be based on host document
We were basing the src attribute's cross-origin check on whatever was
currently loaded in the iframe, instead of the surrounding document.

Fixes #4236.
2020-12-08 17:49:02 +01:00
Andreas Kling
df2a6cb4ab LibJS: Add Math.acos() and Math.asin() 2020-12-08 17:49:02 +01:00
Andreas Kling
231171364d LibJS: Remove some unnecessary null checks
It's okay to add nullptr to the conservative roots set. We'll just
ignore it later on anyway.
2020-12-08 17:49:02 +01:00
Andreas Kling
d2e3e038d6 LibJS: Use IndexedProperties::for_each_value() in update_function_name()
This allows us to get rid of IndexedProperties::values_unordered().
2020-12-08 17:49:02 +01:00
Andreas Kling
6c4b823cef LibJS: Make marking object indexed properties less allocation-heavy
We were building up a vector with all the values in an object's indexed
property storage, and then iterating over the vector to mark values.
Instead of this, simply iterate over the property storage directly. :^)
2020-12-08 17:49:02 +01:00
Andreas Kling
930fae633e LibJS: Make sure GlobalObject marks the Proxy constructor 2020-12-08 17:49:02 +01:00
Andreas Kling
63b748642a LibJS: Add Math.atan() 2020-12-08 17:49:02 +01:00
Sahan Fernando
fe3963f3d4 LibGfx: SIMD optimized alpha blending 2020-12-08 09:39:43 +01:00
Sahan Fernando
893adbb79c LibGfx: Simplify and refactor Gamma.h
Remove ACCURATE_GAMMA_ADJUSTMENT, since it makes the implementation
uglier, isn't guaranteed to make gamma adjustment accurate and is much
slower.  gamma_accurate_blend4 should either be always used or not
exist based on compilation flags, so there is no need to have it in
its own function. Finally, we should use AK/SIMD.h instead of defining
our own f32x4 type.
2020-12-08 09:39:43 +01:00
Alex Studer
30ee597056 LibM: Add implementation of ldexpf 2020-12-08 09:38:17 +01:00
Ben Wiederhake
6c2ea4c4e9 Clipboard: Remove-unused bpp metadata
It's just more attack surface, and can be deduced from the format anyway.
2020-12-08 09:37:30 +01:00
Andreas Kling
3852168c84 LibWeb: Compute final line box width *after* placing all fragments
We were doing this after every fragment instead of after every line.
2020-12-07 21:48:23 +01:00
Andreas Kling
56ff2c112b LibWeb: When adding inline-block fragment to line, use border box width
We were only using the content box width for inline-block fragments,
which caused them to not to claim the space needed for padding+border.
2020-12-07 21:47:13 +01:00
Andreas Kling
05e1ecb3d0 LibWeb: Uhh, scale back the default padding on <ul> and <ol> a bit
40px is a lot of padding in our small-fonted world. :^)
2020-12-07 21:37:00 +01:00
Andreas Kling
5d685c4643 LibWeb: Add padding-left to the default UA style for <ol> and <ul>
This matches what other engines do.
2020-12-07 21:17:59 +01:00
Andreas Kling
a3acbf1db2 LibWeb: Include padding+border in shrink-to-fit preferred min width 2020-12-07 21:13:41 +01:00
Andreas Kling
5a57f618ad LibWeb: Resolve width in relative length units on inline-block properly
Element-relative width units like em, ex, etc. should be resolved
against the inline block itself, not against its containing block.
2020-12-07 20:55:44 +01:00
Andreas Kling
70de5fd056 LibWeb: Simplify final line box width computation
The width of a line box is the distance from the left edge of the first
fragment to the right edge of the last fragment. We don't have to loop
over all the fragments to figure this out. :^)
2020-12-07 20:48:26 +01:00
Andreas Kling
be18ac36b2 LibWeb: Use CSS::Length::resolved_or_zero() in a few places 2020-12-07 20:46:01 +01:00
Andreas Kling
d65bebd8cf LibWeb: Cache parsed inline style of DOM elements
Instead of invoking the CSS parser every time we compute the style for
an element that has a "style" attribute, we now cache the result of
parsing the inline style whenever the "style" attribute is set.

This is a nice boost to relayout performance since we no longer hit the
CSS parser at all.
2020-12-07 20:00:27 +01:00
Andreas Kling
ab289e183e LibGUI: Expose widget focus policy as a Core::Object property
This makes focus policies show up in the inspector which is helpful.
2020-12-07 19:46:34 +01:00
Andreas Kling
5b0deba49c LibWeb: Make layout tree dumps nicer
This patch removes a bunch of the less generally useful information
from layout tree dumps and puts it behind some optional bool params.
We also show layout units as integers instead of floats for now,
since fractional layout almost never happen anyway (yet) and this makes
it much easier to read.
2020-12-07 19:40:12 +01:00
Linus Groh
358ec1f1eb LibVT: Add "Copy name" action to terminal link context menu
Similar to "Copy URL" there is now a "Copy name" action in the context
menu specialized for terminal links. I chose to not alter the behaviour
of the existing copy action to prevent surprises when text is selected
and the user happens to place the cursor over a link.

Closes #4187.
2020-12-07 15:55:12 +01:00
Linus Groh
6b7061d00b LibVT: Enable TerminalWidget copy/paste menu actions conditionally
The copy action is now only enabled if there is a selection.
The paste action is now only enabled if the clipboard contains something
the terminal considers pasteable - that is, non-empty data with a text/*
MIME-type. Previously we'd happily paste things like bitmaps into the
terminal, causing it to blow up.
2020-12-07 15:55:12 +01:00