Age | Commit message (Collapse) | Author |
|
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.
|
|
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.
|
|
This was pleasantly trivial to implement with the new support for
presentational hints. :^)
|
|
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.
|
|
|
|
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.
|
|
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.)
|
|
|
|
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().
|
|
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.
|
|
Inline layout now happens in the containing block, specifically in
LayoutBlock::layout_inline_children().
|
|
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. :^)
|
|
LibHTML can't handle block children of inline elements just yet.
|
|
I don't know why I made this say "COLOR: #rrggbbaa" when it can also
just say "#rrggbbaa" :^)
|
|
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.
|
|
Collapse whitespace at the start of a line so we don't end up with
" foo bar" :^)
|
|
Also remove some debug spam.
|
|
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.
|
|
|
|
|
|
This fixes the issue where you couldn't click on links at the bottom of
scrollable documents. :^)
|
|
A handy helper function for converting a widget space coordinate into a
content space coordinate.
|
|
The selection is no longer managed by the model.
|
|
And write section 3 man pages for them.
|
|
We can now parse links that like this:
visit the [SerenityOS home page](http://www.serenityos.org/)
producing proper <a> HTML elements ^)
|
|
|
|
Thumbnail generation callbacks were getting called after the class was already being destroyed causing a crash to occur.
|
|
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.
|
|
|
|
|
|
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.
|
|
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".
|
|
We currently assume the border-style is solid, and simply draw a box
around the padded LayoutNode rect. :^)
|
|
|
|
|
|
|
|
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.
|
|
You can now style elements with inline styles:
<div style="color: #ff0000">This is red!</div>
Pretty neat :^)
|
|
Also added a parser function for standalone style declarations.
|
|
A StyleRule has a StyleDeclaration which has many StyleProperty. :^)
|
|
We no longer support creating CObjects on the stack. Use construct().
|
|
We had two ways to get the data inside a ByteBuffer. That was silly.
|
|
We can't rely on libstdc++ inside LibC or LibM, since these libraries
are part of the Toolchain bringup build.
|
|
Patch from Anonymous.
|
|
Patch from Anonymous.
|
|
Patch from Anonymous.
|
|
This also becomes the app icon for the little "html" program. :^)
|
|
It needed some updating to the new ref-counted CObject ways.
|
|
|
|
|