Andreas Kling
8271ad40a5
LibHTML: Implement basic support for "text-decoration: underline"
2019-09-28 22:57:46 +02:00
Andreas Kling
62cbaa74f3
LibHTML: Respect the CSS "color" property for text
...
Also remove the color values from the ComputedStyle object and get them
via StyleProperties instead.
At the moment, we only handle colors that Color::from_string() parses.
2019-09-28 22:57:46 +02:00
Andreas Kling
83f643d43c
LibHTML: Make h1 and h2 tags use Pebbleton Bold by default :^)
2019-09-28 19:14:36 +02:00
Sergey Bugaev
6ec625d6f3
Userland+LibHTML: Add the html command
...
This is a simple command that can be used to display HTML from a given
file, or from the standard input, in an HtmlView. It replaces the `tho`
(test HTML output) command.
2019-09-28 18:29:42 +02:00
Sergey Bugaev
b9493ba783
LibHTML: Introduce the HtmlView widget
...
This is a GWidget that can display contents of an HTML document.
It replaces the Frame class.
2019-09-28 18:29:42 +02:00
Sergey Bugaev
8a2beaf52b
LibHTML: Tweak the default CSS style
2019-09-28 18:29:42 +02:00
Sergey Bugaev
db8a1a6aba
LibHTML: Parse HTML escape sequences
2019-09-28 18:29:42 +02:00
Sergey Bugaev
6491493e26
LibHTML: Hide debugging output unless HTML_DEBUG is defined
2019-09-28 18:29:42 +02:00
Sergey Bugaev
235dee8c42
LibHTML: Implement rendering
2019-09-28 18:29:42 +02:00
Sergey Bugaev
93003bfda1
LibHTML: Implement LayoutText
2019-09-28 18:29:42 +02:00
Sergey Bugaev
9f8d776c70
LibHTML: Implement LayoutInline::layout()
...
This currently uses a gross hack where it subtracts 11px from the
previous sibling bottom to calculate its top. This should be fixed
by switching to a proper two-phase line layouting model, were we
first distribute inline elements into lines and figure out their
horizontal positions and heights; then compute the needed line
heights and position inline elements there vertically.
2019-09-28 18:29:42 +02:00
Sergey Bugaev
03cca4510a
LibHTML: Fix LayoutDocument height computation
2019-09-28 18:29:42 +02:00
Sergey Bugaev
fa876320eb
LibHTML: Fix LayoutBlock vertical position & height computations
2019-09-28 18:29:42 +02:00
Sergey Bugaev
c1ef63379c
LibHTML: Add Document::normalize()
...
This method wraps the document tree in <html> and <body> elements if needed.
2019-09-28 18:29:42 +02:00
Sergey Bugaev
599edba7a3
LibHTML: Move layout tree building to Node
...
This also fixes another bug with inline wrappers. Namely,
we should only add inline wrappers if a block node has
both non-block (inline or text) and block children.
2019-09-28 18:29:42 +02:00
Sergey Bugaev
841ae44392
LibHTML: Implement basic style inheritance
2019-09-28 18:29:42 +02:00
Sergey Bugaev
3be897a3d5
LibHTML: Add ComputedStyle::full_margin()
...
This is an utility to easily get the full margin size
(the sum of margin proper, border and padding) of an
element in pixels.
2019-09-28 18:29:42 +02:00
Sergey Bugaev
a42f4c078e
LibHTML: Get rid of ComputedStyle::offset()
...
This is redundant since we already have LayoutNode::rect().
2019-09-28 18:29:42 +02:00
Sergey Bugaev
756bdb2a42
LibHTML: Fix moving inline elements to unrelated block elements
...
LayoutBlock::inline_wrapper() is supposed to return an inline wrapper,
a special anonymous block element intended to wrap inline children of
a block element that also has block children. Add a check for whether
the existing block child element is anonymous (refers to a DOM node),
and if it's not create a new anonymous wrapper.
2019-09-28 18:29:42 +02:00
Sergey Bugaev
08c751d130
LibHTML: Add StyleProperties::string_or_fallback()
...
This is an utility to go with the existing length_or_fallback().
2019-09-28 18:29:42 +02:00
Sergey Bugaev
fd0aa5dd43
LibHTML: Get rid of the style tree
...
We now create a layout tree directly from the DOM tree.
This way we don't actually lose text nodes ^)
2019-09-28 18:29:42 +02:00
Sergey Bugaev
a9ebd676e5
LibHTML: Add install.sh
2019-09-28 18:29:42 +02:00
Andreas Kling
8d550c174e
LibCore: Convert CFile to ObjectPtr
2019-09-21 20:50:06 +02:00
Andreas Kling
73fdbba59c
AK: Rename <AK/AKString.h> to <AK/String.h>
...
This was a workaround to be able to build on case-insensitive file
systems where it might get confused about <string.h> vs <String.h>.
Let's just not support building that way, so String.h can have an
objectively nicer name. :^)
2019-09-06 15:36:54 +02:00
Andreas Kling
fc43cf929d
LibHTML: Implement basic block height computation
...
..and add vertical box properties to the layout tree dumps.
2019-08-18 08:39:52 +02:00
Andreas Kling
70eca3b500
LibHTML: Finish the block width calculation
...
Also add horizontal box values to the layout tree dump.
2019-08-18 08:39:52 +02:00
Andreas Kling
587ddc5126
LibHTML: Fix host build and turn on ccache
2019-08-18 08:39:52 +02:00
Andreas Kling
38c80d5e6d
LibHTML: Make some use of Vector::empend().
2019-08-01 16:50:15 +02:00
Andreas Kling
e423bb4901
LibHTML: A tiny bit of work towards block layout.
2019-07-26 08:05:14 +02:00
Andreas Kling
f88c5860df
LibHTML: Fetch the box edge values needed for block width computation.
2019-07-24 07:34:07 +02:00
Andreas Kling
af23b38418
LibHTML: Fix host build.
2019-07-24 07:27:07 +02:00
Andreas Kling
c7ea94697e
Libraries: Remove unused "install" targets.
...
We've been using a per-directory "install.sh" for some time, so let's get
rid of the old way of doing things.
2019-07-21 21:28:48 +02:00
Andreas Kling
1c0669f010
LibDraw: Introduce (formerly known as SharedGraphics.)
...
Instead of LibGUI and WindowServer building their own copies of the drawing
and graphics code, let's it in a separate LibDraw library.
This avoids building the code twice, and will encourage better separation
of concerns. :^)
2019-07-18 10:18:16 +02:00
Andreas Kling
fc127eb769
LibHTML: Create anonymous blocks around inline children of blocks.
2019-07-08 17:42:23 +02:00
Andreas Kling
3c71dc4320
LibHTML: Oops, fix build.
...
It's another "hacking on the train and forgetting to try a full build"
episode, this time starring LibHTML.
2019-07-08 08:18:53 +02:00
Andreas Kling
8812b35c5e
LibHTML: Reorganize layout tree build so that parents add their children.
...
This will allow us to insert anonymous blocks with ease.
2019-07-08 07:33:58 +02:00
Andreas Kling
0ccad4208f
LibHTML: Move layout tree building to a separate function.
2019-07-08 07:24:15 +02:00
Andreas Kling
9526b0e13a
LibHTML: Add InheritStyleValue and InitialStyleValue.
...
These correspond to the 'inherit' and 'initial' CSS values respectively.
2019-07-08 07:15:56 +02:00
Andreas Kling
105a97685e
LibHTML: Fix host build after Libraries/ shuffle.
2019-07-08 07:14:18 +02:00
Andreas Kling
8b0953a795
Libraries: Unbreak "make install" with new directory locations.
2019-07-04 16:41:42 +02:00
Andreas Kling
04b9dc2d30
Libraries: Create top level directory for libraries.
...
Things were getting a little crowded in the project root, so this patch
moves the Lib*/ directories into Libraries/.
2019-07-04 16:16:50 +02:00