Commit graph

43155 commits

Author SHA1 Message Date
Ali Mohammad Pur
e9b9527440 AK: Add a fast path for DisjointChunks::spans() 2022-11-17 20:13:04 +03:30
Ali Mohammad Pur
253f4de302 LibRegex: Use spans<4> to avoid allocating small vectors
This path is hit a lot, and alloc/free of this vector was showing up on
profiles, so get rid of it.
2022-11-17 20:13:04 +03:30
Ali Mohammad Pur
f1851346d3 LibRegex: Use a copy-on-write vector for fork state 2022-11-17 20:13:04 +03:30
Ali Mohammad Pur
48a4c9c1ad AK: Use TypedTransfer to move vector's inline buffer
This avoids an explicit loop-move when the type is trivial.
2022-11-17 20:13:04 +03:30
Ali Mohammad Pur
6970bf03a9 AK: Mark Span<T> as trivial 2022-11-17 20:13:04 +03:30
Ali Mohammad Pur
f59bd33876 AK: Allow DisjointChunks::spans to return a vector with inline capacity 2022-11-17 20:13:04 +03:30
Ali Mohammad Pur
bee9412ae4 AK: Align last bump allocated chunk's end offset to the type size too
Otherwise we can end up freeing garbage memory with some type sizes.
2022-11-17 20:13:04 +03:30
Ali Mohammad Pur
cfcd6e770c LibRegex: Don't copy forked results twice 2022-11-17 20:13:04 +03:30
Ali Mohammad Pur
464ac85a1b LibRegex: Avoid copying MatchInput when getting argument descriptions 2022-11-17 20:13:04 +03:30
davidot
73fcbbb0ee LibJS: Give the undeclared private identifier error more precedence
Before this could give the `must be followed by in` error before the
undeclared private identifier error. Fixing the `in` error would not
have resolved the other error so this order makes the errors more
actionable.
2022-11-17 16:05:20 +00:00
davidot
16ac43c9d4 LibJS: Make sure private identifier is valid in optional chain
If we don't check that a private identifier is valid this can break the
assumption that we have a private environment when evaluation the
private identifier. Also an unknown private identifier this should
be a SyntaxError.
2022-11-17 16:05:20 +00:00
davidot
49fc0e2514 LibJS: Add space in output of toEval in test-common.js 2022-11-17 16:05:20 +00:00
davidot
8fa6861f66 LibJS: Initialize functions in spec order
This is only visible with something like `Object.getOwnPropertyNames` on
the global object. All other declaration instantiations put the
functions on an environment making the order invisible.
Note that spec order is not quite tree order as in non-strict mode
functions which get hoisted out of blocks appear before top level
functions.

Co-authored-by: Hendiadyoin1 <leon.a@serenityos.org>
2022-11-17 16:05:20 +00:00
davidot
5ca6e8dca8 LibJS: No longer hoist if parent scope has a function with the same name 2022-11-17 16:05:20 +00:00
davidot
54b2d8c1b8 LibJS: Reuse as_i32 in as_double in JS::Value
Since this might be complicated with NaN boxing keeping it as one
implementation makes this easier to check and change.
2022-11-17 16:05:20 +00:00
davidot
2e24ee49aa LibTest: Fail if the top-level result of running a JS file is an error
Before putting `throw 1;` in a test file did not fail the file, and it
ignored the rest of the file. Now we check the resulting completion from
run and fail if that is an error.
2022-11-17 16:05:20 +00:00
Xexxa
f5a3355639 Base: Add more emoji
🧔 - U+1F9D4 PERSON: BEARD
🧔‍♂️ - U+1F9D4 U+200D U+2642 MAN: BEARD
💂 - U+1F482 GUARD
💂‍♂️ - U+1F482 U+200D U+2642 MAN GUARD
💂‍♀️ - U+1F482 U+200D U+2640 WOMAN GUARD
🧗‍♂️ - U+1F9D7 U+200D U+2642 MAN CLIMBING
🧗‍♀️ - U+1F9D7 U+200D U+2640 WOMAN CLIMBING
🗣️ - U+1F5E3 SPEAKING HEAD
🐵 - U+1F435 MONKEY FACE
🐈‍⬛ - U+1F408 U+200D U+2B1B BLACK CAT
🐯 - U+1F42F TIGER FACE
🐴 - U+1F434 HORSE FACE
🐎 - U+1F40E HORSE
🪿 - U+1FABF GOOSE
🐲 - U+1F432 DRAGON FACE
🍂 - U+1F342 FALLEN LEAF
🪹 - U+1FAB9 EMPTY NEST
🪺 - U+1FABA NEST WITH EGGS
🫚 - U+1FADA GINGER ROOT
🍮 - U+1F36E CUSTARD
 - U+26FA TENT
🛣️ - U+1F6E3 MOTORWAY
🛤️ - U+1F6E4 RAILWAY TRACK
✈️ - U+2708 AIRPLANE
🪭 - U+1FAAD FOLDING HAND FAN
🎓 - U+1F393 GRADUATION CAP
🪘 - U+1FA98 LONG DRUM
☎️ - U+260E TELEPHONE
🦯 - U+1F9AF WHITE CANE
🚮 - U+1F6AE LITTER IN BIN SIGN
↩️ - U+21A9 RIGHT ARROW CURVING LEFT
↪️ - U+21AA LEFT ARROW CURVING RIGHT
2022-11-16 21:43:33 +00:00
Xexxa
332061e002 Base: Adjust emoji
🌬️ - U+1F32C WIND FACE
🇪🇪 - U+1F1EA U+1F1EA FLAG: ESTONIA
2022-11-16 21:43:33 +00:00
Xexxa
2c8e161f2d Base: Add more emoji subdivision flags
🏴󠁮󠁯󠀰󠀲󠁿 - U+1F3F4 U+E006E U+E006F U+E0030 U+E0032 U+E007F NO-02
Akershus
🏴󠁮󠁯󠀰󠀷󠁿 - U+1F3F4 U+E006E U+E006F U+E0030 U+E0037 U+E007F NO-07
Vestfold
🏴󠁮󠁯󠀰󠀸󠁿 - U+1F3F4 U+E006E U+E006F U+E0030 U+E0038 U+E007F NO-08
Telemark
🏴󠁮󠁯󠀱󠀱󠁿 - U+1F3F4 U+E006E U+E006F U+E0031 U+E0031 U+E007F NO-11
Rogaland
🏴󠁮󠁯󠀲󠀰󠁿 - U+1F3F4 U+E006E U+E006F U+E0032 U+E0030 U+E007F NO-20
Finnmark
🏴󠁮󠁯󠀳󠀸󠁿 - U+1F3F4 U+E006E U+E006F U+E0033 U+E0038 U+E007F NO-38
Vestfold og Telemark
🏴󠁺󠁷󠁨󠁡󠁿 - U+1F3F4 U+E007A U+E0077 U+E0068 U+E0061 U+E007F ZW-HA
Harare
2022-11-16 21:43:33 +00:00
Xexxa
4e3498c388 Base: Add new yaks to emoji-serenity.txt
􌴤 - U+10CD24 Yakslow
􌴥 - U+10CD25 Buffyak
􌴦 - U+10CD26 Yaktrap
􌵪 - U+10CD6A Yakthink
􌵫 - U+10CD6B Hyperyakkie
2022-11-16 21:43:33 +00:00
Timothy Flynn
f7bb835d09 LibWeb+LibWebView+WebContent+WebDriver: Implement Send Alert Text 2022-11-16 17:23:56 +00:00
Timothy Flynn
f9b8742fff LibWeb+WebContent+WebDriver: Implement Get Alert Text 2022-11-16 17:23:56 +00:00
Timothy Flynn
3e7d633954 LibWeb+WebContent+WebDriver: Implement Accept Alert 2022-11-16 17:23:56 +00:00
Timothy Flynn
7cf2feb047 LibWeb+WebContent+WebDriver: Implement Dismiss Alert 2022-11-16 17:23:56 +00:00
Timothy Flynn
159dcb9507 LibWeb: Fix typo in WebDriver section comment 2022-11-16 17:23:56 +00:00
Timothy Flynn
0e94904034 LibWebView+WebContent: Begin handling open user dialogs for WebDriver
The way in which dialogs should be handled is configurable by the driver
capabilities object, which we don't support yet. So this implements just
the default mode to dismiss the dialog and return an error if there is
one open.

In the OOPWV, this means we need to refer to the dialog after it has
been open, so we now hold a pointer to whatever dialog is open.
2022-11-16 17:23:56 +00:00
Timothy Flynn
5b31a3dbc7 LibGUI: Allow more programmatic control over GUI::InputBox
This will be needed for WebDriver, which will require constructing and
controlling dialogs manually. Currently, InputBox will only set its text
value when the OK button is pressed. This changes InputBox to update its
text when done(ExecResult::OK) is invoked in any way.

This also makes the text_value() method public, allows for setting the
text value, and allows for moving-in the initial text value.
2022-11-16 17:23:56 +00:00
Timothy Flynn
db4fa36b58 LibGUI: Add GUI::Dialog to the LibGUI forwarding header 2022-11-16 17:23:56 +00:00
Timothy Flynn
364f44d7d8 LibWebView+WebContent: Wait for dialog responses without blocking IPC
Currently, the WebContent process is completely blocked while waiting
for a response to a dialog request. This patch allows the IPC event loop
to continue executing while only blocking the HTML event loop.

This will allow other processes like WebDriver to continue to operate on
the WebContent process while a dialog is open.
2022-11-16 17:23:56 +00:00
Timothy Flynn
4b8729aea6 LibWeb: Add a flag to pause an HTML event loop's execution
This will be used to unblock the WebContent IPC event loop while waiting
for a dialog response.
2022-11-16 17:23:56 +00:00
Timothy Flynn
894bddf62c Base: Add a simple test page for window.prompt
The window prototypes alert, confirm, and prompt must "pause" execution
until a response is received from the user. This test page is meant to
ensure that a timeout queued before a prompt is not executed until after
that prompt is closed.
2022-11-16 17:23:56 +00:00
Andreas Kling
4aeb1ffc12 LibWeb: Add naive layout for SVG foreign objects
We now layout foreign objects as if they form a nested block formatting
context. This probably isn't the most correct way to do this, but it's
a start.
2022-11-16 13:01:21 +01:00
Andreas Kling
0555684682 LibWeb: Sketch out basic support for SVG <foreignObject> elements
This patch adds basic DOM construction and IDL bindings for foreign
objects in SVG trees.
2022-11-16 13:01:21 +01:00
Andreas Kling
e9eba66361 LibWeb: Adjust foreignobject to foreignObject in HTML parser
This conversion was missing from the table we copied from the spec
for whatever reason.
2022-11-16 13:01:21 +01:00
Aliaksandr Kalenik
1b5b7e3b01 LibWeb: Solve width for absolute positioned elemenent according to spec
https://www.w3.org/TR/css-position-3/#abs-non-replaced-width
If left and width are auto and right is not auto, then
the width is shrink-to-fit. Then solve for left.
2022-11-16 03:10:26 +01:00
martinfalisse
70559e9d14 Base: Add test for grid-gap and auto-fit 2022-11-16 00:53:00 +01:00
martinfalisse
35094fc744 LibWeb: Make auto-fit compatible with grid-gap
This fixes an error when using auto-fit with grid-gap, as previously
were not taking into account the fact that more columns had been added
to the grid yet the occupation grid had not grown.
2022-11-16 00:53:00 +01:00
martinfalisse
4b6534a26d LibWeb: Use fixed-size tracks for grid gap
Previously were incorrectly initializing the grid gap tracks as were
using the GridSize float constructor, which creates a flexible length.
What is actually wanted is a fixed-size track of a certain size,
indicated in pixels.
2022-11-16 00:53:00 +01:00
Torstennator
b2a6066042 LibGfx: Optimize anti-aliased line drawing and stroking
This patch optimizes the drawing of aa-lines by rotating the drawn
rectangle to the direction where the line points. That enables us to
draw non-straight lines with the proper width.
If a aa-line is drawn that is infact a straigt line we now dont plot
those lines with multipe rectangles across the line - insted we draw
straight lines in one go with just one rectangle of proper size.
Stroking of lines has been enhanced to take care of the edges between
two lines with drawing the stroke till the intersections of two
connected lines.
2022-11-15 22:59:25 +01:00
Torstennator
7c09d7c52f LibWeb: Change SVGContext initial fill_color to transparent
This patch changes the initialization of the fill_color of an SVGContext
to transparent instead of black to not draw a black filling if the
elements fill_color is defined as "none".
2022-11-15 22:59:25 +01:00
Aliaksandr Kalenik
adf0262b54 LubWeb: Call before_children_paint for positioned descendants
Add before_children_paint and after_children_paint calls for
positioned descendants with z-index: auto during painting
2022-11-15 22:53:47 +01:00
Aliaksandr Kalenik
f3d57e1157 LibWeb: Clip hidden overflow by absolute rect of containing block
Since handling overflow: hidden in PaintableBox::before_children_paint
while following paint traversal order can't result in correctly computed
clip rectangle for elements that create their own stacking context
(because before_children_paint is called only for parent but overflow:
hidden can be set somewhere deeper but not in direct ancestor), here
introduced new function PaintableBox::clip_rect() that computes clip
rectangle by looking into containing block.

should_clip_overflow flag that disables clip for absolutely positioned
elements in before_children_paint and after_children_paint is removed
because after changing clip rectangle to be computed from not parent
but containing block it is not needed anymore (absolutely positioned
item is clipped if it's containing block has hidden overflow)
2022-11-15 22:53:47 +01:00
Aliaksandr Kalenik
c1401b37c4 LibWeb: Join out-of-flow block nodes in last parent child if possible
Join out-of-flow block nodes into last child of parent node if last
child has inline children.
2022-11-15 22:52:08 +01:00
Idan Horowitz
43c5b94ea6 LibWeb: Implement document.open(string, string, string) 2022-11-15 21:48:19 +00:00
Idan Horowitz
a63c7549e1 LibWeb: Implement window.open
This implementation is some-what complete, with the most common missing
/broken feature being opening pages in new tabs using the "_blank"
target.

This is currently broken due to 2 reasons:
 - We currently always claim the Window does not have transient
   activation, as we do not track the transient activation timestamp
   yet. This means that all such window.open calls are detected as
   pop-ups, and as such they are blocked. This can be easily bypassed
   by unchecking the 'Block Pop-ups' checkbox in the debug menu.
 - There is currently no mechanism for the WebContent process to
   request a new tab to be created by the Browser process, and as
   such the call to BrowsingContext::choose_a_browsing_context does not
   actually open another tab.
2022-11-15 21:48:19 +00:00
Idan Horowitz
d15d7636e5 LibWeb: Add window.open feature detection abstract operations 2022-11-15 21:48:19 +00:00
Idan Horowitz
798d7c6fae LibWeb: Add 'should block pop ups' user config to Page
This will also be used by the window.open algorithm steps.
2022-11-15 21:48:19 +00:00
Idan Horowitz
ff2f31bc81 LibWeb: Bring BrowsingContext::choose_a_browsing_context closer to spec 2022-11-15 21:48:19 +00:00
Idan Horowitz
c948873c5b LibWeb: Add the 'opener browsing context' BrowsingContext property
This will also be used by the window.open algorithm steps.
2022-11-15 21:48:19 +00:00
Idan Horowitz
b27f855107 LibWeb: Add the 'is popup' BrowsingContext property
This will also be used by the window.open algorithm steps.
2022-11-15 21:48:19 +00:00