This simple helper escapes '<', '>' and '&' so they can be used in HTML
text without interfering with the parser.
Use this in IRCClient to prevent incoming messages from messing with
the DOM :^)
Renamed "Position" to "Elapsed". "channel/channels" automatically
changes now when more than one channel exist. The current file name
is now displayed in the window title.
This seemed like a perfect fit for LibHTML. We can now style the IRC
channels and queries however we like with the power of HTML and CSS.
This patch doesn't do much in the way of styling, it just gets the
basic mechanism into place.
When attempting to open a file that doesnt exist or has permission
problems, the application would end after hitting OK on the message
box instead of starting up to an empty editor.
I believe this has something to do with the dialog event loop
interfering with the application event loop, or possibly the fact
that the window creation code is in the show() method.
To work around this I now call the open_file() method after the
show() method.
Instead of quitting the application immediately when the pty gives an
EOF, fire an on_command_exit hook so the TerminalWidget client can
decide for himself what to do.
Instead, have TerminalWidget provide an on_title_change hook.
This allows embedders to decide for themselves what to do if we receive
a "set terminal title" escape sequence.
When embedding a TerminalWidget, you might not want it to automatically
update its own size policy based on the exact terminal buffer size.
This behavior is now passed as a flag to the TerminalWidget constructor
which makes it behave nicely both inside HackStudio and in Terminal.
If you had made a change to the first 4 bits of a byte and then changed
your offset via keyboard or menu option it would change the last 4 bits
of the new offset the next time you made a change and would not show that
the byte had been changed at the new offset.
This patch implements basic support for <a href="#foo"> fragment links.
To figure out where we actually want to scroll to, we have to do
something different based on the layout node's box type. So if it's a
regular LayoutBox we can just use the LayoutBox::position().
However, if it's an inline layout node, we use the position of the
first line box fragment in the containing block contributed by this
layout node or one of its descendants.
HtmlView will now invoke the on_link_hover hook when the cursor enters
or leaves a DOM node that has an enclosing link element.
This patch also updates the meaning of Node::enclosing_link_element()
to find the nearest HTMLAnchorElementAncestor *with an href attribute*.
Minor patch, but I was watching one of your videos on YouTube and
thought that the pop-up was unecessary/annoying in this case. Love
your enthusiasm for the project :^)
The layout root is now kept alive via Document::m_layout_root.
This will allow us to do more layout-related things inside the inner
layer of LibHTML without reaching out to the HtmlView.
I'd like to keep HtmlView at a slightly higher level, to prevent it
from getting too complex.
This patch also fixes accidental disconnection of the layout tree from
the DOM after doing a layout tree rebuild. ~LayoutNode() now only
unsets the DOM node's layout_node() if it's itself.
For now this is simply a counter+hook exposed by ResourceLoader and
shown in the Browser status bar.
This is not very nuanced, and it would be nice to expose more info so
we could eventually do something like a progress bar.
Node.normalize() is a standard DOM API that coalesces Text nodes.
To avoid clashing with that, rename it to fixup().
This patch also makes it happen automagically as part of parsing.
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.