border values in libcss.
by Rupesh gautam
Hi,
Does libcss support "border" ?
div {
width: 300px;
* border: 10px solid #00FF00*
padding: 50px;
margin: 9px;
}
I am trying to get the value using all available functions related to
margin computation but each function is returning 0.
i tried css_computed_border_left_width but it is returning 0.
css_computed_border_left_width appears to be wrong function for getting
values from* border: 10px solid #00FF00*
Regards,
Rupesh
2 years, 2 months
[PATCH] window: add url_filter field
by Drew DeVault
This allows a frontend to filter the URLs which the browser will
navigate to.
---
desktop/browser_window.c | 3 +++
include/netsurf/window.h | 12 ++++++++++++
2 files changed, 15 insertions(+)
diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index 7b553f4e0..522772bbc 100644
--- a/desktop/browser_window.c
+++ b/desktop/browser_window.c
@@ -3313,6 +3313,9 @@ browser_window_navigate(struct browser_window *bw,
assert(bw);
assert(url);
+ if (guit->window->url_filter) {
+ url = guit->window->url_filter(bw->window, url);
+ }
NSLOG(netsurf, INFO, "bw %p, url %s", bw, nsurl_access(url));
/*
diff --git a/include/netsurf/window.h b/include/netsurf/window.h
index 16fd95e30..8ebbfee92 100644
--- a/include/netsurf/window.h
+++ b/include/netsurf/window.h
@@ -376,6 +376,18 @@ struct gui_window_table {
const char *msg,
size_t msglen,
browser_window_console_flags flags);
+
+ /**
+ * Filter URLs for navigation. Return the same nsurl if no filtering is
+ * desired, or leave this table field NULL. The browser will reference
+ * the returned URL.
+ *
+ * \param gw The gui window which is navigating to a URL
+ * \param url The URL being navigated to
+ * \return The same URL, or another URL to load instead.
+ */
+ struct nsurl *(*url_filter)(struct gui_window *gw,
+ struct nsurl *url);
};
#endif
--
2.33.0
2 years, 2 months
libcss actual values
by Rupesh gautam
Hi,
I was trying out libcss and found that the following code snippet returns
value multiplied by 1024.
*css_unit unit;*
*css_fixed val;css_computed_margin_top(styles[0], &val, &unit);std::cout <<
val << std::endl;*
For example: if my margin is set to 2px, returned *Val *would be 2048.
Is there a function that can return actual values (Not bit-shifted values)?
if not, then could you please confirm that all CSS values are left-shifted
by 10 bits. in that case, I can right shift for all the values.
Regards
2 years, 2 months
[PATCH] docs/implementing-new-frontend.md: scheduler tips
by Drew DeVault
This adds a few details which I would have found welcome while working
on my frontend scheduler.
---
docs/implementing-new-frontend.md | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/docs/implementing-new-frontend.md b/docs/implementing-new-frontend.md
index 4bda47af0..76d73e94b 100644
--- a/docs/implementing-new-frontend.md
+++ b/docs/implementing-new-frontend.md
@@ -126,11 +126,26 @@ The only mandantory operation in this table is schedule.
When schedule is called the frontend must arrange for the passed
callback to be called with the context parameter after a number of
-miliseconds.
+miliseconds. All combinations of callback & context are only to be
+scheduled once, the scheduler should remove any existing callbacks
+for a given tuple before scheduling anew. The scheduler will be
+called with a timeout less than zero to have any previously
+scheduled callbacks removed.
This callback is typicaly driven through the toolkits event loop and
it is important such callbacks are not attempted from an operation.
+There are some important factors to consider for your event loop:
+
+- When a callback is due, you must remove it from your schedule
+ *before* calling it.
+- You should run pending callbacks before calling `fetch_fdset`
+ (which is something you should call, by the way).
+
+Failure to uphold these criteria will unleash eldritch horrors upon
+your frontend and waste your entire morning trying to figure out
+bizzare race conditions.
+
### window operation table
The window operations (poorly named as already mentioned) are where
--
2.33.0
2 years, 3 months