Commit graph

4464 commits

Author SHA1 Message Date
Andreas Kling 3d4ed7f38d Kernel: mmap() with both MAP_PRIVATE and MAP_SHARED is an error 2019-10-01 19:31:55 +02:00
Andreas Kling c58d1868cb Kernel: Fix munmap() bad splitting of already-split Regions
When splitting an Region that's already the result of an earlier split,
we have to take the Region's offset-in-VMObject into account since it
may be non-zero.
2019-10-01 11:40:40 +02:00
Andreas Kling 4bfd4dc6c7 AK: Remove empty files JsonArray.cpp and JsonObject.cpp 2019-10-01 11:24:54 +02:00
Brandon Scott 08a1fb8f1a LibGUI+PaintBrush: Fix to GFilePicker and PaintBrush enhancements.
GFilePicker
- Fixed GFilePicker to use new ref-counted construct method to stop crashing on open dialog.
  - PaintBrush is still crashing on open dialog due to an unrelated issue.

PaintBrush
- Created 16x16 icon for PaintBrush
- Moved Open option into App menu.
- Changed help menu to make use of the standardized About dialog.
2019-10-01 09:17:56 +02:00
Larkin Nickle 3fb88cb76d Help+man.md: Add man sections
Also correct minor formatting mistake in TelnetServer.md.
2019-09-30 21:38:39 +02:00
Larkin Nickle e7c2467231 Add TelnetServer man page 2019-09-30 21:38:39 +02:00
Andreas Kling a5e5a3fab7 LibHTML: Implement basic support for inline style attributes
You can now style elements with inline styles:

    <div style="color: #ff0000">This is red!</div>

Pretty neat :^)
2019-09-30 20:25:33 +02:00
Andreas Kling b2a0d20580 LibHTML: Refactor the CSS parser into a class
Also added a parser function for standalone style declarations.
2019-09-30 20:24:38 +02:00
Andreas Kling 8d797fc62e LibHTML: Fix incorrect CSS object model
A StyleRule has a StyleDeclaration which has many StyleProperty. :^)
2019-09-30 20:06:17 +02:00
Andreas Kling ac20919b13 Kernel: Make it possible to turn off VM guard pages at compile time
This might be useful for debugging since guard pages introduce a fair
amount of noise in the virtual address space.
2019-09-30 17:22:16 +02:00
Andreas Kling 1a279c5b2a GMessageBox: Hide the constructor and fix broken usages
We no longer support creating CObjects on the stack. Use construct().
2019-09-30 17:20:53 +02:00
Andreas Kling c5e057438c MBVGADevice: Log address/pitch/width/height when created 2019-09-30 15:04:16 +02:00
Andreas Kling 8e775d241e Kernel: Make DiskBackedFS flush writes if cache is completely dirty
If we want to make a new entry in the disk cache when it's completely
full of dirty blocks, we'll now synchronously flush the writes at that
point. Maybe it's not ideal, but at least we can keep going.
2019-09-30 11:46:56 +02:00
Andreas Kling 922fd703c9 Kernel: Convert the DiskBackedFS write API to take "const u8*"
This way clients are not required to have instantiated ByteBuffers
and can choose whatever memory scheme works best for them.

Also converted some of the Ext2FS code to use stack buffers instead.
2019-09-30 11:23:36 +02:00
Andreas Kling 1fc2612667 Kernel: Make DiskBackedFS::read_block() write to client-provided memory
Instead of having DiskBackedFS allocate a ByteBuffer, leave it to each
client to provide buffer space.

This is significantly faster in many cases where we can use a stack
buffer and avoid heap allocation entirely.
2019-09-30 11:04:30 +02:00
Andreas Kling a61f6ccc27 Kernel: Implement a simpler, bigger cache for DiskBackedFS
The hashmap cache was ridiculously slow and hurt us more than it helped
us. This patch replaces it with a flat memory cache that keeps up to
10'000 blocks in cache with a simple dirty bit.

The syncd task will wake up periodically and call flush_writes() on all
file systems, which now causes us to traverse the cache and write all
dirty blocks to disk.

There's a ton of room for improvement here, but this itself is already
drastically better when doing repeated GCC invocations.
2019-09-30 10:34:50 +02:00
Andreas Kling 8f45a259fc ByteBuffer: Remove pointer() in favor of data()
We had two ways to get the data inside a ByteBuffer. That was silly.
2019-09-30 08:57:01 +02:00
Andreas Kling dd696e7c75 LibM: Fix Toolchain build
We can't rely on libstdc++ inside LibC or LibM, since these libraries
are part of the Toolchain bringup build.
2019-09-29 22:07:02 +02:00
Andreas Kling 941981ec4f LibM: Implement various trig functions
Patch from Anonymous.
2019-09-29 21:04:08 +02:00
Andreas Kling 3ebfa9f044 LibDraw: Some build fixes for strange platforms
Patch from Anonymous.
2019-09-29 21:02:49 +02:00
Andreas Kling 6d7854919a LibC: Some build fixes for strange platforms
Patch from Anonymous.
2019-09-29 21:02:13 +02:00
Andreas Kling 3900eebf15 FileManager+LibGUI+html: Add an icon to represent HTML files
This also becomes the app icon for the little "html" program. :^)
2019-09-29 21:00:41 +02:00
Andreas Kling e38b454e11 LibGUI: Fix crash in GAboutDialog::show()
It needed some updating to the new ref-counted CObject ways.
2019-09-29 20:37:02 +02:00
Andreas Kling 61bc597b2d Demos: Remove useless PaintTest program 2019-09-29 19:54:30 +02:00
Andreas Kling c9bab8b870 LibHTML: Reduce debug spam in HtmlView mouse event handlers 2019-09-29 18:10:39 +02:00
Andreas Kling 17c06d7c9a Base: Move HTML test pages into /home/anon/html
Also add a simple test page for inline style sheets.
2019-09-29 18:07:36 +02:00
Andreas Kling 37a37accd4 LibHTML: Implement basic support for background-color 2019-09-29 18:05:37 +02:00
Andreas Kling a4fccc02ec LibHTML: Add a simple <style> element for inline CSS 2019-09-29 17:45:42 +02:00
Andreas Kling 7912592f89 LibHTML: Add inserted_into() and removed_from() TreeNode callbacks
These will be called when a Node or LayoutNode is inserted or removed
from a tree. They get the parent node as an argument.
2019-09-29 17:40:39 +02:00
Andreas Kling 402c6de5c9 LibHTML: Make <div> elements display: block 2019-09-29 17:26:52 +02:00
Andreas Kling 830e18e486 LibHTML: Fix broken parsing of ID and class selectors
We were forgetting to consume the '#' and '.' characters.
2019-09-29 17:26:05 +02:00
Andreas Kling ed39e0f6f7 LibHTML: Non-element (Text) Nodes should get style from their parent
Text nodes don't have style of their own, so just inherit all the style
from the parent element.
2019-09-29 17:22:44 +02:00
Andreas Kling 8d822ff82b html: Set the window title based on the HTML document's title
If the loaded document has a <title>, we now show that in the app's
window title bar! :^)
2019-09-29 16:26:28 +02:00
Andreas Kling b94c7665a9 LibHTML: Add a way to get a Document's title
You can now query Document::title() to get a String containing whatever
is inside the document's <title> tag.

In support of this, this patch adds the <html>, <head> and <title>
elements.
2019-09-29 16:24:57 +02:00
Andreas Kling 0c6af2d5b4 LibHTML: Add Node::text_content()
This returns a String built from all of a Node's text descendants,
including itself.
2019-09-29 16:23:09 +02:00
Andreas Kling 93230386f7 Build: Add Libraries/LibHTML/ to the library search paths
This makes my hacky incremental rebuild commands work for LibHTML.
2019-09-29 16:20:54 +02:00
Andreas Kling 99fc7033b5 AK: Add StringBuilder::length() and trim(int)
Sometimes you want to trim a byte or two off the end.
2019-09-29 16:20:09 +02:00
Andreas Kling b5c587a106 Base: Add some title attributes to the small HTML test file :^) 2019-09-29 12:26:15 +02:00
Andreas Kling 5b942b519c LibHTML: Add HTMLHeadingElement for <h1> through <h6> 2019-09-29 12:26:15 +02:00
Andreas Kling f38b0f667e LibHTML: Implement basic HTMLElement.title support
We now show a tooltip for the hovered node's enclosing HTML element's
title attribute, if one is present.

This patch also adds HTMLHeadingElement. The tags h1-h6 will now create
the right kind of objects.
2019-09-29 12:26:13 +02:00
Andreas Kling 92aae72025 LibHTML: Detect link clicks
Clicking on a link in an HtmlView will now call on_link_click(String)
if present, allowing you to implement basic hypertext navigation. :^)
2019-09-29 12:04:02 +02:00
Andreas Kling b477aff843 LibHTML: Detect hovering over links
HtmlView now calls Node::enclosing_link_element() to find the nearest
ancestor <a> element.

This patch also adds HTMLElement and HTMLAnchorElement.
2019-09-29 11:59:38 +02:00
Andreas Kling 88de955073 LibHTML: Have Document track its hovered Node
This gets set from HtmlView::mousemove_event() at the moment.
2019-09-29 11:50:35 +02:00
Andreas Kling 754e6e0f67 LibHTML: Add LayoutNode::document() for easy access
Every LayoutNode indirectly belongs to some Document. For anonymous
LayoutNodes, we simply traverse the parent chain until we find someone
with a Node from which we can get a Document&.
2019-09-29 11:43:33 +02:00
Andreas Kling 1b8509a0c9 LibHTML: Make sure every DOM Node belongs to a Document 2019-09-29 11:43:07 +02:00
Andreas Kling 13860e4dd8 LibHTML: Make hit testing work for LayoutText
LayoutText can't simply rely on its LayoutNode::rect() for hit testing.
Instead, we have to iterate over the individual runs and see if we're
hitting any of them.

Also, LayoutNode::hit_test() now always recurses into children, since
we can't trust the rect() to tell the truth (inline rects are wrong.)
2019-09-29 11:32:00 +02:00
Brandon Scott aac8b091a4 LibDraw: Implemented support for more PNG formats (#614)
- Implemented support for more PNG formats including 16-bit per channel
  and 8-bit indexed with palette.
- Made the library a little more resistant to crashes by returning
  false for known but unsupported formats.
2019-09-29 09:55:28 +02:00
Andreas Kling dba74abe93 Base: Fix minor typos in man pages 2019-09-28 23:06:22 +02:00
Andreas Kling 3de4b99dc3 LibHTML: Implement naive hit testing
We don't have proper line boxes yet, so we can't easily hit test
inline text.
2019-09-28 23:04:59 +02:00
Andreas Kling 3ed41abba4 Base: Add a little hyperlink to the small HTML test page
This will be useful for testing rendering, hit testing, etc.
2019-09-28 23:00:47 +02:00