Commit graph

10821 commits

Author SHA1 Message Date
Tom fb41d89384 Kernel: Implement software context switching and Processor structure
Moving certain globals into a new Processor structure for
each CPU allows us to eventually run an instance of the
scheduler on each CPU.
2020-07-01 12:07:01 +02:00
Tom 10407061d2 PATA: Avoid double-preparing for irq 2020-07-01 12:07:01 +02:00
Tom 3ac6d31b45 Kernel: Serialize debug output 2020-07-01 12:07:01 +02:00
Jack Karamanian 1da7fea602 js: Highlight Extends and Super tokens 2020-07-01 11:18:44 +02:00
Jack Karamanian 4dcdad4cc4 LibGUI: Highlight JS Extends and Super tokens 2020-07-01 11:18:44 +02:00
AnotherTest 7b72001667 Inspector: Expand and show properties in a TreeView
This allows the inspector to show arbitrary json structures.
2020-07-01 11:18:19 +02:00
AnotherTest 476ccb2206 LibGUI: Do not recurse into rows with invalid indices
That would cause the traversal to go into an infinite loop.
2020-07-01 11:18:19 +02:00
Matthew Olsson bda39ef7ab LibJS: Explicitly pass a "Function& new_target" to Function::construct
This allows the proxy handler to pass the proper new.target to construct
handlers.
2020-07-01 11:16:37 +02:00
Matthew Olsson 19411e22d0 LibJS: Add Proxy [[Call]] and [[Construct]] tests 2020-07-01 11:16:37 +02:00
Matthew Olsson 98323e19e5 LibJS: Implement Proxy [[Call]] and [[Construct]] traps
In order to do this, Proxy now extends Function rather than Object, and
whether or not it returns true for is_function() depends on it's
m_target.
2020-07-01 11:16:37 +02:00
Andreas Kling ed683663cd LibJS: Skip some Math object tests that fail on Serenity
Mark a bunch of these with FIXME so that someone can find them and
fix them eventually. :^)
2020-06-30 23:11:07 +02:00
Andreas Kling dfc0a35295 Base: Tweak resource graph colors to match SystemMonitor 2020-06-30 23:11:07 +02:00
Linus Groh 1cffa28f95 Browser: Unset location bar icon on load start
This avoids having a stale icon from a previous page load in the
location box if a subsequently visited page doesn't trigger an icon
change.
2020-06-30 23:11:01 +02:00
Andreas Kling 14477eb565 Terminal: Bump the default ScrollLength to 4
This feels so much better than scrolling one line at a time. :^)
2020-06-30 18:33:09 +02:00
Benoît Lormeau 310fbe48e5 LibVT/Terminal: add a scroll length to the TerminalWidget
The scroll length is the number of lines by which the terminal will go
up/down when scrolling the mouse wheel once.
2020-06-30 18:24:00 +02:00
AnotherTest f20becf71b LibLine: Correctly display suggestions on multiline prompts 2020-06-30 18:21:44 +02:00
Sahan Fernando 0fc8931d5f Userland: Add watch tool 2020-06-30 12:46:23 +02:00
Linus Groh 2e183e3292 LibGUI: Update FilePicker location textbox when changing directory
Fixes #2662.
2020-06-30 12:20:18 +02:00
Linus Groh 5acc457c06 LibGUI: Only show FilePicker preview pane on demand
FilePicker::set_preview() and FilePicker::clear_preview() now show and
hide the preview pane respectively.
2020-06-30 10:43:46 +02:00
Linus Groh 6b61d4656f LibGUI: Tweak FilePicker layout to remove bottom padding
This makes the "Cancel" and "Open" buttons align with the right sidebar's
bottom edge.
2020-06-30 10:26:11 +02:00
Andreas Kling 167da1fa84 Browser: Show website favicons in the location bar :^) 2020-06-29 20:35:53 +02:00
Andreas Kling b8a50e9d89 FileManager: Show a folder icon in the location text box :^) 2020-06-29 20:35:39 +02:00
Andreas Kling f50bc0f314 LibGUI: Add TextEditor::set_icon()
You can now set a 16x16 icon on a single-line TextEditor. If present,
the icon will be painted to the left of the text content.
2020-06-29 20:34:42 +02:00
Jack Karamanian 7533fd8b02 LibJS: Initial class implementation; allow super expressions in object
literal methods; add EnvrionmentRecord fields and methods to
LexicalEnvironment

Adding EnvrionmentRecord's fields and methods lets us throw an exception
when |this| is not initialized, which occurs when the super constructor
in a derived class has not yet been called, or when |this| has already
been initialized (the super constructor was already called).
2020-06-29 17:54:54 +02:00
Jack Karamanian a535d58cac LibJS: Add Object::define_accessor()
This is a helper function based on the getter/setter definition logic from
ObjectExpression::execute() to look up an Accessor property if it already
exists, define a new Accessor property if it doesn't exist, and set the getter or
setter function on the Accessor.
2020-06-29 17:54:54 +02:00
Jack Karamanian 949bffdc93 LibJS: Define the "constructor" property on ScriptFunction's prototype
and set it to the current function
2020-06-29 17:54:54 +02:00
Peter Elliott f833362536 WindowServer: don't send resize on resolution change unless needed
fixes #2575

The extra ResizeEvent would be handled after on_rect_change, and would
reset the size of main_widget to what it was before the resize.

Bonus: Less unnecessary events.
2020-06-29 16:50:40 +02:00
Benoît Lormeau 951a429268 LibGUI: SpinBox: update the displayed value when set_range() clamps it
Consider the following: upon instanciation of a GUI::SpinBox, its
internal value and displayed value are both 0. When calling `set_min(1)`
on it (same as `set_range(1, max())`), the internal value gets clamped
to 1 correctly, but "0" is still displayed by the widget.

The displayed value is now updated accordingly to the internal value
when it gets clamped.
2020-06-29 14:57:36 +02:00
Maciej Zygmanowski 48cd26f12d LibKeyboard: Don't crash when file is empty
Just return empty map, like when file error occurs.
2020-06-29 13:27:13 +02:00
Andreas Kling 53573f6fb1 LibWeb: Clamp text fragment selection to the fragment
Also add 1px of width to partial fragment selections, since that ends
up looking nicer during interactive mouse selection.
2020-06-29 12:47:21 +02:00
Nico Weber 12cbc4ad0d Everywhere: Replace some uses of fork/exec with posix_spawn
It's less code, and it's potentially more efficient once
posix_spawn is a real syscall.
2020-06-29 12:04:27 +02:00
Andreas Kling 301ac3c7e5 LibWeb: Improve hit testing on the right of line boxes
We now remember the last candidate fragment when hit testing past the
right end of text and use that as the fallback result if nothing else
matches. This makes it possible to drag-select outside the line boxes
in a way that feels mostly natural. :^)
2020-06-29 00:39:51 +02:00
Andreas Kling 9177eea8fe LibWeb: Add LayoutRange::normalized()
We use this to ensure that we're always working with a selection where
the start() is before the end() in document order. That simplifies all
the logic around this.
2020-06-29 00:39:51 +02:00
Andreas Kling 706fc3d1aa LibWeb: Paint the text selection :^)
Text selection currently works at the LayoutNode level. The root of the
layout tree has a LayoutRange selection() which in turn has two
LayoutPosition objects: start() and end().

A LayoutPosition is a LayoutNode + a text offset into that node.

We handle the selection painting in LayoutText::paint_fragment(), after
the normal painting is finished. The basic mechanism is that each
LayoutFragment is queried for its selection_rect(), and if a non-empty
rect is returned, we clip to it and paint the text once more.
2020-06-29 00:39:51 +02:00
Andreas Kling 2762e3d80a LibWeb: Rename LineBoxFragment::render() => paint()
Also LayoutText::render_fragment() => render(). This matches the names
in the rest of LibWeb.
2020-06-28 23:07:44 +02:00
Andreas Kling b2a7943b4e LibX86: Disassemble the XADD instruction
This makes functrace usable again :^)
2020-06-28 21:10:53 +02:00
Andreas Kling dcc25f7d7a LibWeb: Layout table-cell contents once again once final width is known
This makes centered and right-aligned table-cell contents position
itself correctly.
2020-06-28 20:54:45 +02:00
devashish 4924b86b2a LibGfx+JPGLoader: Print failure message for progressive JPEGs 2020-06-28 16:56:59 +02:00
Luke 2df69317f1 LibWeb: Implement almost all missing tokenizer cases 2020-06-28 16:56:26 +02:00
Andreas Kling f270f1f274 LibWeb: Give the <blockquote> element some margins in the UA style 2020-06-28 15:26:05 +02:00
Andreas Kling 7d3c8d066f LibWeb: Support "pt" length units :^) 2020-06-28 15:25:32 +02:00
Andreas Kling 7fc988b919 LibWeb: Start working on supporting fixed table layouts
Sometimes people make tables with a specific width. In those cases,
we can't just use the auto-sizing algorithm, but instead have to
respect whatever width the content specifies.

This is a bit rickety right now, since we don't implement generation
of anonymous table boxes.

The basic mechanism here is that block layout (which table-cell uses)
now has a virtual way of asking for the width of the logical containing
block. This is necessary as table-row does not produce a block-level
element and so was previously unable to provide a containing block
width for table-cell layout.

If the table has a non-auto specified width, we now interpret that as
a request to use fixed table layout. This will evolve over time. :^)
2020-06-28 15:13:56 +02:00
Andreas Kling daa88448e1 LibWeb: Add Length::is_undefined_or_auto()
Quite often, we want the same behavior in both cases. This allows us
to express that with a single method.
2020-06-28 15:08:37 +02:00
sppmacd abdf36b171 SystemMenu: Fix shutdown dialog
It was shutting down even if selected Restart.
2020-06-28 14:32:17 +02:00
Andreas Kling b8dc1fc195 LibWeb: Turn <td width> into a CSS width property 2020-06-28 14:30:37 +02:00
Andreas Kling 38d6cc8598 LibWeb: Convert uppercase selector tag names to lowercase internally
This is necessary for some older content to work correctly. There's
probably a nicer (and correct-er) way to do this. Deferring to the
new CSS parser.
2020-06-28 12:58:04 +02:00
Andreas Kling fd32f24753 LibWeb: Tweak default style for <hr> to use em units for margin values 2020-06-28 12:57:42 +02:00
Andreas Kling 9e642827fc LibWeb: Don't tolerate unit-less lengths (except 0) in standards mode
"width: 500" is not a valid CSS property in standards mode and should
be ignored.

To plumb the quirks-mode flag into CSS parsing, this patch adds a new
CSS::ParsingContext object that must be passed to the CSS parser.
Currently it only allows you to check the quirks-mode flag. In the
future it will be a good place to put additional information needed
for things like relative URL resolution, etc.

This narrows <div class=parser> on ACID2 to the correct width. :^)
2020-06-28 12:46:40 +02:00
Andreas Kling c1acf67715 LibWeb: Use length units and shorthands in the default UA style sheet 2020-06-28 12:12:01 +02:00
Andreas Kling 9576f6b1d4 LibWeb: Collapse top and bottom margin of empty sibling blocks
Margin collapsing is a bit confusing, but if I understand correctly,
when collapsing a box's top margin with the vertically adjacent
sibling box above, we should "skip over" empty (0-height) boxes and
collapse their margin with *their* vertically adjacent sibling box
above, etc. Iterating until we hit the first non-empty in-flow block.

This pulls up the bottom part of the face on ACID2. :^)
2020-06-28 11:20:15 +02:00