Experimental treeview search feature
by Michael Drake
Hello,
An experimental search feature has been added to the following:
1. Hotlist viewer (bookmarks)
2. Global history viewer
3. Cookie manager window
To use it, click in the area next to the search icon at the top
of the window, and start typing.
It has currently only been tried under the GTK front end.
It would be helpful if people could put it thoroughly through its
paces. Any feedback gratefully received.
Cheers,
--
Michael Drake http://www.netsurf-browser.org/
5 years, 8 months
LibCSS: Flexbox property support review
by Michael Drake
Hello,
This is a review of the lcneves/flexbox-tidy branch.
First off I think this is really good work. Almost all the
things I spotted range from minor to trivial.
Aside from the unset values for unit and length in the
min-{width|height} computed style getters, and the fact
that NetSurf is about to do a release[1], I'd be happy
to merge this as-is.
[1] I think NetSurf will need some minor changes to cope
with new values for the display property and the
min-{width|height} properties.
Add codes to flexbox properties
===============================
http://source.netsurf-browser.org/libcss.git/commit/?h=lcneves/flexbox-ti...
+72 - align-content
+ <value> (14bits) :
+ 0 => stretch,
+ 1 => flex-start,
+ 2 => flex-end,
+ 3 => center,
+ 4 => space-between,
+ 5 => space-around,
+ 6 => space-evenly
+ other => Reserved for future expansion.
I'm a bit unsure about the space-evenly value.
CSS Flexible Box Layout Module Level 1 doesn't have this value:
https://www.w3.org/TR/css-flexbox-1/#propdef-align-content
CSS Box Alignment Module Level 3 does have this value and
a few others:
https://www.w3.org/TR/css-align-3/#alignment-values
I think its OK for us to have space-evenly. Same for the
justify-content property.
Parsing: Add support for parsing the flexbox properties
=======================================================
http://source.netsurf-browser.org/libcss.git/commit/?h=lcneves/flexbox-ti...
src/parse/properties/flex.c:
http://source.netsurf-browser.org/libcss.git/diff/src/parse/properties/fl...
+/**
+ * Parse list-style
+ *
s/list-style/flex/
In css__parse_flex():
+ parserutils_vector_iterate(vector, ctx);
+ }
+
+ /* Handle auto, equivalent of flex: 1 1 auto; */
+ else if ((token->type == CSS_TOKEN_IDENT) &&
+ (lwc_string_caseless_isequal(
+ token->idata, c->strings[AUTO],
+ &match) == lwc_error_ok && match)) {
+ error = css__stylesheet_style_appendOPV(grow_style,
+ CSS_PROP_FLEX_GROW, 0, FLEX_GROW_SET);
Our code style is } else { on a single line, and the comment
would be inside the else block before the first line.
Could do something like:
parserutils_vector_iterate(vector, ctx);
} else if ((token->type == CSS_TOKEN_IDENT) &&
(lwc_string_caseless_isequal(
token->idata, c->strings[AUTO],
&match) == lwc_error_ok && match)) {
/* Handle auto, equivalent of flex: 1 1 auto; */
error = css__stylesheet_style_appendOPV(grow_style,
CSS_PROP_FLEX_GROW, 0, FLEX_GROW_SET);
Also I think we could simplfy handling of auto and none
by creating a copule more bools at the start of the function:
bool auto = false;
bool none = false;
Set those true if we get either of those tokens here, and
then below, in the /* defaults */ section, choose the
defaults that get set based on whether:
1. auto is set
2. none is set
3. neither are set
src/parse/properties/flex_flow.c:
http://source.netsurf-browser.org/libcss.git/diff/src/parse/properties/fl...
+/**
+ * Parse list-style
+ *
s/list-style/flex-flow/
Selection: Add support for the flexbox properties
=================================================
http://source.netsurf-browser.org/libcss.git/commit/?h=lcneves/flexbox-ti...
In src/select/computed.c:
http://source.netsurf-browser.org/libcss.git/diff/src/select/computed.c?h...
In css_computed_min_height():
- return get_min_height(style, length, unit);
+ uint8_t min_height = get_min_height(style, length, unit);
+ uint8_t display = get_display(style);
+
+ if (display != CSS_DISPLAY_FLEX && display !=
CSS_DISPLAY_INLINE_FLEX &&
+ min_height == CSS_MIN_HEIGHT_AUTO)
+ {
Spaces used for indent instead of tab on the first and last
inserted likes above. Also out code style doesn't put the
opening brace on a new line.
Same in css_computed_min_width().
For both css_computed_min_height() css_computed_min_width() we
could rearrange to avoid getting display unless the value is
auto. Something like:
uint8_t css_computed_min_height(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t min_height = get_min_height(style, length, unit);
if (min_height == CSS_MIN_HEIGHT_AUTO) {
uint8_t display = get_display(style);
if (display != CSS_DISPLAY_FLEX &&
display != CSS_DISPLAY_INLINE_FLEX) {
min_height = CSS_MIN_HEIGHT_SET;
}
}
return min_height;
}
Finally, I don't think it's OK to override the value
to *_SET and not set appropriate values for length and unit
at the same time. When the computed value is set to *_AUTO
in the cascade it doesn't clear any values for length and
unit. So we should be them up for 0px where we override
min_height.
Same for both css_computed_min_height() and for
css_computed_min_width().
In css_computed_display():
+ } else if (display == CSS_DISPLAY_INLINE_FLEX) {
+ return CSS_DISPLAY_FLEX;
Spaces used for indent on the first inserted line.
In src/select/computed.h:
http://source.netsurf-browser.org/libcss.git/diff/src/select/computed.h?h...
+ * 35 yyybbbaa overflow-y | background-repeat | align-content
+ * 36 bbbbbbaj flex-basis | align-content | justify_content
+ * 37 fffcccjj flex-direction | clear | justify_content
Since align-content and justify-content are split over two
areas, I would say somthing to hint at that in the comments,
e.g.:
* 35 yyybbbaa overflow-y | background-repeat | align-content1
* 36 bbbbbbaj flex-basis | align-content2 | justify_content1
* 37 fffcccjj flex-direction | clear | justify_content2
In the long term perhaps we could consider using a uint32_t
array for the bit data than uint8_t, so its easier to pack
things in without splitting stuff.
+ css_fixed flex_basis;
+
+ css_fixed flex_grow;
+
+ css_fixed flex_shrink;
+
+ int32_t order;
Spaces used for indent.
In src/select/dispatch.c:
http://source.netsurf-browser.org/libcss.git/diff/src/select/dispatch.c?h...
+ },
+ {
+ PROPERTY_FUNCS(align_content),
Spaces for indent on the middle inserted line above.
In src/select/propget.h
http://source.netsurf-browser.org/libcss.git/diff/src/select/propget.h?h=...
-#define BOX_SIZING_INDEX 34
+#define BOX_SIZING_INDEX 23
Good spot! Ditto for the similar change in propset.h.
In get_align_content():
+ /* Most significant bit out of three */
+ bits_b <<= 2;
+
+ uint8_t bits = bits_a | bits_b;
Spaces for indent on the first and last lines above.
Similar in get_justify_content().
Selection: Logic for the flexbox properties
===========================================
http://source.netsurf-browser.org/libcss.git/commit/?h=lcneves/flexbox-ti...
In src/select/properties/flex_basis.c:
http://source.netsurf-browser.org/libcss.git/diff/src/select/properties/f...
In css__cascade_flex_basis():
+ uint16_t value = CSS_FLEX_BASIS_INHERIT;
+ css_fixed length = 0;
+ uint32_t unit = UNIT_PX;
Spaces for indent on last line above.
In src/select/properties/order.c:
http://source.netsurf-browser.org/libcss.git/diff/src/select/properties/o...
+ /* Undo the <<10, because this is an integer */
+ order = *((css_fixed *) style->bytecode) >> 10;
Use CSS_RADIX_POINT instead of 10. (From include/libcss/fpmath.h)
Or use the FIXTOINT macro from include/libcss/fpmath.h.
--
Michael Drake http://www.codethink.co.uk/
5 years, 8 months
Experimental treeview search feature - a problem
by Richard Torrens (lists)
I have just spotted a (hopefully small) problem - it's impossible to
delete items!
Select an item and assoon as the mouse pointer moves away from the window
or over the search box, the item is delelected.
Same thing happens if you press Menu!
#4211, ARMX6 5.23
--
Richard Torrens.
http://www.Torrens.org for genealogy, natural history, wild food, walks, cats
and more!
5 years, 8 months
Re: Experimental treeview search feature
by Harriet Bazley
On 18 Sep 2017 as I do recall,
Michael Drake wrote:
> Any feedback gratefully received.
>
Other thoughts: from a practical point of view, I think it would be
preferable if any active search were deleted when the window is closed.
Otherwise it gets a bit disconcerting when you go to reopen your
history/hotlist and there are only two or three entries visible, due to a
search you carried out earlier and have long since finished with -
particularly as the icon in question doesn't have the input focus when the
window reopens, and clearing the old search string is a pain!
--
Harriet Bazley == Loyaulte me lie ==
A poor workman blames his tools.
5 years, 8 months
Re: Experimental treeview search feature
by Peter Slegg
> Message: 1
> Date: Mon, 18 Sep 2017 23:29:47 +0100
> From: Michael Drake <tlsa(a)netsurf-browser.org>
> Subject: Re: Experimental treeview search feature
> To: netsurf-users(a)netsurf-browser.org
> Message-ID: <8e933e3d-f507-99c8-2fec-26a5ca3106b9(a)netsurf-browser.org>
> Hello,
>
> An experimental search feature has been added to the following:
>
> 1. Hotlist viewer (bookmarks)
> 2. Global history viewer
> 3. Cookie manager window
>
> To use it, click in the area next to the search icon at the top
> of the window, and start typing.
>
> It has currently only been tried under the GTK front end.
>
> It would be helpful if people could put it thoroughly through its
> paces. Any feedback gratefully received.
>
> Cheers,
I just tried it in Atari build and it works fine.
Thanks,
Peter
5 years, 8 months
NetSurf browser detection
by Tim Hill
Readers may be familiar with the feedback which drove me to make special
dispensation for NetSurf users on the RISC OS Events Calendar at
www.timil.com/riscos/calendar ;o)
Well, I have succumbed to some moaning of my own. The lack of support for
CSS flex containers (a useful layout tool to flow objects around the page
and space them out sensibly on any sized display) has me now providing a
different style sheet with inline-block containers for NetSurf. This is
probably only for my personal use and it took a while to get it working
until I remembered NetSurf's sodding camel-case!
Apart from that I am very pleased that here, WebJames+PHP can take a 185
line, eight-column CSV file and sort it, serve the result to NetSurf
which can now actually cope with the layout foibles. No quite the 'blink
of an eye' speed of my ISP's hosting though.
Still under development: trying to display two CSV files in 24 different
ways and not shut out our less capable browser. No javascript required!
PHP does the donkey work. :-)
www.youngtheatre.co.uk/archive/list
Feedback on the NetSurf or other outcomes always welcome.
--
Tim Hill
timil.com : tjrh.eu : butterwick.eu : blue-bike.uk : youngtheatre.co.uk
5 years, 9 months