| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
if recvData returns 0, it must be treated the same as a broken pipe.
|
|
|
|
| |
the backslash thing is in the RFC, I just forgot to add it
|
|
|
|
|
| |
cetStatus is only called for soft status updates, not alerts (we have
cetAlert for that)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Originally we had several loader processes so that the loader did not
need asynchronity for loading several buffers at once. Since then, the
scope of what loader does has been reduced significantly, and with
that loader has become mostly asynchronous.
This patch finishes the above work as follows:
* We only fork a single loader process for the browser. It is a waste of
resources to do otherwise, and would have made future work on a
download manager very difficult.
* loader becomes (almost) fully async. Now the only sync part is a)
processing commands and b) waiting for clients to consume responses.
b) is a bit more problematic than a), but should not cause problems
unless some other horrible bug exists in a client. (TODO: make it
fully async.)
This gives us a noticable improvement in CSS loading speed, since all
resources can now be queried at once (even before the previous ones
are connected).
* Buffers now only get processes when the *connection* is finished. So
headers, status code, etc. are handled by the client, and the buffer
is forked when the loader starts streaming the response body.
As a result, mailcap entries can simply dup2 the first UNIX domain
socket connection as their stdin. This allows us to remove the ugly
(and slow) `canredir' hack, which required us to send file handles on
a tour accross the entire codebase.
* The "cache" has been reworked somewhat:
- Since canredir is gone, buffer-level requests usually start
in a suspended state, and are explicitly resumed only after
the client could decide whether it wants to cache the response.
- Instead of a flag on Request and the URL as the cache key,
we now use a global counter and the special `cache:' scheme.
* misc fixes: referer_from is now actually respected by buffers (not
just the pager), load info display should work slightly better, etc.
|
|
|
|
|
|
|
|
| |
the 0x40 bitmask implies one more state than the 0 bitmask, since state
3 with 0 is unused[0]. so we must add 7, not 6
[0] it's reserved for "move", but movement is indicated differently in
the protocol we use so unused
|
|
|
|
|
| |
old Nim chokes on unquoting enums without explicitly casting them to the
target enum type.
|
|
|
|
|
|
| |
middle button to close is from w3m
btn5/6 is normally a horizontal scroll wheel, so scrollLeft/Right makes
more sense than prev/next
|
| |
|
|
|
|
|
|
| |
in this case just write smcup/rmcup
also move down +1 line and reset formatting if alt screen is off
|
|
|
|
| |
whoops
|
| |
|
|
|
|
|
|
|
| |
using this API is suffering
(`n' is the last *valid* character ever since the validator API got
fixed, so it must be included in the slice.)
|
|
|
|
| |
it used to leave "Connecting..." on the screen
|
|
|
|
| |
having to manually add them to a million places is annoying
|
|
|
|
|
| |
it's inefficient and pointless to treat them differently, so just derive
a new enum from TagType with a macro
|
| |
|
|
|
|
|
|
|
|
| |
* parse XHR URL with document base URL
* allow setting XHR responseType
* add tagName, nodeName
* make hasChildNodes a function
* fix horribly broken insertNode
|
|
|
|
|
|
|
|
|
| |
not a very useful operation, but crashing on it is definitely not the
correct reaction
(hyperfine does this for example. though in that case it's still better
to turn it off, otherwise Chawan will pointlessly open a new buffer for
it...)
|
|
|
|
|
|
| |
* put attrs pointer in state
* simplify width()
* use unsigned int as ptint to avoid UB
|
| |
|
|
|
|
|
|
|
|
|
| |
Only report when bytesRead has changed, otherwise we get unnecessary
load requests. (This means -2 return value no longer exists; it did
not work correctly anyway.)
Also, fix the race condition that broke onload returns when onload
happened before client requested load.
|
|
|
|
|
|
| |
* the uint8array thing is probably from txiki.js, but we never used it
* upstream now has JS_GetClassID, importing that instead... (so this
commit won't build :/)
|
|
|
|
| |
obviously for ident tokens we must check value, not unit
|
| |
|
| |
|
|
|
|
|
| |
* skip whitespace in some places where we didn't but should
* fix crash in get_tok when eof comes after whitespace
|
|
|
|
|
|
|
|
| |
so that e.g.
a<span style="background-color: red"> </span>b
makes the span width exactly one space.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
> The right outer edge of a left-floating box may not be to the right
> of the left outer edge of any right-floating box that is next to
> it. Analogous rules hold for right-floating elements.
says the standard
therefore it does not really matter where the beginning of the float is;
if it's float: left, then `left' must be set to the right edge, and if
it's float: right, then `right' must be set to the left edge.
(this was breaking some negative margin float abominations such that
floats were suddenly overlapping and that's certainly not what we want)
|
|
|
|
| |
it's a good idea to use the return value, but it must substitute atEnd.
|
|
|
|
|
| |
slightly more efficient, but more importantly does not choke on NUL and
weird \r\n
|
| |
|
|
|
|
|
|
| |
setCursorX only moves the screen backwards if the intended X position is
lower than the actual X position. Pass it -1 so that this is true even
with zero-width lines.
|
|
|
|
|
|
|
|
| |
left/right never really worked correctly, is non-standard, and the
only browser that supported it (Firefox) removed it years ago.
bottom was adding the table width to its offset instead of the height,
that is now fixed.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This is an ancient bug, but it got much easier to trigger with mouse
scrolling support so it's time to fix it.
(The bug itself was that since both the client and buffer ends of the
controlling stream are blocking, they could get stuck when both were
trying to send() data to the other end but the buffer was full. So now
we set the client end to non-blocking.)
|
|
|
|
| |
background & list-style did not override unspecified values
|
| |
|
|
|
|
|
| |
should finally convert the code to strictDefs, implicit result is a
horrible footgun
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we are going to round things in layout, let's do it properly. Adding
fake height has negative utility (things get more annoying to read),
so now we don't.
TODO: finding the correct positioning of the baseline after adding
padding is an open question. Probably have to revise the algorithm
somewhat to get it right.
(This should also fix the bug where error correction would make inline
box backgrounds shift into unrelated text, causing much confusion for
the reader.)
|
|
|
|
|
|
|
| |
Split up load into loadSubmit, gotoURL: loadSubmit is a replacement for
load(s + '\n'), and gotoURL is a load that does no URL expansion.
Also, fix a bug where load("\n") would crash the browser.
|
|
|
|
|
| |
it is useful to round them so that they don't get positioned somewhere
in the middle of a line (which is rounded to the same precision as well)
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous retrofitting of the old renderdocument error correction
usually worked, but it still had a horrible flaw in that it assumed that
all line boxes are of equal height. So if error was lower for some line
than another, it would move *all* lines by a somewhat lower error, and
that resulted in overlapping lines.
Now we do something much simpler: in flushLine, round each line's height
downwards before moving on to the next line. This gets rid of any blanks
inbetween lines, and also works much better with cleared floats.
|
|
|
|
|
|
|
|
|
| |
* fix cursor jumping back to the start of the line (instead of the end
of the line) when it is outside the viewport and a leftwards update is
requested
* save setxsave too when line is not loaded yet
* always set needslines in onMatch when hlon (this was causing a blank
screen when incremental search was jumping around in large documents)
|
|
|
|
|
|
|
|
|
|
| |
It is in fact quite simple to calculate: charwidth is the width
of printing characters until now, and whitespacenum the number of
(non-flushed) spaces. So we just have to subtract this from the target
width to get the number of spaces missing from the next tab stop.
(Of course, it gets much harder to understand when the whole thing is
formatted as a convoluted multi-line equation...)
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* rename buffer enums
* fix isAscii for char 0x80
* remove dead code from URL
|
|
|
|
|
|
|
|
| |
Ensure that a) dead outputs do not continue to get more data from
istream and b) if all outputs are dead, istream is immediately closed.
Also, remove that pointless loop in loadStreamRegular (it did nothing
that handleRead did not).
|