This patch adds a new HTMLDocumentParser class. It keeps a tokenizer
object internally and feeds itself with one token at a time from it.
The names and idioms in this class are expressed as closely to the
actual HTML parsing spec as possible, to make development as easy
and bug free as possible. :^)
This is going to become pretty large, but it's pretty cool!
When hit testing encountered a block with inline children, we assumed
that the inline children are nothing but text boxes. An inline-block
box is actually a block child of a block with inline children, so we
have to handle that scenario as well. :^)
Fixes#2353.
Instead of emitting data-bearing tokens immediately, do it lazily at
the next state change. This allows us to accumulate full bursts of
text in between tags instead of having one token per character. :^)
This patch adds `Array.prototype.reduce()` method to LibJS Runtime.
The implementation is (to my best knowledge) comformant to ECMA262.
The test `Array.prototype-generic-functions.js` demonstrates that the
function can be applied to other objects besides `Array`.
Let's treat it as zero like the ECMAScript spec does in toInteger().
That way we can use to_i32() and don't have to care about weird input
input values where a number is expected, i.e.
"foo".charAt() === "f"
"foo".charAt("bar") === "f"
"foo".charAt(0) === "f"
Lagom now builds under macOS. Only two minor adjustments were required:
* LibCore TCP/UDP code can't use `SOCK_{NONBLOCK,CLOEXEC}` on macOS,
use ioctl() and fcntl() instead
* LibJS `Heap` code pthread usage ported to MacOS
This makes it a compile error to omit the END_STATE. Also add some more
missing END_STATE's exposed by this (nice!)
Thanks to @predmond for suggesting the multi-pair trick! :^)
While the compiler provides __SIZE_TYPE__ for declaring size_t,
there's unfortunately no __SSIZE_TYPE__ for ssize_t.
However, we can trick the preprocessor into doing what we want anyway
by doing "#define unsigned signed" before using __SIZE_TYPE__ again.
Previously, clicking on an anchor link (href="#section1")
would always scroll to it on the current page, even if control was
held or the target="_blank" attribute was set. This fixes that
behaviour, and the link will always open in a new tab if required.
Previously, passing a fragment string ("#section3") to the complete_url
method would result in a URL that looked like
"file:///home/anon/www/#section3" which was obviously incorrect. Now the
result looks like "file:///home/anon/www/afrag.html#section3".
This commit adds back suggestion pagination, and makes it 10x better.
Also adds a "< page m of n >" indicator at the bottom if there are more
suggestions than would fit in a page.
It properly handles cycling forwards and backwards :^)
`CompletionSuggestion(text, ForSearch)` creates a suggestion whose only
purpose is to be compared against.
This constructor skips initialising the views.
Prior to this, we did not care if there was any whitespace after the
last token in the prompt, and this caused a regression:
```
> lsp <tab>
> lsp ci
```
Previously, double clicking would select the range around your click up
until it found a space, and in the browser's location bar this behavior
didn't suffice. Now, it will select the range around your click until
there is a "word break". A word break is considered to be when your
selection changes from being alphanumeric to being non alphanumeric, or
vice versa.