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.
TerminalWidget was relying on the "window became active/inactive"
events from WindowServer to update its own internal focus state.
Unfortunately those events are only sent to the window's main widget,
so this was not working when the TerminalWidget was embedded deeper in
a widget tree.
This patch hooks the focusin and focusout events and uses those to
set the focus state when received. This makes TerminalWidget behave
nicely in both configurations. This design is kind of a workaround for
this awkward focus architecture and we should figure out something
better in the long term.
It turns out that other engines also prefer <h1 id=x> over <a name=x>.
So we can just use get_element_by_id() directly without worrying about
the type of element we find.
It turns out that other engines prefer <a id> over <a name> when
deciding which anchor element to jump to.
This patch aligns LibHTML's behavior with WebKit and Gecko.
Thanks to "/cam 2" for bringing this up. :^)
These will be useful for implementing various things. They don't do any
caching at the moment, but that might become valuable in the future.
To facilitate this change, I also made it possible to abort a tree walk
with for_each_in_subtree() by returning IterationDecision::Break from
the callback.
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.
After the splitting-into-lines pass, remove any trailing whitespace
from all of a block's line boxes.
This improves the appearance of text-align: justify/right :^)
ELFLoader::layout() had a "failed" variable that was never set. This
patch checks the return value of each hook (alloc/map section and tls)
and fails the load if they return null.
I also needed to patch Process so that the alloc_section_hook and
map_section_hook actually return nullptr when allocating a region fails.
Fixes#664 :)
In order for this to work nicely, I made the line box classes use float
instead of int for its geometry information.
Justification works by distributing all of the whitespace on the line
(including the trailing whitespace before the line break) evenly across
the spaces in-between words.
We should probably use floating point (or maybe fixed point?) for all
the layout metrics stuff. But one thing at a time. :^)
Shell.cpp uses its own line discipline which handles
echoing and line editing. Because of this we disable
ICANON and ECHO so that we don't get duplicate characters
or weird line editing errors.
We also revert these settings just before running a command.
This is so that commands may run with proper line editing
and echoing.
The TTY driver now respects the ICANON flag, enabling basic line
editing like VKILL, VERASE, VEOF and VWERASE. Additionally,
ICANON is now set by default.
Basic echoing has can now be enabled via the ECHO flag, though
more complicated echoing like ECHOCTL or ECHONL has not been
implemented.
This class inherits from CircularQueue and adds the ability dequeue
from the end of the queue using dequeue_end().
Note that I had to make some of CircularQueue's fields protected to
properly implement dequeue_end.
Remove the Document pointer from HtmlView and always get to it through
the main Frame instead.
The idea here is to move towards HtmlView being higher-level than the
DOM stuff (as much as possible and practical.)
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.
Basically the same exact fix as I did for replaced elements. There's no
point in inserting a line break at the start of a line if all you're
trying to achieve is make more horizontal space for something.
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*.
aplay used to quit as soon as the last enqueue of new buffer data
was sucessful. Because the connection closes as soon as the
application quits, samples were still in the buffer of the
ASBufferQueue as playback was halted.