Tuesday, 10 June 2025

[netsurf-dev] Redirect ignores anchor

Hi all,

I've been upgrading the web interface to my accounts app. When I run
the regulars to the transactions database, I want the transactions to
be displayed with the first added regular at the top of the window.

This has to be done in two stages. First is to execute the regulars,
which gives me the position of the first new one in the list. Second
is to display the list. So clicking the Execute button invokes the
ExecRegs script (this all runs under Webjames), which does what its
name suggests, and returns HTML with a 302 link to Accounts, with a
URL of the form:

/cgi-bin/Accounts#t107

for example, to display with line 107 at the top. This works well
with Firefox and the Samsung browser.

However, with Netsurf, I briefly see that URL in the URL bar, then a
moment later the URL is replaced but without the hash-link on the end.
The display is from the first line, which is not what I intend.

Is this the expected behaviour?

NS 3.12 (Dev CI #6804), RISC OS 5.31 (18-May-25).

David

[netsurf-dev] Redirect ignores anchor

Hi all,

I've been upgrading the web interface to my accounts app. When I run
the regulars to the transactions database, I want the transactions to
be displayed with the first added regular at the top of the window.

This has to b done in two stages. First is to execute the regulars,
which gives me the position of the first new one in the list. Second
is to display the list. So clicking the Execute button invokes the
ExecRegs script (this all runs under Webjames), which does what its
name suggests, and returns HTML with a 302 link to Accounts, with a
URL of the form:

/cgi-bin/Accounts#t107

for example, to display with line 107 at the top. This works well
with Firefox and the Samsung browser.

However, with Netsurf, I briefly see that URL in the URL bar, then a
moment later the URL is replaced but without the hash-link on the end.
The display is from the first line, which is not what I intend.

Is this the expected behaviour?

NS 3.12 (Dev CI #6804), RISC OS 5.31 (18-May-25).

David

Monday, 9 June 2025

[netsurf-dev] Re: Pull request: CSS support for libsvgtiny

On Mon, 2023-11-20 at 12:27 -0500, Michael Orlitzky wrote:
> As promised, and only a month late. My branch is available at,
>
> https://gitweb.michael.orlitzky.com/libsvgtiny.git libcss
>

I've rebased this over the latest libsvgtiny refactoring. The new
branch is "libcss-ng" -- I kept the old one around in case I messed up
squashing something. Since I was rewriting history anyway, I combined
fixes where it was not too hard to do so.

Gitweb link:

https://gitweb.michael.orlitzky.com/?p=libsvgtiny.git;a=shortlog;h=refs/heads/libcss-ng

Sunday, 8 June 2025

[netsurf-dev] [PATCH] src/svgtiny_gradient.c: be more careful with float -> int assignment

Assigning the value of a float to an unsigned int is undefined
behavior unless the value is guaranteed to fit. We run afoul of this
in compute_grad_points(), where the number of steps is computed using
a floating point calculation.

On a RISC-V / musl system, the end result is that we wind up with
steps = the maximum value of an unsigned int, when really this should
be an error case resulting in steps = 1. The test suite catches this.
---
src/svgtiny_gradient.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/svgtiny_gradient.c b/src/svgtiny_gradient.c
index ca961cc..8fd0f83 100644
--- a/src/svgtiny_gradient.c
+++ b/src/svgtiny_gradient.c
@@ -6,6 +6,7 @@
*/

#include <assert.h>
+#include <limits.h>
#include <math.h>
#include <string.h>
#include <stdio.h>
@@ -427,7 +428,18 @@ compute_grad_points(float *p,
if(isnan(r0) || isnan(r1)) {
steps = 1;
} else {
- steps = ceilf(fabsf(r1 - r0) / 0.05);
+ /* float -> int assignment is undefined unless
+ * the value is guaranteed to fit */
+ float stepsf = ceilf(fabsf(r1 - r0) / 0.05);
+ if (isnan(stepsf)) {
+ steps = 1;
+ }
+ else if (stepsf > (float)UINT_MAX) {
+ steps = 1;
+ }
+ else {
+ steps = stepsf;
+ }
}

if (steps == 0)
--
2.49.0

[netsurf-dev] Redirect ignores anchor

Hi all,

I've been upgrading the web interface to my accounts app. When I run
the regulars to the transactions database, I want the transactions to
be displayed with the first added regular at the top of the window.

This has to b done in two stages. First is to execute the regulars,
which gives me the position of the first new one in the list. Second
is to display the list. So clicking the Execute button invokes the
ExecRegs script (this all runs under Webjames), which does what its
name suggests, and returns HTML with a 302 link to Accounts, with a
URL of the form:

/cgi-bin/Accounts#t107

for example, to display with line 107 at the top. This works well
with Firefox and the Samsung browser.

However, with Netsurf, I briefly see that URL in the URL bar, then a
moment later the URL is replaced but without the hash-link on the end.
The display is from the first line, which is not what I intend.

Is this the expected behaviour?

NS 3.12 (Dev CI #6804), RISC OS 5.31 (18-May-25).

David

Tuesday, 3 June 2025

[netsurf-dev] ncurses once again

Hello,
years ago I had an idea to make the ncurses frontend.
I back to this idea.
At https://github.com/rkd77/nstxt/blob/main/netsurf-textmode.patch there is a patch
against netsurf master branch. To build:
make TARGET=textmode

Usage as framebuffer, F10 key quits. If you want to change URL, click on top and change url.
The idea is to align to terminal cells. Sometimes it does not work well, not always alignment
is correct.

What to change in this code to be accepted?
Changes to netsurf code are minimal. You could have one more user if you add ncurses frontend.

Witold Filipczyk

Wednesday, 21 May 2025

[netsurf-users] pseudo elements

Hello!

I am using libcss to parse CSS from WebVTT subtitle file.

example :


WEBVTT

STYLE
::cue {
  color: red;
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: bold;
  text-indent: 20px;
  background-color: rgba(0, 0, 0, 0.5);
  text-shadow: 1px 1px 2px black;
}
::cue(#\3) {
  color: blue;
  background-color: rgba(0.5, 0, 0, 0);
  font-size: 18px;
  padding: 5px;

}

I treat cue as a pseudo element. And for some reason, I have to strip the double colon from the id in order for libcss to process it. Below is my code that integrates with libcss


https://gitlab.freedesktop.org/boxerab/gstreamer/-/blob/webvtt/subprojects/gst-plugins-base/gst/subparse/gstcssparse.c?ref_type=heads

Any advice would be greatly appreciated!

Many Thanks,
Aaron Boxer