summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-10-21LibHTML: Clicking on a fragment link should prefer <a id> over <a name>Andreas Kling
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. :^)
2019-10-21LibHTML: Add Document::get_element_by_id() and get_elements_by_name()Andreas Kling
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.
2019-10-21HexEditor: Fix half byte offset bugBrandon Scott
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.
2019-10-21HexEditor: Added navigate to a hex offsetBrandon Scott
Added the ability to navigate to a specified hex offset.
2019-10-21HexEditor: Fixed off-by-one copying bugBrandon Scott
When copying as hex or text we missed the last byte.
2019-10-21HexEditor: Reverse selectionsBrandon Scott
Added the ability to select text and hex in reverse.
2019-10-20LibHTML: Remove trailing whitespace in line boxesAndreas Kling
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 :^)
2019-10-20LibM: Make roundf() and ceilf() slightly less terribleAndreas Kling
These implementations still don't handle all of the corner cases that are possible, but at least they are somewhat usable now.
2019-10-20ELF: Fail layout when program header hooks return nullptr (#673)Andrew Kaster
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 :)
2019-10-20LibHTML: Implement "text-align: justify"Andreas Kling
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. :^)
2019-10-20LibHTML: The CSS parser should tolerate whitespace-only stylesheetsAndreas Kling
2019-10-20LibM: Add dummy implementations of roundf() and ceilf()Andreas Kling
I though I could just use __builtin_roundf() and __builtin_ceilf() but it seems like I can't, as they just become calls to roundf and ceilf.
2019-10-20LibDraw: Add FloatPoint, FloatSize and FloatRectAndreas Kling
These are floating point varians of Point, Size and Rect.
2019-10-20LibHTML: Rename HTMLImageElement::m_image_loader => m_image_decoderAndreas Kling
This matches the new class name, ImageDecoder.
2019-10-20Shell: Update termios settings to match line discipline.Drew Stratford
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.
2019-10-20TTY: Implement Canonical mode and basic echoing.Drew Stratford
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.
2019-10-20AK: Add CircularDeque.Drew Stratford
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.
2019-10-20LibHTML: HtmlView only needs to store the main Frame, not the DocumentAndreas Kling
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.)
2019-10-20LibHTML: Only actually-linked <a> elements should be blue+underlinedAndreas Kling
Turns out this just needed a little push in the selector engine. :^)
2019-10-20LibHTML+Browser: Support scrolling to anchor with <a href="#foo">Andreas Kling
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.
2019-10-20LibHTML: Add Element::name() convenience attribute getterAndreas Kling
2019-10-20Kernel: Move Boot/ into Arch/i386/Boot (#667)Tidux
2019-10-19LibHTML: Don't insert unnecessary line breaks at start of text linesAndreas Kling
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.
2019-10-19LibHTML+Browser: Show target URL of hovered links in Browser statusbarAndreas Kling
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*.
2019-10-19LibHTML: DOM fixup should handle a completely empty documentAndreas Kling
We were forgetting to check if there was even a first child of the root Document node.
2019-10-19ls: Fix alignment of device files in long mode (ls -l)Andreas Kling
2019-10-19ls: Add -t and -r flagsAndreas Kling
-t: Sort by modification time (default is to sort by name) -r: Reverse sort order Note that these only apply when used together with -l (long mode.)
2019-10-19String: Define operator>(String)Andreas Kling
2019-10-19Terminal: Make Shift+PgUp/PgDown scroll the terminal up/down one pageAndreas Kling
I keep doing this out of habit, expecting it to scroll, and now it actually will scroll. :^)
2019-10-19LibHTML: Do DOM tree fixup before firing insertion callbacksAndreas Kling
There's no reason to run the callbacks before fixing up the tree.
2019-10-19LibDraw: Rename ImageLoader => ImageDecoderAndreas Kling
ImageLoader was not the right name for this, as there is no loading happening, only decoding. :^)
2019-10-19aplay: Fixed incomplete playback of filesTill Mayer
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.
2019-10-19AudioServer: Added ability to get count of samples in the buffer queueTill Mayer
Now the AClientConnection can get the count of samples still in the buffer queue.
2019-10-19ASMixer: Removed unused variable in ASBufferQueueTill Mayer
The variable m_playing_queued_buffer_id was defined but not used.
2019-10-19LibHTML: Make "display: inline-block" generate a LayoutBlock for nowAndreas Kling
We're gonna need some more smarts for this, but this at least gives us something instead of an assertion.
2019-10-19LibHTML: Batch style updates and make them start from the rootAndreas Kling
Use a zero-timer to schedule a style update after invalidating style on any node. Nodes now have a needs_style_update flag which helps us batch and coalesce the work. We also start style updates at the root and work our way through the document, updating any node that has the needs_style_update flag set. This is slower than what we were doing before, but far more correct. There is a ton of room for improvement here. :^)
2019-10-19LibDraw: Store emojis in a HashMap<u32, RefPtr<GraphicsBitmap>>Andreas Kling
Get rid of the dedicated Emoji class to make it easier to store a null value signifying a failed lookup. This allows us to remember failed lookups, making subsequent failures for the same codepoint much faster. :^)
2019-10-19LibHTML: Add TreeNode<T>::for_each_in_subtree(callback)Andreas Kling
This helper invokes a callback for the node and each of its descendants in pre-order.
2019-10-19LibDraw: Have the PNGImageLoaderPlugin remember if it failed to decodeAndreas Kling
Instead of trying again when asked repeatedly, just remember if it didn't work out the first time.
2019-10-19LibHTML: Skip over CSS @media rules for nowAndreas Kling
2019-10-19LibHTML: Use the correct inherited color for LayoutListItemMarkerAndreas Kling
2019-10-19LibHTML: Implement basic tiled background image supportAndreas Kling
It's now possible to set a page background image via <body background>. Also, HtmlView now officially handles rendering the body element's background (color, image or both.) LayoutBox is responsible for all other background rendering. Note that it's not yet possible to use CSS background-image properties directly, since we can't parse them yet. :^)
2019-10-19LibDraw: Rename Painter::blit_tiled() => draw_tiled_bitmap()Andreas Kling
Also change the API to take a destination rect instead of a source rect since internally it was basically creating a destination rect from the source rect anyway. It was a little confusing.
2019-10-19LibHTML: Replaced elements should not break lines at start of lineAndreas Kling
If the current line box already has zero width, there's no point in inserting a line break to make space, since we'll just be at x=0 after breaking as well. This removes an ugly unnecessary line break before images wider than their containing block. :^)
2019-10-19LibHTML: Ignore completed image loads for already-destroyed <img>'sAndreas Kling
Capture a weak pointer to the element and pass that to the load finish callback in HTMLImageElement::load_image(). This allows us to ignore completed loads if the <img> element is no longer around.
2019-10-19LibHTML: Make TreeNode inherit from Weakable by defaultAndreas Kling
This makes Node and LayoutNode weakable. Frame was already weakable.
2019-10-19LibHTML: Allow loading of PNG's directly into the HtmlViewAndreas Kling
When loading a URL that ends in ".png", we now construct a simple DOM document to contain the image. It also shows the image dimensions in the document title. Because we use <img src> to load the image into the synthetic document, we end up loading the image resource twice. This issue will go away once we have a smarter, caching, loader mechanism.
2019-10-18LibHTML: Add a simple font cacheAndreas Kling
The FontCache caches the result of font lookups. The cache key is a simple object called FontSelector which consists of the font family and font weight (both strings.) This drastically reduces time spent in font lookup.
2019-10-18Meta: Fix some typos in ReadMe.md (#671)yuanchen
2019-10-18LibHTML: Preserve UTF-8 codepoints when collapsing whitespaceAndreas Kling
This is extremely awkward and I'm sure there are many better ways to achieve this..