summaryrefslogtreecommitdiff
path: root/Libraries
AgeCommit message (Collapse)Author
2019-10-05LibHTML: Make StyleResolver responsible for loading the default styleAndreas Kling
Instead of HtmlView clients having to worry about parsing and loading the default CSS, just take care of it inside StyleResolver. The default style is automatically inserted into the stylesheet list, at the very start, so everyone else gets a chance to override it.
2019-10-04LibHTML: Make CSS inheritance slightly less hackyAndreas Kling
Add a simple is_inherited_property(name) lookup function and use that to implement CSS property inheritance. It's a bug that "text-decoration" is inherited, but we currently rely on this in order to propagate e.g underline into linkified line boxes.
2019-10-04LibHTML: Add support for <font color>Andreas Kling
This was pleasantly trivial to implement with the new support for presentational hints. :^)
2019-10-04LibHTML: Add support for <body bgcolor="#rrggbb" text="#rrggbb">Andreas Kling
This patch implements basic support for presentational hints, which are old-school HTML attributes that affect style. You add support for a presentational hint attribute by overriding Element::apply_presentational_hints(StyleProperties&) and setting all of the corresponding CSS properties as appropriate. To make the background color fill the entire document, not just the bounds of the <body> element's LayoutNode, we special-case it in the HtmlView::paint_event() code for now. I'm not entirely sure what the nicest solution would be, but I'm sure we'll discover it eventually.
2019-10-04LibHTML: Rename LayoutNode::style_properties() to LayoutNode::style()Andreas Kling
2019-10-04LibHTML: Rename ComputedStyle to BoxModelMetricsAndreas Kling
There was nothing left in ComputedStyle except the box model metrics, so this patch gives it a more representative name. Note that style information is fetched directly from StyleProperties, which is basically the CSS property name/value pairs that apply to an element.
2019-10-04LibHTML: Add a Frame class and use it for document layout widthAndreas Kling
Each HtmlView now has a main_frame(), which represents the main frame of the web page. Frame inherits from TreeNode<Frame>, which will allow us to someday implement a Frame tree (to support the <frame> element.)
2019-10-04LibHTML: Remove unused FontStyle enumAndreas Kling
2019-10-04LibHTML: LayoutText should always use parent's style propertiesAndreas Kling
This patch makes StyleProperties heap-allocated and ref-counted so that a LayoutNode can be without one. The ref-counting also allows anonymous blocks to share style with their parent block. LayoutText never needs a StyleProperties, since text always inherits style from its parent element. This is handled by style_properties().
2019-10-04LibC: unistd.h should provide SEEK_SET etc. if stdio.h is not included (#629)Vincent Sanders
Seems POSIX is odd and unistd also defines SEEK_SET if stdio.h This simply follows the pattern several other C libraries take of setting these macros to the same values in stdio if that header is not included.
2019-10-03LibHTML: Remove unused LayoutInline::layout()Andreas Kling
Inline layout now happens in the containing block, specifically in LayoutBlock::layout_inline_children().
2019-10-03LibHTML: Make "white-space: pre" kinda workAndreas Kling
This is not ideal, as refusing to break lines will easily overflow the containing block, and we have no way of dealing with overflow yet. But as long as you provide enough width, it does look nice. :^)
2019-10-03LibMarkdown: Avoid emitting <pre> tags for now, to help LibHTMLAndreas Kling
LibHTML can't handle block children of inline elements just yet.
2019-10-03LibHTML: Prettify ColorStyleValue::to_string() a little bitAndreas Kling
I don't know why I made this say "COLOR: #rrggbbaa" when it can also just say "#rrggbbaa" :^)
2019-10-03LibHTML: Forgot to account for -1 glyph spacing in text layoutAndreas Kling
Font::width(string) will subtract one Font::glyph_spacing() from the result, since we don't put any spacing after the last glyph. This was messing up text layout here, since we assumed each glyph width also included the glyph spacing.
2019-10-03LibHTML: Don't add whitespace line box fragments at start of lineAndreas Kling
Collapse whitespace at the start of a line so we don't end up with " foo bar" :^)
2019-10-03LibHTML: Tweak "text-decoration: underline" look in LayoutTextAndreas Kling
Also remove some debug spam.
2019-10-03LibHTML: Rewrite inline and text layoutAndreas Kling
Inline layout is now done by LayoutBlock. Blocks with inline children will split them into line boxes during layout. A LayoutBlock can have zero or more LineBox objects. Each LineBox represents one visual line. A LineBox can have any number of LineBoxFragment children. A fragment is an offset+length into a specific LayoutNode. To paint a LayoutBlock with inline children, we walk its line boxes, and walk their fragments, painting each fragment at a time by calling LineBoxFragment::render(), which in turn calls the LayoutNode via LayoutText::render_fragment(). Hit testing works similarly. This is very incomplete and has many bugs, but should make it easier for us to move forward with this code.
2019-10-03LibHTML: Reduce debug spam from mouse eventsAndreas Kling
2019-10-03LibHTML: Let's put debug output on the debugger streamAndreas Kling
2019-10-03LibHTML: Adjust mouse event positions before using them for hit testingAndreas Kling
This fixes the issue where you couldn't click on links at the bottom of scrollable documents. :^)
2019-10-03GScrollableWidget: Add to_content_position(Point)Andreas Kling
A handy helper function for converting a widget space coordinate into a content space coordinate.
2019-10-03LibGUI: Remove GModel::on_selection_changedSergey Bugaev
The selection is no longer managed by the model.
2019-10-03LibC: Implement dirname() and basename()Sergey Bugaev
And write section 3 man pages for them.
2019-10-03LibMarkdown: Implement link supportSergey Bugaev
We can now parse links that like this: visit the [SerenityOS home page](http://www.serenityos.org/) producing proper <a> HTML elements ^)
2019-10-03LibC: Misc additionsSergey Bugaev
2019-10-03LibGUI: Fix GDirectoryModel lifetime bug.Brandon Scott
Thumbnail generation callbacks were getting called after the class was already being destroyed causing a crash to occur.
2019-10-02LibGUI: Add GLazyWidget, a convenience widget for lazily-built UI'sAndreas Kling
Here's how you can use this to speed up startup time: auto widget = GLazyWidget::construct(); widget->on_first_show = [](auto& self) { self.set_layout(...); ... }; Basically, it allows you to delay building the widget subtree until it's shown for the first time.
2019-10-02GWidget: Dispatch Show and Hide events when widget visibility changesAndreas Kling
2019-10-02Kernel: Add SIOCGIFHWADDR ioctl to get the MAC address of an adapterAndreas Kling
2019-10-02Kernel+SystemMonitor: Add fault countersAndreas Kling
This patch adds three separate per-process fault counters: - Inode faults An inode fault happens when we've memory-mapped a file from disk and we end up having to load 1 page (4KB) of the file into memory. - Zero faults Memory returned by mmap() is lazily zeroed out. Every time we have to zero out 1 page, we count a zero fault. - CoW faults VM objects can be shared by multiple mappings that make their own unique copy iff they want to modify it. The typical reason here is memory shared between a parent and child process.
2019-10-01LibHTML: Implement the <hr> elementAndreas Kling
This also meant I had to implement basic support for the border-styles "inset" and "outset". If it's neither of those, we default to "solid".
2019-10-01LibHTML: Implement basic border renderingAndreas Kling
We currently assume the border-style is solid, and simply draw a box around the padded LayoutNode rect. :^)
2019-10-01LibHTML: Include padding when rendering background colorsAndreas Kling
2019-10-01LibHTML: Tweak default CSS to bring it a bit closer to HTML4Andreas Kling
2019-10-01AK: Remove empty files JsonArray.cpp and JsonObject.cppAndreas Kling
2019-10-01LibGUI+PaintBrush: Fix to GFilePicker and PaintBrush enhancements.Brandon Scott
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-09-30LibHTML: Implement basic support for inline style attributesAndreas Kling
You can now style elements with inline styles: <div style="color: #ff0000">This is red!</div> Pretty neat :^)
2019-09-30LibHTML: Refactor the CSS parser into a classAndreas Kling
Also added a parser function for standalone style declarations.
2019-09-30LibHTML: Fix incorrect CSS object modelAndreas Kling
A StyleRule has a StyleDeclaration which has many StyleProperty. :^)
2019-09-30GMessageBox: Hide the constructor and fix broken usagesAndreas Kling
We no longer support creating CObjects on the stack. Use construct().
2019-09-30ByteBuffer: Remove pointer() in favor of data()Andreas Kling
We had two ways to get the data inside a ByteBuffer. That was silly.
2019-09-29LibM: Fix Toolchain buildAndreas Kling
We can't rely on libstdc++ inside LibC or LibM, since these libraries are part of the Toolchain bringup build.
2019-09-29LibM: Implement various trig functionsAndreas Kling
Patch from Anonymous.
2019-09-29LibDraw: Some build fixes for strange platformsAndreas Kling
Patch from Anonymous.
2019-09-29LibC: Some build fixes for strange platformsAndreas Kling
Patch from Anonymous.
2019-09-29FileManager+LibGUI+html: Add an icon to represent HTML filesAndreas Kling
This also becomes the app icon for the little "html" program. :^)
2019-09-29LibGUI: Fix crash in GAboutDialog::show()Andreas Kling
It needed some updating to the new ref-counted CObject ways.
2019-09-29LibHTML: Reduce debug spam in HtmlView mouse event handlersAndreas Kling
2019-09-29LibHTML: Implement basic support for background-colorAndreas Kling