toolchains: branch master updated. 858429a5821436fe01b812ca4215a58598a3e0a2
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/toolchains.git/shortlog/858429a5821436fe01...
...commit http://git.netsurf-browser.org/toolchains.git/commit/858429a5821436fe01b8...
...tree http://git.netsurf-browser.org/toolchains.git/tree/858429a5821436fe01b812...
The branch, master has been updated
via 858429a5821436fe01b812ca4215a58598a3e0a2 (commit)
via 388d9098dc3578a41e07d720ba3708012c0a10e2 (commit)
via 1e67635045e1c09cf4af451b7265f233b2d09b8a (commit)
via 8f131163961012465f1b5fbd0e5790bdc1866f93 (commit)
from 5c296bb750617b8f0eeca18c08cb88f2d8374ed5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
arm-unknown-riscos/Makefile | 17 +-
.../recipes/patches/gcc4/binutils-plugins.p | 11 +
.../recipes/patches/gcc4/binutils-texinfo.p | 365 --------------------
.../recipes/patches/oslib/defmod-size.p | 15 -
4 files changed, 21 insertions(+), 387 deletions(-)
create mode 100644 arm-unknown-riscos/recipes/patches/gcc4/binutils-plugins.p
delete mode 100644 arm-unknown-riscos/recipes/patches/gcc4/binutils-texinfo.p
delete mode 100644 arm-unknown-riscos/recipes/patches/oslib/defmod-size.p
diff --git a/arm-unknown-riscos/Makefile b/arm-unknown-riscos/Makefile
index ef758be..6fd6be9 100644
--- a/arm-unknown-riscos/Makefile
+++ b/arm-unknown-riscos/Makefile
@@ -1,14 +1,14 @@
-# Use tagged release of GCCSDK
-UPSTREAM_GCCSDK_VERSION := release_4_1_2_v2
+# Use a tested trunk version of GCCSDK
UPSTREAM_GCCSDK_TARBALL := gcc4
-UPSTREAM_GCCSDK_URI := svn://svn.riscos.info/gccsdk/tags/$(UPSTREAM_GCCSDK_VERSION)
+UPSTREAM_GCCSDK_REVISION := 6747
+UPSTREAM_GCCSDK_URI := svn://svn.riscos.info/gccsdk/trunk/gcc4@$(UPSTREAM_GCCSDK_REVISION)
-# Going to use a known revision of trunk, until there's a release version that suits
-UPSTREAM_OSLIB_VERSION := 402
+# OSLib 7.00
+UPSTREAM_OSLIB_VERSION := oslib-700
UPSTREAM_OSLIB_TARBALL := oslib
-UPSTREAM_OSLIB_URI := https://svn.code.sf.net/p/ro-oslib/code/trunk/!OSLib@$(UPSTREAM_OSLIB_VER...
+UPSTREAM_OSLIB_URI := https://svn.code.sf.net/p/ro-oslib/code/tags/$(UPSTREAM_OSLIB_VERSION)/!O...
-# Ditto for CCRes
+# Known tested version of trunk for CCRes
UPSTREAM_CCRES_VERSION := 96
UPSTREAM_CCRES_TARBALL := ccres
UPSTREAM_CCRES_URI := svn://svn.riscos.info/ccres/trunk@$(UPSTREAM_CCRES_VERSION)
@@ -113,6 +113,9 @@ $(BUILDSTEPS)/oslib.d: $(BUILDSTEPS)/gcc.d $(SOURCESDIR)/$(UPSTREAM_OSLIB_TARBAL
$(BUILDSTEPS)/gcc.d: $(BUILDSTEPS)/gccsdk-srcdir.d
cd $(BUILDDIR)/gcc4 && make
cd $(BUILDDIR)/gcc4 && ./install-env
+ @# Newer GCCSDK adds these trampoline binaries that for us
+ @# serve no purpose and get in the way.
+ $(RM) $(PREFIX)/cross/bin/arm-unknown-riscos-gcc-ar $(PREFIX)/cross/bin/arm-unknown-riscos-gcc-nm $(PREFIX)/cross/bin/arm-unknown-riscos-gcc-ranlib
touch $@
$(BUILDSTEPS)/gccsdk-srcdir.d: $(BUILDSTEPS)/buildsteps.d $(SOURCESDIR)/$(UPSTREAM_GCCSDK_TARBALL)
diff --git a/arm-unknown-riscos/recipes/patches/gcc4/binutils-plugins.p b/arm-unknown-riscos/recipes/patches/gcc4/binutils-plugins.p
new file mode 100644
index 0000000..0dbc257
--- /dev/null
+++ b/arm-unknown-riscos/recipes/patches/gcc4/binutils-plugins.p
@@ -0,0 +1,11 @@
+--- Makefile (revision 6747)
++++ Makefile (working copy)
+@@ -73,7 +73,7 @@
+ --disable-libstdcxx-pch \
+ --disable-tls
+ # FIXME: for Java support: --without-x --enable-libgcj
+-BINUTILS_CONFIG_ARGS :=
++BINUTILS_CONFIG_ARGS := --enable-plugins
+ GDB_CONFIG_ARGS :=
+ else
+ # Case arm-unknown-eabi target (use newlib):
diff --git a/arm-unknown-riscos/recipes/patches/gcc4/binutils-texinfo.p b/arm-unknown-riscos/recipes/patches/gcc4/binutils-texinfo.p
deleted file mode 100644
index e2152cc..0000000
--- a/arm-unknown-riscos/recipes/patches/gcc4/binutils-texinfo.p
+++ /dev/null
@@ -1,365 +0,0 @@
---- recipe/patches/binutils/binutils.texinfo.p
-+++ recipe/patches/binutils/binutils-texinfo.p
-@@ -0,0 +1,362 @@
-+Index: bfd/doc/bfd.texinfo
-+===================================================================
-+RCS file: /cvs/src/src/bfd/doc/bfd.texinfo,v
-+retrieving revision 1.18
-+diff -u -r1.18 bfd.texinfo
-+--- bfd/doc/bfd.texinfo 28 Oct 2010 11:40:25 -0000 1.18
-++++ bfd/doc/bfd.texinfo 15 Nov 2014 18:00:35 -0000
-+@@ -322,7 +322,7 @@
-+ @printindex cp
-+
-+ @tex
-+-% I think something like @colophon should be in texinfo. In the
-++% I think something like @@colophon should be in texinfo. In the
-+ % meantime:
-+ \long\def\colophon{\hbox to0pt{}\vfill
-+ \centerline{The body of this manual is set in}
-+@@ -333,7 +333,7 @@
-+ \centerline{{\sl\fontname\tensl\/}}
-+ \centerline{are used for emphasis.}\vfill}
-+ \page\colophon
-+-% Blame: doc(a)cygnus.com, 28mar91.
-++% Blame: doc@@cygnus.com, 28mar91.
-+ @end tex
-+
-+ @bye
-+Index: binutils/doc/binutils.texi
-+===================================================================
-+RCS file: /cvs/src/src/binutils/doc/binutils.texi,v
-+retrieving revision 1.173
-+diff -u -r1.173 binutils.texi
-+--- binutils/doc/binutils.texi 29 Oct 2010 12:10:32 -0000 1.173
-++++ binutils/doc/binutils.texi 15 Nov 2014 18:00:36 -0000
-+@@ -4188,28 +4188,28 @@
-+
-+ @table @env
-+
-+-@itemx --input-mach=@var{machine}
-++@item --input-mach=@var{machine}
-+ Set the matching input ELF machine type to @var{machine}. If
-+ @option{--input-mach} isn't specified, it will match any ELF
-+ machine types.
-+
-+ The supported ELF machine types are, @var{L1OM} and @var{x86-64}.
-+
-+-@itemx --output-mach=@var{machine}
-++@item --output-mach=@var{machine}
-+ Change the ELF machine type in the ELF header to @var{machine}. The
-+ supported ELF machine types are the same as @option{--input-mach}.
-+
-+-@itemx --input-type=@var{type}
-++@item --input-type=@var{type}
-+ Set the matching input ELF file type to @var{type}. If
-+ @option{--input-type} isn't specified, it will match any ELF file types.
-+
-+ The supported ELF file types are, @var{rel}, @var{exec} and @var{dyn}.
-+
-+-@itemx --output-type=@var{type}
-++@item --output-type=@var{type}
-+ Change the ELF file type in the ELF header to @var{type}. The
-+ supported ELF types are the same as @option{--input-type}.
-+
-+-@itemx --input-osabi=@var{osabi}
-++@item --input-osabi=@var{osabi}
-+ Set the matching input ELF file OSABI to @var{osbi}. If
-+ @option{--input-osabi} isn't specified, it will match any ELF OSABIs.
-+
-+@@ -4218,7 +4218,7 @@
-+ @var{FreeBSD}, @var{TRU64}, @var{Modesto}, @var{OpenBSD}, @var{OpenVMS},
-+ @var{NSK}, @var{AROS} and @var{FenixOS}.
-+
-+-@itemx --output-osabi=@var{osabi}
-++@item --output-osabi=@var{osabi}
-+ Change the ELF OSABI in the ELF header to @var{type}. The
-+ supported ELF OSABI are the same as @option{--input-osabi}.
-+
-+Index: gas/doc/c-arc.texi
-+===================================================================
-+RCS file: /cvs/src/src/gas/doc/c-arc.texi,v
-+retrieving revision 1.9
-+diff -u -r1.9 c-arc.texi
-+--- gas/doc/c-arc.texi 2 Sep 2009 07:24:21 -0000 1.9
-++++ gas/doc/c-arc.texi 15 Nov 2014 18:00:36 -0000
-+@@ -212,7 +212,7 @@
-+ encodings for use of these instructions according to the specification
-+ by the user. The parameters are:
-+
-+-@table @bullet
-++@itemize @bullet
-+ @item @var{name}
-+ Name of the extension instruction
-+
-+@@ -271,7 +271,7 @@
-+ with SYNTAX_20P.
-+
-+ @end itemize
-+-@end table
-++@end itemize
-+
-+ For example, defining 64-bit multiplier with immediate operands:
-+
-+Index: gas/doc/c-arm.texi
-+===================================================================
-+RCS file: /cvs/src/src/gas/doc/c-arm.texi,v
-+retrieving revision 1.81
-+diff -u -r1.81 c-arm.texi
-+--- gas/doc/c-arm.texi 23 Sep 2010 15:52:18 -0000 1.81
-++++ gas/doc/c-arm.texi 15 Nov 2014 18:00:36 -0000
-+@@ -376,7 +376,7 @@
-+ @code{unified} syntax, which can be selected via the @code{.syntax}
-+ directive, and has the following main features:
-+
-+-@table @bullet
-++@itemize @bullet
-+ @item
-+ Immediate operands do not require a @code{#} prefix.
-+
-+@@ -401,7 +401,7 @@
-+ @item
-+ All instructions set the flags if and only if they have an @code{s}
-+ affix.
-+-@end table
-++@end itemize
-+
-+ @node ARM-Chars
-+ @subsection Special Characters
-+@@ -433,28 +433,6 @@
-+ @cindex register names, ARM
-+ *TODO* Explain about ARM register naming, and the predefined names.
-+
-+-@node ARM-Neon-Alignment
-+-@subsection NEON Alignment Specifiers
-+-
-+-@cindex alignment for NEON instructions
-+-Some NEON load/store instructions allow an optional address
-+-alignment qualifier.
-+-The ARM documentation specifies that this is indicated by
-+-@samp{@@ @var{align}}. However GAS already interprets
-+-the @samp{@@} character as a "line comment" start,
-+-so @samp{: @var{align}} is used instead. For example:
-+-
-+-@smallexample
-+- vld1.8 @{q0@}, [r0, :128]
-+-@end smallexample
-+-
-+-@node ARM Floating Point
-+-@section Floating Point
-+-
-+-@cindex floating point, ARM (@sc{ieee})
-+-@cindex ARM floating point (@sc{ieee})
-+-The ARM family uses @sc{ieee} floating-point numbers.
-+-
-+ @node ARM-Relocations
-+ @subsection ARM relocation generation
-+
-+@@ -497,6 +475,28 @@
-+ MOVT r0, #:upper16:foo
-+ @end smallexample
-+
-++@node ARM-Neon-Alignment
-++@subsection NEON Alignment Specifiers
-++
-++@cindex alignment for NEON instructions
-++Some NEON load/store instructions allow an optional address
-++alignment qualifier.
-++The ARM documentation specifies that this is indicated by
-++@samp{@@ @var{align}}. However GAS already interprets
-++the @samp{@@} character as a "line comment" start,
-++so @samp{: @var{align}} is used instead. For example:
-++
-++@smallexample
-++ vld1.8 @{q0@}, [r0, :128]
-++@end smallexample
-++
-++@node ARM Floating Point
-++@section Floating Point
-++
-++@cindex floating point, ARM (@sc{ieee})
-++@cindex ARM floating point (@sc{ieee})
-++The ARM family uses @sc{ieee} floating-point numbers.
-++
-+ @node ARM Directives
-+ @section ARM Machine Directives
-+
-+Index: gas/doc/c-cr16.texi
-+===================================================================
-+RCS file: /cvs/src/src/gas/doc/c-cr16.texi,v
-+retrieving revision 1.3
-+diff -u -r1.3 c-cr16.texi
-+--- gas/doc/c-cr16.texi 2 Sep 2009 07:24:21 -0000 1.3
-++++ gas/doc/c-cr16.texi 15 Nov 2014 18:00:36 -0000
-+@@ -43,26 +43,26 @@
-+ CR16 target operand qualifiers and its size (in bits):
-+
-+ @table @samp
-+-@item Immediate Operand
-+-- s ---- 4 bits
-+-@item
-+-- m ---- 16 bits, for movb and movw instructions.
-+-@item
-+-- m ---- 20 bits, movd instructions.
-+-@item
-+-- l ---- 32 bits
-+-
-+-@item Absolute Operand
-+-- s ---- Illegal specifier for this operand.
-+-@item
-+-- m ---- 20 bits, movd instructions.
-+-
-+-@item Displacement Operand
-+-- s ---- 8 bits
-+-@item
-+-- m ---- 16 bits
-+-@item
-+-- l ---- 24 bits
-++@item Immediate Operand: s
-++4 bits
-++@item Immediate Operand: m
-++16 bits, for movb and movw instructions.
-++@item Immediate Operand: m
-++20 bits, movd instructions.
-++@item Immediate Operand: l
-++32 bits
-++
-++@item Absolute Operand: s
-++Illegal specifier for this operand.
-++@item Absolute Operand: m
-++20 bits, movd instructions.
-++
-++@item Displacement Operand: s
-++8 bits
-++@item Displacement Operand: m
-++16 bits
-++@item Displacement Operand: l
-++24 bits
-+ @end table
-+
-+ For example:
-+Index: gas/doc/c-mips.texi
-+===================================================================
-+RCS file: /cvs/src/src/gas/doc/c-mips.texi,v
-+retrieving revision 1.56
-+diff -u -r1.56 c-mips.texi
-+--- gas/doc/c-mips.texi 4 Oct 2010 15:24:48 -0000 1.56
-++++ gas/doc/c-mips.texi 15 Nov 2014 18:00:36 -0000
-+@@ -220,7 +220,7 @@
-+ instructions around accesses to the @samp{HI} and @samp{LO} registers.
-+ @samp{-no-m4650} turns off this option.
-+
-+-@itemx -m3900
-++@item -m3900
-+ @itemx -no-m3900
-+ @itemx -m4100
-+ @itemx -no-m4100
-+Index: gas/doc/c-score.texi
-+===================================================================
-+RCS file: /cvs/src/src/gas/doc/c-score.texi,v
-+retrieving revision 1.1
-+diff -u -r1.1 c-score.texi
-+--- gas/doc/c-score.texi 2 Mar 2009 10:33:07 -0000 1.1
-++++ gas/doc/c-score.texi 15 Nov 2014 18:00:36 -0000
-+@@ -36,7 +36,7 @@
-+ @item -EB
-+ Assemble code for a big-endian cpu
-+
-+-@itemx -EL
-++@item -EL
-+ Assemble code for a little-endian cpu
-+
-+ @item -FIXDD
-+@@ -48,13 +48,13 @@
-+ @item -SCORE5
-+ Assemble code for target is SCORE5
-+
-+-@itemx -SCORE5U
-++@item -SCORE5U
-+ Assemble code for target is SCORE5U
-+
-+-@itemx -SCORE7
-++@item -SCORE7
-+ Assemble code for target is SCORE7, this is default setting
-+
-+-@itemx -SCORE3
-++@item -SCORE3
-+ Assemble code for target is SCORE3
-+
-+ @item -march=score7
-+Index: gas/doc/c-tic54x.texi
-+===================================================================
-+RCS file: /cvs/src/src/gas/doc/c-tic54x.texi,v
-+retrieving revision 1.8
-+diff -u -r1.8 c-tic54x.texi
-+--- gas/doc/c-tic54x.texi 21 Jun 2010 10:49:41 -0000 1.8
-++++ gas/doc/c-tic54x.texi 15 Nov 2014 18:00:36 -0000
-+@@ -108,7 +108,7 @@
-+ is replaced with x. At this point, x has already been encountered
-+ and the substitution stops.
-+
-+-@smallexample @code
-++@smallexample
-+ .asg "x",SYM1
-+ .asg "SYM1",SYM2
-+ .asg "SYM2",x
-+@@ -125,14 +125,14 @@
-+ ambiguous by placing colons on either side of the subsym. The following
-+ code:
-+
-+-@smallexample @code
-++@smallexample
-+ .eval "10",x
-+ LAB:X: add #x, a
-+ @end smallexample
-+
-+ When assembled becomes:
-+
-+-@smallexample @code
-++@smallexample
-+ LAB10 add #10, a
-+ @end smallexample
-+
-+@@ -308,7 +308,7 @@
-+ of a label or address. For example, if an address @code{_label} resides
-+ in extended program memory, the value of @code{_label} may be loaded as
-+ follows:
-+-@smallexample @code
-++@smallexample
-+ ldx #_label,16,a ; loads extended bits of _label
-+ or #_label,a ; loads lower 16 bits of _label
-+ bacc a ; full address is in accumulator A
-+@@ -344,7 +344,7 @@
-+ performed on @var{string} before assignment.
-+
-+ @cindex @code{eval} directive, TIC54X
-+-@itemx .eval @var{string}, @var{name}
-++@item .eval @var{string}, @var{name}
-+ Evaluate the contents of string @var{string} and assign the result as a
-+ string to the subsym @var{name}. String replacement is performed on
-+ @var{string} before assignment.
-+Index: ld/ld.texinfo
-+===================================================================
-+RCS file: /cvs/src/src/ld/ld.texinfo,v
-+retrieving revision 1.267
-+diff -u -r1.267 ld.texinfo
-+--- ld/ld.texinfo 28 Oct 2010 11:40:26 -0000 1.267
-++++ ld/ld.texinfo 15 Nov 2014 18:00:37 -0000
-+@@ -7682,7 +7682,7 @@
-+ @printindex cp
-+
-+ @tex
-+-% I think something like @colophon should be in texinfo. In the
-++% I think something like @@colophon should be in texinfo. In the
-+ % meantime:
-+ \long\def\colophon{\hbox to0pt{}\vfill
-+ \centerline{The body of this manual is set in}
-+@@ -7693,7 +7693,7 @@
-+ \centerline{{\sl\fontname\tensl\/}}
-+ \centerline{are used for emphasis.}\vfill}
-+ \page\colophon
-+-% Blame: doc(a)cygnus.com, 28mar91.
-++% Blame: doc@@cygnus.com, 28mar91.
-+ @end tex
-+
-+ @bye
diff --git a/arm-unknown-riscos/recipes/patches/oslib/defmod-size.p b/arm-unknown-riscos/recipes/patches/oslib/defmod-size.p
deleted file mode 100644
index 0dbe828..0000000
--- a/arm-unknown-riscos/recipes/patches/oslib/defmod-size.p
+++ /dev/null
@@ -1,15 +0,0 @@
-Index: Tools/DefMod2/assembler.c
-===================================================================
---- Tools/DefMod2/assembler.c (revision 402)
-+++ Tools/DefMod2/assembler.c (working copy)
-@@ -880,8 +880,8 @@
- if (DoELF)
- {
- /* Define size of function body. */
-- sprintf (s2, ". - %s", c_name + (!nonx? 1: 0));
-- if ((rc = Emit2 (file, ".size", c_name + (!nonx? 1: 0), s2)) < 0)
-+ sprintf (s2, ". - %s", c_name);
-+ if ((rc = Emit2 (file, ".size", c_name, s2)) < 0)
- goto finish;
- }
-
--
Cross-compilation toolchains and environments
8 years, 5 months
libcss: branch master updated. release/0.4.0-42-gaef7e38
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libcss.git/shortlog/aef7e38a578de7ba43a298...
...commit http://git.netsurf-browser.org/libcss.git/commit/aef7e38a578de7ba43a2987d...
...tree http://git.netsurf-browser.org/libcss.git/tree/aef7e38a578de7ba43a2987d88...
The branch, master has been updated
via aef7e38a578de7ba43a2987d889a554df3be7277 (commit)
from 8dfbff7765940524bbcf9a75f0cdb20f29d99842 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=aef7e38a578de7ba43a2...
commit aef7e38a578de7ba43a2987d889a554df3be7277
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Fix use of wrong enum value.
Coverity: 1257106 Inferred misuse of enum.
diff --git a/src/select/properties/column_count.c b/src/select/properties/column_count.c
index ecee5f3..92fdec2 100644
--- a/src/select/properties/column_count.c
+++ b/src/select/properties/column_count.c
@@ -63,7 +63,7 @@ css_error css__compose_column_count(const css_computed_style *parent,
type == CSS_COLUMN_COUNT_INHERIT ||
(child->uncommon != NULL && result != child)) {
if ((child->uncommon == NULL && parent->uncommon != NULL) ||
- type == CSS_OUTLINE_COLOR_INHERIT) {
+ type == CSS_COLUMN_COUNT_INHERIT) {
type = get_column_count(parent, &count);
}
-----------------------------------------------------------------------
Summary of changes:
src/select/properties/column_count.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/select/properties/column_count.c b/src/select/properties/column_count.c
index ecee5f3..92fdec2 100644
--- a/src/select/properties/column_count.c
+++ b/src/select/properties/column_count.c
@@ -63,7 +63,7 @@ css_error css__compose_column_count(const css_computed_style *parent,
type == CSS_COLUMN_COUNT_INHERIT ||
(child->uncommon != NULL && result != child)) {
if ((child->uncommon == NULL && parent->uncommon != NULL) ||
- type == CSS_OUTLINE_COLOR_INHERIT) {
+ type == CSS_COLUMN_COUNT_INHERIT) {
type = get_column_count(parent, &count);
}
--
Cascading Style Sheets library
8 years, 5 months
libdom: branch master updated. release/0.1.1-5-gada8b3c
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libdom.git/shortlog/ada8b3c6abeaa2d08c3ed1...
...commit http://git.netsurf-browser.org/libdom.git/commit/ada8b3c6abeaa2d08c3ed1c3...
...tree http://git.netsurf-browser.org/libdom.git/tree/ada8b3c6abeaa2d08c3ed1c349...
The branch, master has been updated
via ada8b3c6abeaa2d08c3ed1c349bdade4843a028c (commit)
from e580b0f59fb7868578dcb2b10fbd32bd60673f37 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/libdom.git/commit/?id=ada8b3c6abeaa2d08c3e...
commit ada8b3c6abeaa2d08c3ed1c349bdade4843a028c
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Ensure all the library dependancies are listed
diff --git a/README b/README
index 6baa85d..b416c8d 100644
--- a/README
+++ b/README
@@ -4,41 +4,58 @@ LibDOM -- an implementation of the W3C DOM
Overview
--------
- LibDOM is an implementation of the W3C DOM API in C.
+LibDOM is an implementation of the W3C DOM API in C.
+
Requirements
------------
- libdom requires the following tools:
+The library uses the Netsurf core buildsystem which must be available
+(usually at the same level as the libsvg source)
+
+The PREFIX variable can be used to perform builds which do not install
+to global system paths.
+
+libdom requires the following tools:
- + A C99 capable C compiler
- + GNU make or compatible
- + Perl (for the testcases)
+ - A C99 capable C compiler
+ - GNU make or compatible
+ - Perl (for the testcases)
- LibDOM also requires the following libraries to be installed:
+LibDOM also requires the following libraries to be installed:
+
+ - LibParserUtils
+ - LibWapcaplet
+ - LibHubbub
- + LibParserUtils
- + LibWapcaplet
Compilation
-----------
- If necessary, modify the toolchain settings in the Makefile.
- Invoke make:
- $ make
+If necessary, modify the toolchain settings in the Makefile.
+
+Invoke make:
+
+ make
+
+The VARIANT variable allows builds for "release" (the default) and "debug"
+e.g.
+
+ make VARIANT=debug
+
Verification
------------
- To verify that the library is working, it is necessary to specify a
- different makefile target than that used for normal compilation, thus:
-
- $ make test
+To verify that the library is working, it is necessary to specify a
+different makefile target than that used for normal compilation, thus:
+
+ make test
+
API documentation
-----------------
- Currently, there is none. However, the code is well commented and the
- public API may be found in the "include" directory. The testcase sources
- may also be of use in working out how to use it.
-
+Currently, there is none. However, the code is well commented and the
+public API may be found in the "include" directory. The testcase
+sources may also be of use in working out how to use it.
-----------------------------------------------------------------------
Summary of changes:
README | 55 ++++++++++++++++++++++++++++++++++++-------------------
1 file changed, 36 insertions(+), 19 deletions(-)
diff --git a/README b/README
index 6baa85d..b416c8d 100644
--- a/README
+++ b/README
@@ -4,41 +4,58 @@ LibDOM -- an implementation of the W3C DOM
Overview
--------
- LibDOM is an implementation of the W3C DOM API in C.
+LibDOM is an implementation of the W3C DOM API in C.
+
Requirements
------------
- libdom requires the following tools:
+The library uses the Netsurf core buildsystem which must be available
+(usually at the same level as the libsvg source)
+
+The PREFIX variable can be used to perform builds which do not install
+to global system paths.
+
+libdom requires the following tools:
- + A C99 capable C compiler
- + GNU make or compatible
- + Perl (for the testcases)
+ - A C99 capable C compiler
+ - GNU make or compatible
+ - Perl (for the testcases)
- LibDOM also requires the following libraries to be installed:
+LibDOM also requires the following libraries to be installed:
+
+ - LibParserUtils
+ - LibWapcaplet
+ - LibHubbub
- + LibParserUtils
- + LibWapcaplet
Compilation
-----------
- If necessary, modify the toolchain settings in the Makefile.
- Invoke make:
- $ make
+If necessary, modify the toolchain settings in the Makefile.
+
+Invoke make:
+
+ make
+
+The VARIANT variable allows builds for "release" (the default) and "debug"
+e.g.
+
+ make VARIANT=debug
+
Verification
------------
- To verify that the library is working, it is necessary to specify a
- different makefile target than that used for normal compilation, thus:
-
- $ make test
+To verify that the library is working, it is necessary to specify a
+different makefile target than that used for normal compilation, thus:
+
+ make test
+
API documentation
-----------------
- Currently, there is none. However, the code is well commented and the
- public API may be found in the "include" directory. The testcase sources
- may also be of use in working out how to use it.
-
+Currently, there is none. However, the code is well commented and the
+public API may be found in the "include" directory. The testcase
+sources may also be of use in working out how to use it.
--
Document Object Model library
8 years, 5 months
libsvgtiny: branch master updated. release/0.1.2-5-g7ec0aa7
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libsvgtiny.git/shortlog/7ec0aa7b69d32f2a54...
...commit http://git.netsurf-browser.org/libsvgtiny.git/commit/7ec0aa7b69d32f2a5456...
...tree http://git.netsurf-browser.org/libsvgtiny.git/tree/7ec0aa7b69d32f2a545636...
The branch, master has been updated
via 7ec0aa7b69d32f2a545636f7dfbe31641d97d1fa (commit)
from f1a5f385e119571a565443aaff08d127991c0966 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/libsvgtiny.git/commit/?id=7ec0aa7b69d32f2a...
commit 7ec0aa7b69d32f2a545636f7dfbe31641d97d1fa
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Update README to cover dependancies and core buildsystem
Fix various issues with the test target and update the documentation
to be more correct.
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..f2fe5f6
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,19 @@
+Copyright 2007 James Bursa <james(a)netsurf-browser.org>.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+ * The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/README b/README
index a728006..3c5095a 100644
--- a/README
+++ b/README
@@ -1,34 +1,37 @@
Libsvgtiny
==========
+
http://www.netsurf-browser.org/projects/libsvgtiny/
Libsvgtiny is a library for parsing SVG files for display.
-The overall idea of the library is to take some SVG as input, and return a list
-of paths and texts which can be rendered easily. The library does not do the
-actual rendering.
+The overall idea of the library is to take some SVG as input, and
+return a list of paths and texts which can be rendered easily. The
+library does not do the actual rendering.
-All supported SVG objects, for example circles, lines, and gradient filled
-shapes, are converted to flat-filled paths or a fragment of text, and all
-coordinates are converted, transformed etc. to pixels.
+All supported SVG objects, for example circles, lines, and gradient
+filled shapes, are converted to flat-filled paths or a fragment of
+text, and all coordinates are converted, transformed etc. to pixels.
Libsvgtiny is Licensed under the MIT License,
http://opensource.org/licenses/mit-license.php
Written by James Bursa <james(a)netsurf-browser.org>.
+
SVG support
-----------
+
Libsvgtiny is initially aiming to implement SVG Tiny, as defined in
http://www.w3.org/TR/SVGMobile/.
SVG Tiny elements supported: defs, g, svg, circle, line, path, polygon,
polyline, rect, text
-SVG Tiny elements not yet supported: desc, metadata, title, use, a, switch,
-ellipse, image, font, font-face, font-face-name, font-face-src, glyph, hkern,
-missing-glyph, animate, animateColor, animateMotion, animateTransform, mpath,
-set, foreignObject
+SVG Tiny elements not yet supported: desc, metadata, title, use, a,
+switch, ellipse, image, font, font-face, font-face-name, font-face-src,
+glyph, hkern, missing-glyph, animate, animateColor, animateMotion,
+animateTransform, mpath, set, foreignObject
Additional elements supported: linearGradient, stop
@@ -36,16 +39,25 @@ Text support is incomplete.
The style attribute is supported.
+
Building libsvgtiny
-------------------
+
+The library uses the Netsurf core buildsystem which must be available
+(usually at the same level as the libsvg source)
+
+The PREFIX variable can be used to perform builds which do not install
+to global system paths.
+
You will require the following tools:
-- a C compiler (some parts of C99 support are required)
-- gperf
+ - a C compiler (some parts of C99 support are required)
+ - gperf
-and the following libraries:
+following additional libraries are required:
-- libxml2
+ - libwapcaplet
+ - libdom
To compile libsvgtiny, use the command
@@ -55,18 +67,26 @@ To install libsvgtiny into /usr/local, use
make install
-To cross-compile for RISC OS, use
+The VARIANT variable allows builds for "release" (the default) and "debug"
+e.g.
+
+ make VARIANT=debug
- make TARGET=riscos
- make install TARGET=riscos
Testing libsvgtiny
------------------
-The svgtiny_display script uses the library to render an SVG. It requires that
-ImageMagick convert is installed.
-Get an SVG file, for example
-http://www.croczilla.com/svg/samples/tiger/tiger.svg
+The core buildsystem provides a test target which performs basic checks
+
+ make test
+
+For manual testing a svgtiny_display script is available which renders
+an svg to a bitmap. This script uses the svgtiny_test program to
+render an SVG to an imagemagic MVG. It requires that ImageMagick
+convert is installed to convert the MVG into a bitmap.
+
+Get an suitable SVG file, for example the tiger svg can be found in
+the examples directory or downloaded [1]
Then use svgtiny_display to parse and render it:
@@ -75,8 +95,10 @@ Then use svgtiny_display to parse and render it:
The optional 2nd argument is a scale.
+
Using libsvgtiny
----------------
+
The interface is in the header svgtiny.h
#include <svgtiny.h>
@@ -94,19 +116,20 @@ SVGs are parsed from memory using svgtiny_parse():
svgtiny_code code;
code = svgtiny_parse(diagram, buffer, size, url, 1000, 1000);
-The arguments are the pointer returned by svgtiny_create(), a buffer containing
-the SVG data, the size of the SVG in bytes, the url that the SVG came from, and
-the target viewport width and height in pixels.
+The arguments are the pointer returned by svgtiny_create(), a buffer
+containing the SVG data, the size of the SVG in bytes, the url that
+the SVG came from, and the target viewport width and height in pixels.
-The function returns svgtiny_OK if there were no problems, and diagram is
-updated. The diagram can then be rendered by looping through the array
-diagram->shape[0..diagram->shape_count]:
+The function returns svgtiny_OK if there were no problems, and diagram
+is updated. The diagram can then be rendered by looping through the
+array diagram->shape[0..diagram->shape_count]:
for (unsigned int i = 0; i != diagram->shape_count; i++) {
-Path shapes have a non-NULL path pointer. The path is an array of floats of
-length path_length. The array contains segment type codes followed by 0 to 3
-pairs of coordinates (depending on the segment type):
+Path shapes have a non-NULL path pointer. The path is an array of
+floats of length path_length. The array contains segment type codes
+followed by 0 to 3 pairs of coordinates (depending on the segment
+type):
- svgtiny_PATH_MOVE x y
- svgtiny_PATH_CLOSE
@@ -116,28 +139,30 @@ pairs of coordinates (depending on the segment type):
A path always starts with a MOVE.
The fill and stroke attributes give the colors of the path, or
-svgtiny_TRANSPARENT if the path is not filled or stroked. Colors are in 0xRRGGBB
-format (except when compiled for RISC OS). The macros svgtiny_RED,
-svgtiny_GREEN, and svgtiny_BLUE can be used to extract the components.
+svgtiny_TRANSPARENT if the path is not filled or stroked. Colors are
+in 0xRRGGBB format (except when compiled for RISC OS). The macros
+svgtiny_RED, svgtiny_GREEN, and svgtiny_BLUE can be used to extract
+the components.
The width of the path is in stroke_width.
-Text shapes have a NULL path pointer and a non-NULL text pointer. Text is in
-UTF-8. The coordinates of the text are in text_x, text_y. Text colors and stroke
-width are as for paths.
+Text shapes have a NULL path pointer and a non-NULL text pointer. Text
+is in UTF-8. The coordinates of the text are in text_x, text_y. Text
+colors and stroke width are as for paths.
If memory runs out during parsing, svgtiny_parse() returns
-svgtiny_OUT_OF_MEMORY, but the diagram is still valid up to the point when
-memory was exhausted, and may safely be rendered.
+svgtiny_OUT_OF_MEMORY, but the diagram is still valid up to the point
+when memory was exhausted, and may safely be rendered.
-If there is an error in the SVG (for example, an element is missing an attribute
-required by the specification), svgtiny_SVG_ERROR is returned, but the diagram
-is still valid up to the point of the error. The error is recorded in
-diagram->error_message and the line that caused it in diagram->error_line.
+If there is an error in the SVG (for example, an element is missing an
+attribute required by the specification), svgtiny_SVG_ERROR is
+returned, but the diagram is still valid up to the point of the
+error. The error is recorded in diagram->error_message and the line
+that caused it in diagram->error_line.
-svgtiny_LIBXML_ERROR indicates that parsing the XML failed. The returned diagram
-will contain no shapes. svgtiny_NOT_SVG means that the XML did not contain a
-top-level <svg> element.
+svgtiny_LIBXML_ERROR indicates that parsing the XML failed. The
+returned diagram will contain no shapes. svgtiny_NOT_SVG means that
+the XML did not contain a top-level <svg> element.
To free memory used by a diagram, use svgtiny_free():
@@ -146,4 +171,4 @@ To free memory used by a diagram, use svgtiny_free():
For an example, see svgtiny_test.c.
-
+[1] http://upload.wikimedia.org/wikipedia/commons/f/fd/Ghostscript_Tiger.svg
diff --git a/svgtiny_display b/svgtiny_display
index 2b7415d..dbae8e7 100755
--- a/svgtiny_display
+++ b/svgtiny_display
@@ -1,3 +1,3 @@
set -e
-make BUILD=debug test
+make VARIANT=debug test
build-Linux-Linux-debug-lib-static/test_svgtiny_test $1 $2 | convert mvg:- png:- | display -
-----------------------------------------------------------------------
Summary of changes:
COPYING | 19 +++++++++
README | 117 +++++++++++++++++++++++++++++++++----------------------
svgtiny_display | 2 +-
3 files changed, 91 insertions(+), 47 deletions(-)
create mode 100644 COPYING
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..f2fe5f6
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,19 @@
+Copyright 2007 James Bursa <james(a)netsurf-browser.org>.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+ * The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/README b/README
index a728006..3c5095a 100644
--- a/README
+++ b/README
@@ -1,34 +1,37 @@
Libsvgtiny
==========
+
http://www.netsurf-browser.org/projects/libsvgtiny/
Libsvgtiny is a library for parsing SVG files for display.
-The overall idea of the library is to take some SVG as input, and return a list
-of paths and texts which can be rendered easily. The library does not do the
-actual rendering.
+The overall idea of the library is to take some SVG as input, and
+return a list of paths and texts which can be rendered easily. The
+library does not do the actual rendering.
-All supported SVG objects, for example circles, lines, and gradient filled
-shapes, are converted to flat-filled paths or a fragment of text, and all
-coordinates are converted, transformed etc. to pixels.
+All supported SVG objects, for example circles, lines, and gradient
+filled shapes, are converted to flat-filled paths or a fragment of
+text, and all coordinates are converted, transformed etc. to pixels.
Libsvgtiny is Licensed under the MIT License,
http://opensource.org/licenses/mit-license.php
Written by James Bursa <james(a)netsurf-browser.org>.
+
SVG support
-----------
+
Libsvgtiny is initially aiming to implement SVG Tiny, as defined in
http://www.w3.org/TR/SVGMobile/.
SVG Tiny elements supported: defs, g, svg, circle, line, path, polygon,
polyline, rect, text
-SVG Tiny elements not yet supported: desc, metadata, title, use, a, switch,
-ellipse, image, font, font-face, font-face-name, font-face-src, glyph, hkern,
-missing-glyph, animate, animateColor, animateMotion, animateTransform, mpath,
-set, foreignObject
+SVG Tiny elements not yet supported: desc, metadata, title, use, a,
+switch, ellipse, image, font, font-face, font-face-name, font-face-src,
+glyph, hkern, missing-glyph, animate, animateColor, animateMotion,
+animateTransform, mpath, set, foreignObject
Additional elements supported: linearGradient, stop
@@ -36,16 +39,25 @@ Text support is incomplete.
The style attribute is supported.
+
Building libsvgtiny
-------------------
+
+The library uses the Netsurf core buildsystem which must be available
+(usually at the same level as the libsvg source)
+
+The PREFIX variable can be used to perform builds which do not install
+to global system paths.
+
You will require the following tools:
-- a C compiler (some parts of C99 support are required)
-- gperf
+ - a C compiler (some parts of C99 support are required)
+ - gperf
-and the following libraries:
+following additional libraries are required:
-- libxml2
+ - libwapcaplet
+ - libdom
To compile libsvgtiny, use the command
@@ -55,18 +67,26 @@ To install libsvgtiny into /usr/local, use
make install
-To cross-compile for RISC OS, use
+The VARIANT variable allows builds for "release" (the default) and "debug"
+e.g.
+
+ make VARIANT=debug
- make TARGET=riscos
- make install TARGET=riscos
Testing libsvgtiny
------------------
-The svgtiny_display script uses the library to render an SVG. It requires that
-ImageMagick convert is installed.
-Get an SVG file, for example
-http://www.croczilla.com/svg/samples/tiger/tiger.svg
+The core buildsystem provides a test target which performs basic checks
+
+ make test
+
+For manual testing a svgtiny_display script is available which renders
+an svg to a bitmap. This script uses the svgtiny_test program to
+render an SVG to an imagemagic MVG. It requires that ImageMagick
+convert is installed to convert the MVG into a bitmap.
+
+Get an suitable SVG file, for example the tiger svg can be found in
+the examples directory or downloaded [1]
Then use svgtiny_display to parse and render it:
@@ -75,8 +95,10 @@ Then use svgtiny_display to parse and render it:
The optional 2nd argument is a scale.
+
Using libsvgtiny
----------------
+
The interface is in the header svgtiny.h
#include <svgtiny.h>
@@ -94,19 +116,20 @@ SVGs are parsed from memory using svgtiny_parse():
svgtiny_code code;
code = svgtiny_parse(diagram, buffer, size, url, 1000, 1000);
-The arguments are the pointer returned by svgtiny_create(), a buffer containing
-the SVG data, the size of the SVG in bytes, the url that the SVG came from, and
-the target viewport width and height in pixels.
+The arguments are the pointer returned by svgtiny_create(), a buffer
+containing the SVG data, the size of the SVG in bytes, the url that
+the SVG came from, and the target viewport width and height in pixels.
-The function returns svgtiny_OK if there were no problems, and diagram is
-updated. The diagram can then be rendered by looping through the array
-diagram->shape[0..diagram->shape_count]:
+The function returns svgtiny_OK if there were no problems, and diagram
+is updated. The diagram can then be rendered by looping through the
+array diagram->shape[0..diagram->shape_count]:
for (unsigned int i = 0; i != diagram->shape_count; i++) {
-Path shapes have a non-NULL path pointer. The path is an array of floats of
-length path_length. The array contains segment type codes followed by 0 to 3
-pairs of coordinates (depending on the segment type):
+Path shapes have a non-NULL path pointer. The path is an array of
+floats of length path_length. The array contains segment type codes
+followed by 0 to 3 pairs of coordinates (depending on the segment
+type):
- svgtiny_PATH_MOVE x y
- svgtiny_PATH_CLOSE
@@ -116,28 +139,30 @@ pairs of coordinates (depending on the segment type):
A path always starts with a MOVE.
The fill and stroke attributes give the colors of the path, or
-svgtiny_TRANSPARENT if the path is not filled or stroked. Colors are in 0xRRGGBB
-format (except when compiled for RISC OS). The macros svgtiny_RED,
-svgtiny_GREEN, and svgtiny_BLUE can be used to extract the components.
+svgtiny_TRANSPARENT if the path is not filled or stroked. Colors are
+in 0xRRGGBB format (except when compiled for RISC OS). The macros
+svgtiny_RED, svgtiny_GREEN, and svgtiny_BLUE can be used to extract
+the components.
The width of the path is in stroke_width.
-Text shapes have a NULL path pointer and a non-NULL text pointer. Text is in
-UTF-8. The coordinates of the text are in text_x, text_y. Text colors and stroke
-width are as for paths.
+Text shapes have a NULL path pointer and a non-NULL text pointer. Text
+is in UTF-8. The coordinates of the text are in text_x, text_y. Text
+colors and stroke width are as for paths.
If memory runs out during parsing, svgtiny_parse() returns
-svgtiny_OUT_OF_MEMORY, but the diagram is still valid up to the point when
-memory was exhausted, and may safely be rendered.
+svgtiny_OUT_OF_MEMORY, but the diagram is still valid up to the point
+when memory was exhausted, and may safely be rendered.
-If there is an error in the SVG (for example, an element is missing an attribute
-required by the specification), svgtiny_SVG_ERROR is returned, but the diagram
-is still valid up to the point of the error. The error is recorded in
-diagram->error_message and the line that caused it in diagram->error_line.
+If there is an error in the SVG (for example, an element is missing an
+attribute required by the specification), svgtiny_SVG_ERROR is
+returned, but the diagram is still valid up to the point of the
+error. The error is recorded in diagram->error_message and the line
+that caused it in diagram->error_line.
-svgtiny_LIBXML_ERROR indicates that parsing the XML failed. The returned diagram
-will contain no shapes. svgtiny_NOT_SVG means that the XML did not contain a
-top-level <svg> element.
+svgtiny_LIBXML_ERROR indicates that parsing the XML failed. The
+returned diagram will contain no shapes. svgtiny_NOT_SVG means that
+the XML did not contain a top-level <svg> element.
To free memory used by a diagram, use svgtiny_free():
@@ -146,4 +171,4 @@ To free memory used by a diagram, use svgtiny_free():
For an example, see svgtiny_test.c.
-
+[1] http://upload.wikimedia.org/wikipedia/commons/f/fd/Ghostscript_Tiger.svg
diff --git a/svgtiny_display b/svgtiny_display
index 2b7415d..dbae8e7 100755
--- a/svgtiny_display
+++ b/svgtiny_display
@@ -1,3 +1,3 @@
set -e
-make BUILD=debug test
+make VARIANT=debug test
build-Linux-Linux-debug-lib-static/test_svgtiny_test $1 $2 | convert mvg:- png:- | display -
--
NetSurf SVG decoder
8 years, 5 months
libcss: branch master updated. release/0.4.0-41-g8dfbff7
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libcss.git/shortlog/8dfbff7765940524bbcf9a...
...commit http://git.netsurf-browser.org/libcss.git/commit/8dfbff7765940524bbcf9a75...
...tree http://git.netsurf-browser.org/libcss.git/tree/8dfbff7765940524bbcf9a75f0...
The branch, master has been updated
via 8dfbff7765940524bbcf9a75f0cdb20f29d99842 (commit)
via 9248aaad8d0d90bc6f9caaf8c2b797b93ba4850f (commit)
via bc3b3725b51f894ad4fe736f250c917b586beada (commit)
via 67f46d5236f378027eca06486251a69a3969dc98 (commit)
via 334f4f873581f72751bfd1b0de0496a69d282b48 (commit)
via 0cab24ffcbe59104967362219f3c831c84681f7e (commit)
via 2bbbe9050fb449276e6230ce0c2b0353d04b587c (commit)
via c7d629a54b94454f470885f0bd1a0769907e067b (commit)
via d4cafaf627dd7ceb1a1dfd8292323c4b474ec57c (commit)
via 0e2da043cbfe4f4df8e7978c52aa919199925424 (commit)
via 88d36bd6f7bb38e3f8fe6ff0e15f7876afe7a2d0 (commit)
via 34271c0f32bca359af8f7a6c40f166d402b78eb6 (commit)
via 34fc236550a686d947458a2ce7f9a081b2b6d22c (commit)
via b353e6a7935dec696eaac463132005f2c4e6f67f (commit)
via 32d6b37b16f9c8a840ccc2b6d4d7ef4b706097f4 (commit)
via 9914d06fcc48c87a46d47e6a47ffb80817981258 (commit)
via 3cb7a56c6e0c6abce0b61a4f9169e31dbe2615b4 (commit)
via 2e1c5c54e1a14d1ea89829f84f5b46d5cb593808 (commit)
via b8f5a46346fab991dd385ea10a585f96b8948c7f (commit)
via f30a2de02b63140a4f8194419cef20c7375d6756 (commit)
via 4f240a620321b64354f64d07b382fdf3caa09109 (commit)
via e12b2fe9078be45e0d0cbcbeb9e725e054eff9f9 (commit)
via a2b959b31cb146e5dfe7cfc2f5ebdc299535c950 (commit)
via 9311b3d167a3e5b69e1cfbb388a35c68a6848059 (commit)
via 9a2ff99021a4872bf3aaa15d3b4e293442c196b1 (commit)
via f536ddb7ad859cc95c96b733a96a83774333d321 (commit)
via ad85983173b7cf21c5b46f7fb3798afdb38e9fea (commit)
via a5c3cbf24c7112238643b58b346d6169ef904881 (commit)
via a89f22e914af738de5f6c8097c1f091836ed79c1 (commit)
via 692a03f5545fbdf9d104f3bd585cec8bf3d7b8cd (commit)
via fa4d9a7560d7cf25affce86a51f6410430a4e63b (commit)
via d250b1019c669478cf462b64ca060e7aedb5def1 (commit)
via 121504a4a2b0f8d1e16e507ca71916479c0e5c69 (commit)
via 45e6f65d4365f0a8af540149f9eddf3fb7ecce95 (commit)
via 1925f7fb88c6a8f881d6809ce2a70dd5c79f2503 (commit)
via 441735a225e7826615669a754b6bccf2b7d46ef4 (commit)
via 55d72b3ce74fba72710076fb0cef53aa06b2cf65 (commit)
via 06bb5d691bdf96bf99fa52eabcb21c9c0bd80eb4 (commit)
from 48ae40f07dcba76bdcbcc965717ed5fdfbf8ccb3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=8dfbff7765940524bbcf...
commit 8dfbff7765940524bbcf9a75f0cdb20f29d99842
Merge: 48ae40f 9248aaa
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Merge branch 'tlsa/select-column-properties'
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=9248aaad8d0d90bc6f9c...
commit 9248aaad8d0d90bc6f9caaf8c2b797b93ba4850f
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add test for column-* properties.
diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat
index c7d0976..c04f063 100644
--- a/test/data/select/tests1.dat
+++ b/test/data/select/tests1.dat
@@ -2116,8 +2116,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2225,8 +2225,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2334,8 +2334,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2443,8 +2443,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2552,8 +2552,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2661,8 +2661,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2770,8 +2770,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2879,8 +2879,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2988,8 +2988,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3097,8 +3097,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3206,8 +3206,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3315,8 +3315,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3424,8 +3424,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3533,8 +3533,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3642,8 +3642,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3751,8 +3751,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3860,8 +3860,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3969,8 +3969,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -4078,8 +4078,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -4187,8 +4187,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -4391,8 +4391,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -4493,8 +4493,8 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
-column-span: inherit
-column-width: inherit
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -4552,3 +4552,102 @@ writing-mode: vertical-lr
z-index: auto
#reset
+#tree
+| div
+| p*
+#ua
+p{display: block;}
+#user
+#author
+p{column-count: 2; column-rule-color: #bbc; column-rule-style: solid; column-rule-width: 2px; column-span: all; column-width: 6em;}
+#errors
+#expected
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: inherit
+border-spacing: inherit
+border-top-color: currentColor
+border-right-color: currentColor
+border-bottom-color: currentColor
+border-left-color: currentColor
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: medium
+border-right-width: medium
+border-bottom-width: medium
+border-left-width: medium
+bottom: auto
+caption-side: inherit
+clear: none
+clip: auto
+color: inherit
+column-count: 2048
+column-fill: balance
+column-gap: normal
+column-rule-color: #ffbbbbcc
+column-rule-style: solid
+column-rule-width: 2px
+column-span: all
+column-width: 6em
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: inherit
+direction: inherit
+display: block
+empty-cells: inherit
+float: none
+font-family: inherit
+font-size: inherit
+font-style: inherit
+font-variant: inherit
+font-weight: inherit
+height: auto
+left: auto
+letter-spacing: inherit
+line-height: inherit
+list-style-image: inherit
+list-style-position: inherit
+list-style-type: inherit
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+outline-color: invert
+outline-style: none
+outline-width: medium
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: inherit
+right: auto
+table-layout: auto
+text-align: inherit
+text-decoration: none
+text-indent: inherit
+text-transform: inherit
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: inherit
+white-space: inherit
+width: auto
+word-spacing: inherit
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=bc3b3725b51f894ad4fe...
commit bc3b3725b51f894ad4fe736f250c917b586beada
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add column-width to computed style dumping, and update test data.
diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat
index 8fa010b..c7d0976 100644
--- a/test/data/select/tests1.dat
+++ b/test/data/select/tests1.dat
@@ -44,6 +44,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -148,6 +149,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -252,6 +254,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -356,6 +359,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -452,6 +456,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -546,6 +551,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -641,6 +647,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -736,6 +743,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -830,6 +838,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -929,6 +938,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1028,6 +1038,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1128,6 +1139,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1231,6 +1243,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1333,6 +1346,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1441,6 +1455,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1549,6 +1564,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1657,6 +1673,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1769,6 +1786,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1880,6 +1898,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1989,6 +2008,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2097,6 +2117,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2205,6 +2226,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2313,6 +2335,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2421,6 +2444,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2529,6 +2553,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2637,6 +2662,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2745,6 +2771,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2853,6 +2880,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2961,6 +2989,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3069,6 +3098,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3177,6 +3207,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3285,6 +3316,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3393,6 +3425,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3501,6 +3534,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3609,6 +3643,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3717,6 +3752,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3825,6 +3861,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3933,6 +3970,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -4041,6 +4079,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -4149,6 +4188,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -4250,6 +4290,7 @@ column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -4351,6 +4392,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -4452,6 +4494,7 @@ column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
column-span: inherit
+column-width: inherit
content: normal
counter-increment: none
counter-reset: none
diff --git a/test/dump_computed.h b/test/dump_computed.h
index f45e6c5..a4c0b89 100644
--- a/test/dump_computed.h
+++ b/test/dump_computed.h
@@ -1001,6 +1001,33 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
ptr += wrote;
*len -= wrote;
+ /* column-width */
+ val = css_computed_column_width(style, &len1, &unit1);
+ switch (val) {
+ case CSS_COLUMN_WIDTH_INHERIT:
+ wrote = snprintf(ptr, *len, "column-width: inherit\n");
+ break;
+ case CSS_COLUMN_WIDTH_AUTO:
+ wrote = snprintf(ptr, *len, "column-width: auto\n");
+ break;
+ case CSS_COLUMN_WIDTH_SET:
+ wrote = snprintf(ptr, *len, "column-width: ");
+ ptr += wrote;
+ *len -= wrote;
+
+ wrote = dump_css_unit(len1, unit1, ptr, *len);
+ ptr += wrote;
+ *len -= wrote;
+
+ wrote = snprintf(ptr, *len, "\n");
+ break;
+ default:
+ wrote = 0;
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
/* content */
val = css_computed_content(style, &content);
switch (val) {
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=67f46d5236f378027eca...
commit 67f46d5236f378027eca06486251a69a3969dc98
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add public accessor for column-width property.
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index fc8404b..b384cba 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -357,6 +357,10 @@ uint8_t css_computed_column_rule_width(
uint8_t css_computed_column_span(
const css_computed_style *style);
+uint8_t css_computed_column_width(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit);
+
uint8_t css_computed_display(
const css_computed_style *style, bool root);
diff --git a/src/select/computed.c b/src/select/computed.c
index 55d02f6..8054b02 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -826,6 +826,12 @@ uint8_t css_computed_column_span(const css_computed_style *style)
return get_column_span(style);
}
+uint8_t css_computed_column_width(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ return get_column_width(style, length, unit);
+}
+
uint8_t css_computed_display(const css_computed_style *style,
bool root)
{
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=334f4f873581f72751bf...
commit 334f4f873581f72751bfd1b0de0496a69d282b48
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Fix column-width enum values.
diff --git a/include/libcss/properties.h b/include/libcss/properties.h
index 2137d5c..899a552 100644
--- a/include/libcss/properties.h
+++ b/include/libcss/properties.h
@@ -322,8 +322,8 @@ enum css_column_span_e {
enum css_column_width_e {
CSS_COLUMN_WIDTH_INHERIT = 0x0,
- CSS_COLUMN_WIDTH_AUTO = 0x1,
- CSS_COLUMN_WIDTH_SET = 0x2
+ CSS_COLUMN_WIDTH_SET = 0x1,
+ CSS_COLUMN_WIDTH_AUTO = 0x2
};
enum css_content_e {
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=0cab24ffcbe591049673...
commit 0cab24ffcbe59104967362219f3c831c84681f7e
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add column-width property to computed styles.
diff --git a/src/select/computed.h b/src/select/computed.h
index 05ea5fa..574d36b 100644
--- a/src/select/computed.h
+++ b/src/select/computed.h
@@ -24,12 +24,13 @@ typedef struct css_computed_uncommon {
* column_rule_style 4 0
* column_rule_width 3 + 4 4
* column_span 2 0
+ * column_width 2 + 4 4
* letter_spacing 2 + 4 4
* outline_color 2 4
* outline_width 3 + 4 4
* word_spacing 2 + 4 4
* --- ---
- * 77 bits 56 bytes
+ * 83 bits 60 bytes
*
* Encode counter_increment and _reset as an array of name, value pairs,
* terminated with a blank entry.
@@ -53,11 +54,11 @@ typedef struct css_computed_uncommon {
* 2 bits sizeof(ptr)
*
* ___ ___
- * 90 bits 58 + 4sizeof(ptr) bytes
+ * 96 bits 62 + 4sizeof(ptr) bytes
*
- * 12 bytes 58 + 4sizeof(ptr) bytes
+ * 12 bytes 62 + 4sizeof(ptr) bytes
* ===================
- * 68 + 4sizeof(ptr) bytes
+ * 72 + 4sizeof(ptr) bytes
*
* Bit allocations:
*
@@ -72,8 +73,8 @@ typedef struct css_computed_uncommon {
* 8 ccccccoo clip | content
* 9 ccffssss column_count | column-fill | column-rule-style
* 10 ggggggcc column-gap | column-rule-color
- * 11 wwwwwww. column-rule-width
- * 12 ss...... column-span
+ * 11 wwwwwww. column-rule-width | <unused>
+ * 12 sswwwwww column-span | column_width
*/
uint8_t bits[12];
@@ -92,6 +93,7 @@ typedef struct css_computed_uncommon {
css_fixed column_gap;
css_color column_rule_color;
css_fixed column_rule_width;
+ css_fixed column_width;
css_computed_counter *counter_increment;
css_computed_counter *counter_reset;
diff --git a/src/select/properties/column_width.c b/src/select/properties/column_width.c
index fd053d9..45eb7fc 100644
--- a/src/select/properties/column_width.c
+++ b/src/select/properties/column_width.c
@@ -14,57 +14,43 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_column_width(uint32_t opv, css_style *style,
+css_error css__cascade_column_width(uint32_t opv, css_style *style,
css_select_state *state)
{
- css_fixed length = 0;
- uint32_t unit = UNIT_PX;
-
- if (isInherit(opv) == false) {
- switch (getValue(opv)) {
- case COLUMN_WIDTH_SET:
- length = *((css_fixed *) style->bytecode);
- advance_bytecode(style, sizeof(length));
- unit = *((uint32_t *) style->bytecode);
- advance_bytecode(style, sizeof(unit));
- break;
- case COLUMN_WIDTH_AUTO:
- /** \todo convert to public values */
- break;
- }
- }
-
- if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
- isInherit(opv))) {
- /** \todo set computed elevation */
- }
-
- return CSS_OK;
+ return css__cascade_length_normal(opv, style, state, set_column_width);
}
css_error css__set_column_width_from_hint(const css_hint *hint,
css_computed_style *style)
{
- UNUSED(hint);
- UNUSED(style);
-
- return CSS_OK;
+ return set_column_width(style, hint->status,
+ hint->data.length.value, hint->data.length.unit);
}
css_error css__initial_column_width(css_select_state *state)
{
- UNUSED(state);
-
- return CSS_OK;
+ return set_column_width(state->computed, CSS_COLUMN_WIDTH_AUTO,
+ INTTOFIX(1), CSS_UNIT_EM);
}
css_error css__compose_column_width(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
- UNUSED(parent);
- UNUSED(child);
- UNUSED(result);
+ css_fixed length = INTTOFIX(1);
+ css_unit unit = CSS_UNIT_EM;
+ uint8_t type = get_column_width(child, &length, &unit);
+
+ if ((child->uncommon == NULL && parent->uncommon != NULL) ||
+ type == CSS_COLUMN_WIDTH_INHERIT ||
+ (child->uncommon != NULL && result != child)) {
+ if ((child->uncommon == NULL && parent->uncommon != NULL) ||
+ type == CSS_COLUMN_WIDTH_INHERIT) {
+ type = get_column_width(parent, &length, &unit);
+ }
+
+ return set_column_width(result, type, length, unit);
+ }
return CSS_OK;
}
diff --git a/src/select/propget.h b/src/select/propget.h
index 7be323e..08ed0f4 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -507,6 +507,33 @@ static inline uint8_t get_column_span(
#undef COLUMN_SPAN_SHIFT
#undef COLUMN_SPAN_INDEX
+#define COLUMN_WIDTH_INDEX 11
+#define COLUMN_WIDTH_SHIFT 0
+#define COLUMN_WIDTH_MASK 0x3f
+static inline uint8_t get_column_width(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[COLUMN_WIDTH_INDEX];
+ bits &= COLUMN_WIDTH_MASK;
+ bits >>= COLUMN_WIDTH_SHIFT;
+
+ /* 6bits: uuuutt : units | type */
+ if ((bits & 0x3) == CSS_COLUMN_WIDTH_SET) {
+ *length = style->uncommon->column_width;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+ }
+
+ return CSS_COLUMN_WIDTH_AUTO;
+}
+#undef COLUMN_WIDTH_MASK
+#undef COLUMN_WIDTH_SHIFT
+#undef COLUMN_WIDTH_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
diff --git a/src/select/propset.h b/src/select/propset.h
index baac10b..769d3b3 100644
--- a/src/select/propset.h
+++ b/src/select/propset.h
@@ -30,7 +30,7 @@ static const css_computed_uncommon default_uncommon = {
(CSS_COLUMN_RULE_STYLE_NONE << 0),
(CSS_COLUMN_GAP_NORMAL << 2) | (CSS_COLUMN_RULE_COLOR_CURRENT_COLOR),
(CSS_COLUMN_RULE_WIDTH_MEDIUM << 1),
- (CSS_COLUMN_SPAN_NONE << 6)
+ (CSS_COLUMN_SPAN_NONE << 6) | CSS_COLUMN_WIDTH_AUTO
},
{ 0, 0 },
{ 0, 0, 0, 0 },
@@ -42,6 +42,7 @@ static const css_computed_uncommon default_uncommon = {
0,
0,
0,
+ 0,
NULL,
NULL,
NULL,
@@ -578,6 +579,31 @@ static inline css_error set_column_span(
#undef COLUMN_SPAN_SHIFT
#undef COLUMN_SPAN_INDEX
+#define COLUMN_WIDTH_INDEX 11
+#define COLUMN_WIDTH_SHIFT 0
+#define COLUMN_WIDTH_MASK 0x3f
+static inline css_error set_column_width(
+ css_computed_style *style, uint8_t type,
+ css_fixed length, css_unit unit)
+{
+ uint8_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->uncommon->bits[COLUMN_WIDTH_INDEX];
+
+ /* 6bits: uuuutt : units | type */
+ *bits = (*bits & ~COLUMN_WIDTH_MASK) |
+ (((type & 0x3) | (unit << 2)) << COLUMN_WIDTH_SHIFT);
+
+ style->uncommon->column_width = length;
+
+ return CSS_OK;
+}
+#undef COLUMN_WIDTH_MASK
+#undef COLUMN_WIDTH_SHIFT
+#undef COLUMN_WIDTH_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=2bbbe9050fb449276e62...
commit 2bbbe9050fb449276e6230ce0c2b0353d04b587c
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add column-span to computed style dump and update test data.
diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat
index 1436e87..8fa010b 100644
--- a/test/data/select/tests1.dat
+++ b/test/data/select/tests1.dat
@@ -43,6 +43,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -146,6 +147,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -249,6 +251,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -352,6 +355,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -447,6 +451,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -540,6 +545,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -634,6 +640,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -728,6 +735,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -821,6 +829,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -919,6 +928,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -1017,6 +1027,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -1116,6 +1127,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -1218,6 +1230,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -1319,6 +1332,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -1426,6 +1440,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -1533,6 +1548,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -1640,6 +1656,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -1751,6 +1768,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -1861,6 +1879,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -1969,6 +1988,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -2076,6 +2096,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2183,6 +2204,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2290,6 +2312,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2397,6 +2420,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2504,6 +2528,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2611,6 +2636,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2718,6 +2744,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2825,6 +2852,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2932,6 +2960,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3039,6 +3068,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3146,6 +3176,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3253,6 +3284,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3360,6 +3392,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3467,6 +3500,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3574,6 +3608,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3681,6 +3716,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3788,6 +3824,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3895,6 +3932,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -4002,6 +4040,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -4109,6 +4148,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -4209,6 +4249,7 @@ column-gap: normal
column-rule-color: currentColor
column-rule-style: none
column-rule-width: medium
+column-span: none
content: normal
counter-increment: none
counter-reset: none
@@ -4309,6 +4350,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -4409,6 +4451,7 @@ column-gap: normal
column-rule-color: inherit
column-rule-style: none
column-rule-width: medium
+column-span: inherit
content: normal
counter-increment: none
counter-reset: none
diff --git a/test/dump_computed.h b/test/dump_computed.h
index 621b097..f45e6c5 100644
--- a/test/dump_computed.h
+++ b/test/dump_computed.h
@@ -982,6 +982,25 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
ptr += wrote;
*len -= wrote;
+ /* column-span */
+ val = css_computed_column_span(style);
+ switch (val) {
+ case CSS_COLUMN_SPAN_INHERIT:
+ wrote = snprintf(ptr, *len, "column-span: inherit\n");
+ break;
+ case CSS_COLUMN_SPAN_NONE:
+ wrote = snprintf(ptr, *len, "column-span: none\n");
+ break;
+ case CSS_COLUMN_SPAN_ALL:
+ wrote = snprintf(ptr, *len, "column-span: all\n");
+ break;
+ default:
+ wrote = 0;
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
/* content */
val = css_computed_content(style, &content);
switch (val) {
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=c7d629a54b94454f4708...
commit c7d629a54b94454f470885f0bd1a0769907e067b
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add public accessor for column-span property.
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index c859edc..fc8404b 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -354,6 +354,9 @@ uint8_t css_computed_column_rule_width(
const css_computed_style *style,
css_fixed *length, css_unit *unit);
+uint8_t css_computed_column_span(
+ const css_computed_style *style);
+
uint8_t css_computed_display(
const css_computed_style *style, bool root);
diff --git a/src/select/computed.c b/src/select/computed.c
index 52167f5..55d02f6 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -821,6 +821,11 @@ uint8_t css_computed_column_rule_width(const css_computed_style *style,
return get_column_rule_width(style, length, unit);
}
+uint8_t css_computed_column_span(const css_computed_style *style)
+{
+ return get_column_span(style);
+}
+
uint8_t css_computed_display(const css_computed_style *style,
bool root)
{
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=d4cafaf627dd7ceb1a1d...
commit d4cafaf627dd7ceb1a1dfd8292323c4b474ec57c
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add column-span property to computed styles.
diff --git a/src/select/computed.h b/src/select/computed.h
index 39904f9..05ea5fa 100644
--- a/src/select/computed.h
+++ b/src/select/computed.h
@@ -23,12 +23,13 @@ typedef struct css_computed_uncommon {
* column_rule_color 2 4
* column_rule_style 4 0
* column_rule_width 3 + 4 4
+ * column_span 2 0
* letter_spacing 2 + 4 4
* outline_color 2 4
* outline_width 3 + 4 4
* word_spacing 2 + 4 4
* --- ---
- * 75 bits 56 bytes
+ * 77 bits 56 bytes
*
* Encode counter_increment and _reset as an array of name, value pairs,
* terminated with a blank entry.
@@ -52,11 +53,11 @@ typedef struct css_computed_uncommon {
* 2 bits sizeof(ptr)
*
* ___ ___
- * 88 bits 58 + 4sizeof(ptr) bytes
+ * 90 bits 58 + 4sizeof(ptr) bytes
*
- * 11 bytes 58 + 4sizeof(ptr) bytes
+ * 12 bytes 58 + 4sizeof(ptr) bytes
* ===================
- * 67 + 4sizeof(ptr) bytes
+ * 68 + 4sizeof(ptr) bytes
*
* Bit allocations:
*
@@ -72,8 +73,9 @@ typedef struct css_computed_uncommon {
* 9 ccffssss column_count | column-fill | column-rule-style
* 10 ggggggcc column-gap | column-rule-color
* 11 wwwwwww. column-rule-width
+ * 12 ss...... column-span
*/
- uint8_t bits[11];
+ uint8_t bits[12];
css_fixed border_spacing[2];
diff --git a/src/select/properties/column_span.c b/src/select/properties/column_span.c
index 92048a0..2c870d3 100644
--- a/src/select/properties/column_span.c
+++ b/src/select/properties/column_span.c
@@ -14,23 +14,27 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_column_span(uint32_t opv, css_style *style,
+css_error css__cascade_column_span(uint32_t opv, css_style *style,
css_select_state *state)
{
+ uint16_t value = CSS_COLUMN_SPAN_INHERIT;
+
UNUSED(style);
if (isInherit(opv) == false) {
switch (getValue(opv)) {
case COLUMN_SPAN_NONE:
+ value = CSS_COLUMN_SPAN_NONE;
+ break;
case COLUMN_SPAN_ALL:
- /** \todo convert to public values */
+ value = CSS_COLUMN_SPAN_ALL;
break;
}
}
if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
isInherit(opv))) {
- /** \todo set computed elevation */
+ return set_column_span(state->computed, value);
}
return CSS_OK;
@@ -39,27 +43,24 @@ css_error css__cascade_column_span(uint32_t opv, css_style *style,
css_error css__set_column_span_from_hint(const css_hint *hint,
css_computed_style *style)
{
- UNUSED(hint);
- UNUSED(style);
-
- return CSS_OK;
+ return set_column_span(style, hint->status);
}
css_error css__initial_column_span(css_select_state *state)
{
- UNUSED(state);
-
- return CSS_OK;
+ return set_column_span(state->computed, CSS_COLUMN_SPAN_NONE);
}
css_error css__compose_column_span(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
- UNUSED(parent);
- UNUSED(child);
- UNUSED(result);
+ uint8_t type = get_column_span(child);
- return CSS_OK;
+ if (type == CSS_COLUMN_SPAN_INHERIT) {
+ type = get_column_span(parent);
+ }
+
+ return set_column_span(result, type);
}
diff --git a/src/select/propget.h b/src/select/propget.h
index 423e299..7be323e 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -486,6 +486,27 @@ static inline uint8_t get_column_rule_width(
#undef COLUMN_RULE_WIDTH_SHIFT
#undef COLUMN_RULE_WIDTH_INDEX
+#define COLUMN_SPAN_INDEX 11
+#define COLUMN_SPAN_SHIFT 6
+#define COLUMN_SPAN_MASK 0xc0
+static inline uint8_t get_column_span(
+ const css_computed_style *style)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[COLUMN_SPAN_INDEX];
+ bits &= COLUMN_SPAN_MASK;
+ bits >>= COLUMN_SPAN_SHIFT;
+
+ /* 2bits: type */
+ return bits;
+ }
+
+ return CSS_COLUMN_SPAN_NONE;
+}
+#undef COLUMN_SPAN_MASK
+#undef COLUMN_SPAN_SHIFT
+#undef COLUMN_SPAN_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
diff --git a/src/select/propset.h b/src/select/propset.h
index 6dcfbc6..baac10b 100644
--- a/src/select/propset.h
+++ b/src/select/propset.h
@@ -29,7 +29,8 @@ static const css_computed_uncommon default_uncommon = {
(CSS_COLUMN_COUNT_AUTO << 6) | (CSS_COLUMN_FILL_BALANCE << 4) |
(CSS_COLUMN_RULE_STYLE_NONE << 0),
(CSS_COLUMN_GAP_NORMAL << 2) | (CSS_COLUMN_RULE_COLOR_CURRENT_COLOR),
- (CSS_COLUMN_RULE_WIDTH_MEDIUM << 1)
+ (CSS_COLUMN_RULE_WIDTH_MEDIUM << 1),
+ (CSS_COLUMN_SPAN_NONE << 6)
},
{ 0, 0 },
{ 0, 0, 0, 0 },
@@ -555,6 +556,28 @@ static inline css_error set_column_rule_width(
#undef COLUMN_RULE_WIDTH_SHIFT
#undef COLUMN_RULE_WIDTH_INDEX
+#define COLUMN_SPAN_INDEX 11
+#define COLUMN_SPAN_SHIFT 6
+#define COLUMN_SPAN_MASK 0xc0
+static inline css_error set_column_span(
+ css_computed_style *style, uint8_t type)
+{
+ uint8_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->uncommon->bits[COLUMN_SPAN_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~COLUMN_SPAN_MASK) |
+ ((type & 0x3) << COLUMN_SPAN_SHIFT);
+
+ return CSS_OK;
+}
+#undef COLUMN_SPAN_MASK
+#undef COLUMN_SPAN_SHIFT
+#undef COLUMN_SPAN_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=0e2da043cbfe4f4df8e7...
commit 0e2da043cbfe4f4df8e7978c52aa919199925424
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add column-rule-width to computed style dump, and update unit tests.
diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat
index 5f4136e..1436e87 100644
--- a/test/data/select/tests1.dat
+++ b/test/data/select/tests1.dat
@@ -42,6 +42,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -144,6 +145,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -246,6 +248,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -348,6 +351,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -442,6 +446,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -534,6 +539,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -627,6 +633,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -720,6 +727,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -812,6 +820,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -909,6 +918,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -1006,6 +1016,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -1104,6 +1115,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -1205,6 +1217,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -1305,6 +1318,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -1411,6 +1425,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -1517,6 +1532,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -1623,6 +1639,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -1733,6 +1750,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -1842,6 +1860,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -1949,6 +1968,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -2055,6 +2075,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -2161,6 +2182,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -2267,6 +2289,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -2373,6 +2396,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -2479,6 +2503,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -2585,6 +2610,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -2691,6 +2717,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -2797,6 +2824,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -2903,6 +2931,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -3009,6 +3038,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -3115,6 +3145,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -3221,6 +3252,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -3327,6 +3359,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -3433,6 +3466,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -3539,6 +3573,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -3645,6 +3680,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -3751,6 +3787,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -3857,6 +3894,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -3963,6 +4001,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -4069,6 +4108,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -4168,6 +4208,7 @@ column-fill: balance
column-gap: normal
column-rule-color: currentColor
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -4267,6 +4308,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
@@ -4366,6 +4408,7 @@ column-fill: balance
column-gap: normal
column-rule-color: inherit
column-rule-style: none
+column-rule-width: medium
content: normal
counter-increment: none
counter-reset: none
diff --git a/test/dump_computed.h b/test/dump_computed.h
index 00e9a10..621b097 100644
--- a/test/dump_computed.h
+++ b/test/dump_computed.h
@@ -949,6 +949,39 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
ptr += wrote;
*len -= wrote;
+ /* column-rule-width */
+ val = css_computed_column_rule_width(style, &len1, &unit1);
+ switch (val) {
+ case CSS_COLUMN_RULE_WIDTH_INHERIT:
+ wrote = snprintf(ptr, *len, "column-rule-width: inherit\n");
+ break;
+ case CSS_COLUMN_RULE_WIDTH_THIN:
+ wrote = snprintf(ptr, *len, "column-rule-width: thin\n");
+ break;
+ case CSS_COLUMN_RULE_WIDTH_MEDIUM:
+ wrote = snprintf(ptr, *len, "column-rule-width: medium\n");
+ break;
+ case CSS_COLUMN_RULE_WIDTH_THICK:
+ wrote = snprintf(ptr, *len, "column-rule-width: thick\n");
+ break;
+ case CSS_COLUMN_RULE_WIDTH_WIDTH:
+ wrote = snprintf(ptr, *len, "column-rule-width: ");
+ ptr += wrote;
+ *len -= wrote;
+
+ wrote = dump_css_unit(len1, unit1, ptr, *len);
+ ptr += wrote;
+ *len -= wrote;
+
+ wrote = snprintf(ptr, *len, "\n");
+ break;
+ default:
+ wrote = 0;
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
/* content */
val = css_computed_content(style, &content);
switch (val) {
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=88d36bd6f7bb38e3f8fe...
commit 88d36bd6f7bb38e3f8fe6ff0e15f7876afe7a2d0
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add public computed style accessor for column-rule-width prop.
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index f680c27..c859edc 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -350,6 +350,10 @@ uint8_t css_computed_column_rule_color(
uint8_t css_computed_column_rule_style(
const css_computed_style *style);
+uint8_t css_computed_column_rule_width(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit);
+
uint8_t css_computed_display(
const css_computed_style *style, bool root);
diff --git a/src/select/computed.c b/src/select/computed.c
index 81b2359..52167f5 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -815,6 +815,12 @@ uint8_t css_computed_column_rule_style(const css_computed_style *style)
return get_column_rule_style(style);
}
+uint8_t css_computed_column_rule_width(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ return get_column_rule_width(style, length, unit);
+}
+
uint8_t css_computed_display(const css_computed_style *style,
bool root)
{
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=34271c0f32bca359af8f...
commit 34271c0f32bca359af8f7a6c40f166d402b78eb6
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add column-rule-width to computed styles.
diff --git a/src/select/computed.h b/src/select/computed.h
index 71a3916..39904f9 100644
--- a/src/select/computed.h
+++ b/src/select/computed.h
@@ -22,12 +22,13 @@ typedef struct css_computed_uncommon {
* column_gap 2 + 4 4
* column_rule_color 2 4
* column_rule_style 4 0
+ * column_rule_width 3 + 4 4
* letter_spacing 2 + 4 4
* outline_color 2 4
* outline_width 3 + 4 4
* word_spacing 2 + 4 4
* --- ---
- * 68 bits 52 bytes
+ * 75 bits 56 bytes
*
* Encode counter_increment and _reset as an array of name, value pairs,
* terminated with a blank entry.
@@ -51,27 +52,28 @@ typedef struct css_computed_uncommon {
* 2 bits sizeof(ptr)
*
* ___ ___
- * 81 bits 52 + 4sizeof(ptr) bytes
+ * 88 bits 58 + 4sizeof(ptr) bytes
*
- * 10 bytes 52 + 4sizeof(ptr) bytes
+ * 11 bytes 58 + 4sizeof(ptr) bytes
* ===================
- * 62 + 4sizeof(ptr) bytes
+ * 67 + 4sizeof(ptr) bytes
*
* Bit allocations:
*
* 76543210
- * 1 llllllcc letter-spacing | outline-color
- * 2 ooooooob outline-width | border-spacing
+ * 1 llllllcc letter-spacing | outline-color
+ * 2 ooooooob outline-width | border-spacing
* 3 bbbbbbbb border-spacing
- * 4 wwwwwwir word-spacing | counter-increment | counter-reset
- * 5 uuuuumm. cursor | writing-mode | <unused>
+ * 4 wwwwwwir word-spacing | counter-increment | counter-reset
+ * 5 uuuuumm. cursor | writing-mode | <unused>
* 6 cccccccc clip
* 7 cccccccc clip
- * 8 ccccccoo clip | content
- * 9 ccffssss column_count | column-fill | column-rule-style
- * 10 ggggggcc column-gap | column-rule-color
+ * 8 ccccccoo clip | content
+ * 9 ccffssss column_count | column-fill | column-rule-style
+ * 10 ggggggcc column-gap | column-rule-color
+ * 11 wwwwwww. column-rule-width
*/
- uint8_t bits[10];
+ uint8_t bits[11];
css_fixed border_spacing[2];
@@ -87,6 +89,7 @@ typedef struct css_computed_uncommon {
int32_t column_count;
css_fixed column_gap;
css_color column_rule_color;
+ css_fixed column_rule_width;
css_computed_counter *counter_increment;
css_computed_counter *counter_reset;
diff --git a/src/select/properties/column_rule_width.c b/src/select/properties/column_rule_width.c
index 2c0ca0d..8694a09 100644
--- a/src/select/properties/column_rule_width.c
+++ b/src/select/properties/column_rule_width.c
@@ -17,57 +17,35 @@
css_error css__cascade_column_rule_width(uint32_t opv, css_style *style,
css_select_state *state)
{
- css_fixed length = 0;
- uint32_t unit = UNIT_PX;
-
- if (isInherit(opv) == false) {
- switch (getValue(opv)) {
- case COLUMN_RULE_WIDTH_SET:
- length = *((css_fixed *) style->bytecode);
- advance_bytecode(style, sizeof(length));
- unit = *((uint32_t *) style->bytecode);
- advance_bytecode(style, sizeof(unit));
- break;
- case COLUMN_RULE_WIDTH_THIN:
- case COLUMN_RULE_WIDTH_MEDIUM:
- case COLUMN_RULE_WIDTH_THICK:
- /** \todo convert to public values */
- break;
- }
- }
-
- if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
- isInherit(opv))) {
- /** \todo set computed elevation */
- }
-
- return CSS_OK;
+ return css__cascade_border_width(opv, style, state,
+ set_column_rule_width);
}
css_error css__set_column_rule_width_from_hint(const css_hint *hint,
css_computed_style *style)
{
- UNUSED(hint);
- UNUSED(style);
-
- return CSS_OK;
+ return set_column_rule_width(style, hint->status,
+ hint->data.length.value, hint->data.length.unit);
}
css_error css__initial_column_rule_width(css_select_state *state)
{
- UNUSED(state);
-
- return CSS_OK;
+ return set_column_rule_width(state->computed,
+ CSS_COLUMN_RULE_WIDTH_MEDIUM, 0, CSS_UNIT_PX);
}
css_error css__compose_column_rule_width(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
- UNUSED(parent);
- UNUSED(child);
- UNUSED(result);
+ css_fixed length = 0;
+ css_unit unit = CSS_UNIT_PX;
+ uint8_t type = get_column_rule_width(child, &length, &unit);
+
+ if (type == CSS_COLUMN_RULE_WIDTH_INHERIT) {
+ type = get_column_rule_width(parent, &length, &unit);
+ }
- return CSS_OK;
+ return set_column_rule_width(result, type, length, unit);
}
diff --git a/src/select/propget.h b/src/select/propget.h
index 4ced8bb..423e299 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -459,6 +459,33 @@ static inline uint8_t get_column_rule_style(
#undef COLUMN_RULE_STYLE_SHIFT
#undef COLUMN_RULE_STYLE_INDEX
+#define COLUMN_RULE_WIDTH_INDEX 10
+#define COLUMN_RULE_WIDTH_SHIFT 1
+#define COLUMN_RULE_WIDTH_MASK 0xfe
+static inline uint8_t get_column_rule_width(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[COLUMN_RULE_WIDTH_INDEX];
+ bits &= COLUMN_RULE_WIDTH_MASK;
+ bits >>= COLUMN_RULE_WIDTH_SHIFT;
+
+ /* 7bits: uuuuttt : units | type */
+ if ((bits & 0x7) == CSS_COLUMN_RULE_WIDTH_WIDTH) {
+ *length = style->uncommon->column_rule_width;
+ *unit = bits >> 3;
+ }
+
+ return (bits & 0x7);
+ }
+
+ return CSS_COLUMN_RULE_WIDTH_MEDIUM;
+}
+#undef COLUMN_RULE_WIDTH_MASK
+#undef COLUMN_RULE_WIDTH_SHIFT
+#undef COLUMN_RULE_WIDTH_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
diff --git a/src/select/propset.h b/src/select/propset.h
index 5aa253e..6dcfbc6 100644
--- a/src/select/propset.h
+++ b/src/select/propset.h
@@ -28,7 +28,8 @@ static const css_computed_uncommon default_uncommon = {
(CSS_CLIP_AUTO << 2) | CSS_CONTENT_NORMAL,
(CSS_COLUMN_COUNT_AUTO << 6) | (CSS_COLUMN_FILL_BALANCE << 4) |
(CSS_COLUMN_RULE_STYLE_NONE << 0),
- (CSS_COLUMN_GAP_NORMAL << 2) | (CSS_COLUMN_RULE_COLOR_CURRENT_COLOR)
+ (CSS_COLUMN_GAP_NORMAL << 2) | (CSS_COLUMN_RULE_COLOR_CURRENT_COLOR),
+ (CSS_COLUMN_RULE_WIDTH_MEDIUM << 1)
},
{ 0, 0 },
{ 0, 0, 0, 0 },
@@ -39,6 +40,7 @@ static const css_computed_uncommon default_uncommon = {
0,
0,
0,
+ 0,
NULL,
NULL,
NULL,
@@ -528,6 +530,31 @@ static inline css_error set_column_rule_style(
#undef COLUMN_RULE_STYLE_SHIFT
#undef COLUMN_RULE_STYLE_INDEX
+#define COLUMN_RULE_WIDTH_INDEX 10
+#define COLUMN_RULE_WIDTH_SHIFT 1
+#define COLUMN_RULE_WIDTH_MASK 0xfe
+static inline css_error set_column_rule_width(
+ css_computed_style *style, uint8_t type,
+ css_fixed length, css_unit unit)
+{
+ uint8_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->uncommon->bits[COLUMN_RULE_WIDTH_INDEX];
+
+ /* 7bits: uuuuttt : units | type */
+ *bits = (*bits & ~COLUMN_RULE_WIDTH_MASK) |
+ (((type & 0x7) | (unit << 3)) << COLUMN_RULE_WIDTH_SHIFT);
+
+ style->uncommon->column_rule_width = length;
+
+ return CSS_OK;
+}
+#undef COLUMN_RULE_WIDTH_MASK
+#undef COLUMN_RULE_WIDTH_SHIFT
+#undef COLUMN_RULE_WIDTH_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=34fc236550a686d94745...
commit 34fc236550a686d947458a2ce7f9a081b2b6d22c
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add column-rule-style to computed style dumper, and update unit tests.
diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat
index 8a1cd6c..5f4136e 100644
--- a/test/data/select/tests1.dat
+++ b/test/data/select/tests1.dat
@@ -41,6 +41,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -142,6 +143,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -243,6 +245,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -344,6 +347,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -437,6 +441,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -528,6 +533,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -620,6 +626,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -712,6 +719,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -803,6 +811,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -899,6 +908,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -995,6 +1005,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -1092,6 +1103,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -1192,6 +1204,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -1291,6 +1304,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -1396,6 +1410,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -1501,6 +1516,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -1606,6 +1622,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -1715,6 +1732,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -1823,6 +1841,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -1929,6 +1948,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -2034,6 +2054,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -2139,6 +2160,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -2244,6 +2266,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -2349,6 +2372,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -2454,6 +2478,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -2559,6 +2584,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -2664,6 +2690,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -2769,6 +2796,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -2874,6 +2902,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -2979,6 +3008,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -3084,6 +3114,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -3189,6 +3220,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -3294,6 +3326,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -3399,6 +3432,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -3504,6 +3538,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -3609,6 +3644,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -3714,6 +3750,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -3819,6 +3856,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -3924,6 +3962,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -4029,6 +4068,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -4127,6 +4167,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: currentColor
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -4225,6 +4266,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
@@ -4323,6 +4365,7 @@ column-count: auto
column-fill: balance
column-gap: normal
column-rule-color: inherit
+column-rule-style: none
content: normal
counter-increment: none
counter-reset: none
diff --git a/test/dump_computed.h b/test/dump_computed.h
index 3da4617..00e9a10 100644
--- a/test/dump_computed.h
+++ b/test/dump_computed.h
@@ -906,6 +906,49 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
ptr += wrote;
*len -= wrote;
+ /* column-rule-style */
+ val = css_computed_column_rule_style(style);
+ switch (val) {
+ case CSS_COLUMN_RULE_STYLE_INHERIT:
+ wrote = snprintf(ptr, *len, "column-rule-style: inherit\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_NONE:
+ wrote = snprintf(ptr, *len, "column-rule-style: none\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_HIDDEN:
+ wrote = snprintf(ptr, *len, "column-rule-style: hidden\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_DOTTED:
+ wrote = snprintf(ptr, *len, "column-rule-style: dotted\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_DASHED:
+ wrote = snprintf(ptr, *len, "column-rule-style: dashed\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_SOLID:
+ wrote = snprintf(ptr, *len, "column-rule-style: solid\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_DOUBLE:
+ wrote = snprintf(ptr, *len, "column-rule-style: double\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_GROOVE:
+ wrote = snprintf(ptr, *len, "column-rule-style: groove\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_RIDGE:
+ wrote = snprintf(ptr, *len, "column-rule-style: ridge\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_INSET:
+ wrote = snprintf(ptr, *len, "column-rule-style: inset\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_OUTSET:
+ wrote = snprintf(ptr, *len, "column-rule-style: outset\n");
+ break;
+ default:
+ wrote = 0;
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
/* content */
val = css_computed_content(style, &content);
switch (val) {
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=b353e6a7935dec696eaa...
commit b353e6a7935dec696eaac463132005f2c4e6f67f
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add public computed style accessor for column-rule-style property.
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index 8f2437f..f680c27 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -347,6 +347,9 @@ uint8_t css_computed_column_rule_color(
const css_computed_style *style,
css_color *color);
+uint8_t css_computed_column_rule_style(
+ const css_computed_style *style);
+
uint8_t css_computed_display(
const css_computed_style *style, bool root);
diff --git a/src/select/computed.c b/src/select/computed.c
index 53f33d6..81b2359 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -810,6 +810,11 @@ uint8_t css_computed_column_rule_color(const css_computed_style *style,
return get_column_rule_color(style, color);
}
+uint8_t css_computed_column_rule_style(const css_computed_style *style)
+{
+ return get_column_rule_style(style);
+}
+
uint8_t css_computed_display(const css_computed_style *style,
bool root)
{
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=32d6b37b16f9c8a840cc...
commit 32d6b37b16f9c8a840ccc2b6d4d7ef4b706097f4
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add column_rule_style to computed styles.
diff --git a/src/select/computed.h b/src/select/computed.h
index 2f90985..71a3916 100644
--- a/src/select/computed.h
+++ b/src/select/computed.h
@@ -21,12 +21,13 @@ typedef struct css_computed_uncommon {
* column_fill 2 0
* column_gap 2 + 4 4
* column_rule_color 2 4
+ * column_rule_style 4 0
* letter_spacing 2 + 4 4
* outline_color 2 4
* outline_width 3 + 4 4
* word_spacing 2 + 4 4
* --- ---
- * 64 bits 52 bytes
+ * 68 bits 52 bytes
*
* Encode counter_increment and _reset as an array of name, value pairs,
* terminated with a blank entry.
@@ -50,7 +51,7 @@ typedef struct css_computed_uncommon {
* 2 bits sizeof(ptr)
*
* ___ ___
- * 73 bits 52 + 4sizeof(ptr) bytes
+ * 81 bits 52 + 4sizeof(ptr) bytes
*
* 10 bytes 52 + 4sizeof(ptr) bytes
* ===================
@@ -67,7 +68,7 @@ typedef struct css_computed_uncommon {
* 6 cccccccc clip
* 7 cccccccc clip
* 8 ccccccoo clip | content
- * 9 ccff.... column_count | column-fill | <unused>
+ * 9 ccffssss column_count | column-fill | column-rule-style
* 10 ggggggcc column-gap | column-rule-color
*/
uint8_t bits[10];
diff --git a/src/select/properties/column_rule_style.c b/src/select/properties/column_rule_style.c
index ba558a2..586ce5d 100644
--- a/src/select/properties/column_rule_style.c
+++ b/src/select/properties/column_rule_style.c
@@ -17,57 +17,32 @@
css_error css__cascade_column_rule_style(uint32_t opv, css_style *style,
css_select_state *state)
{
- UNUSED(style);
-
- if (isInherit(opv) == false) {
- switch (getValue(opv)) {
- case COLUMN_RULE_STYLE_NONE:
- case COLUMN_RULE_STYLE_HIDDEN:
- case COLUMN_RULE_STYLE_DOTTED:
- case COLUMN_RULE_STYLE_DASHED:
- case COLUMN_RULE_STYLE_SOLID:
- case COLUMN_RULE_STYLE_DOUBLE:
- case COLUMN_RULE_STYLE_GROOVE:
- case COLUMN_RULE_STYLE_RIDGE:
- case COLUMN_RULE_STYLE_INSET:
- case COLUMN_RULE_STYLE_OUTSET:
- /** \todo convert to public values */
- break;
- }
- }
-
- if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
- isInherit(opv))) {
- /** \todo set computed elevation */
- }
-
- return CSS_OK;
+ return css__cascade_border_style(opv, style, state,
+ set_column_rule_style);
}
css_error css__set_column_rule_style_from_hint(const css_hint *hint,
css_computed_style *style)
{
- UNUSED(hint);
- UNUSED(style);
-
- return CSS_OK;
+ return set_column_rule_style(style, hint->status);
}
css_error css__initial_column_rule_style(css_select_state *state)
{
- UNUSED(state);
-
- return CSS_OK;
+ return set_column_rule_style(state->computed,
+ CSS_COLUMN_RULE_STYLE_NONE);
}
css_error css__compose_column_rule_style(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
- UNUSED(parent);
- UNUSED(child);
- UNUSED(result);
+ uint8_t type = get_column_rule_style(child);
+
+ if (type == CSS_COLUMN_RULE_STYLE_INHERIT) {
+ type = get_column_rule_style(parent);
+ }
- return CSS_OK;
+ return set_column_rule_style(result, type);
}
diff --git a/src/select/propget.h b/src/select/propget.h
index 499f705..4ced8bb 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -438,6 +438,27 @@ static inline uint8_t get_column_rule_color(
#undef COLUMN_RULE_COLOR_SHIFT
#undef COLUMN_RULE_COLOR_INDEX
+#define COLUMN_RULE_STYLE_INDEX 8
+#define COLUMN_RULE_STYLE_SHIFT 0
+#define COLUMN_RULE_STYLE_MASK 0xf
+static inline uint8_t get_column_rule_style(
+ const css_computed_style *style)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[COLUMN_RULE_STYLE_INDEX];
+ bits &= COLUMN_RULE_STYLE_MASK;
+ bits >>= COLUMN_RULE_STYLE_SHIFT;
+
+ /* 4bits: type */
+ return bits;
+ }
+
+ return CSS_COLUMN_RULE_STYLE_NONE;
+}
+#undef COLUMN_RULE_STYLE_MASK
+#undef COLUMN_RULE_STYLE_SHIFT
+#undef COLUMN_RULE_STYLE_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
diff --git a/src/select/propset.h b/src/select/propset.h
index 07ba906..5aa253e 100644
--- a/src/select/propset.h
+++ b/src/select/propset.h
@@ -26,7 +26,8 @@ static const css_computed_uncommon default_uncommon = {
0,
0,
(CSS_CLIP_AUTO << 2) | CSS_CONTENT_NORMAL,
- (CSS_COLUMN_COUNT_AUTO << 6) | (CSS_COLUMN_FILL_BALANCE << 4),
+ (CSS_COLUMN_COUNT_AUTO << 6) | (CSS_COLUMN_FILL_BALANCE << 4) |
+ (CSS_COLUMN_RULE_STYLE_NONE << 0),
(CSS_COLUMN_GAP_NORMAL << 2) | (CSS_COLUMN_RULE_COLOR_CURRENT_COLOR)
},
{ 0, 0 },
@@ -505,6 +506,28 @@ static inline css_error set_column_rule_color(
#undef COLUMN_RULE_COLOR_SHIFT
#undef COLUMN_RULE_COLOR_INDEX
+#define COLUMN_RULE_STYLE_INDEX 8
+#define COLUMN_RULE_STYLE_SHIFT 0
+#define COLUMN_RULE_STYLE_MASK 0xf
+static inline css_error set_column_rule_style(
+ css_computed_style *style, uint8_t type)
+{
+ uint8_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->uncommon->bits[COLUMN_RULE_STYLE_INDEX];
+
+ /* 4bits: type */
+ *bits = (*bits & ~COLUMN_RULE_STYLE_MASK) |
+ ((type & 0xf) << COLUMN_RULE_STYLE_SHIFT);
+
+ return CSS_OK;
+}
+#undef COLUMN_RULE_STYLE_MASK
+#undef COLUMN_RULE_STYLE_SHIFT
+#undef COLUMN_RULE_STYLE_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=9914d06fcc48c87a46d4...
commit 9914d06fcc48c87a46d47e6a47ffb80817981258
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add missing CSS_COLUMN_RULE_STYLE_HIDDEN value.
diff --git a/include/libcss/properties.h b/include/libcss/properties.h
index 47555f2..2137d5c 100644
--- a/include/libcss/properties.h
+++ b/include/libcss/properties.h
@@ -295,6 +295,7 @@ enum css_column_rule_color_e {
enum css_column_rule_style_e {
CSS_COLUMN_RULE_STYLE_INHERIT = CSS_BORDER_STYLE_INHERIT,
CSS_COLUMN_RULE_STYLE_NONE = CSS_BORDER_STYLE_NONE,
+ CSS_COLUMN_RULE_STYLE_HIDDEN = CSS_BORDER_STYLE_HIDDEN,
CSS_COLUMN_RULE_STYLE_DOTTED = CSS_BORDER_STYLE_DOTTED,
CSS_COLUMN_RULE_STYLE_DASHED = CSS_BORDER_STYLE_DASHED,
CSS_COLUMN_RULE_STYLE_SOLID = CSS_BORDER_STYLE_SOLID,
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=3cb7a56c6e0c6abce0b6...
commit 3cb7a56c6e0c6abce0b61a4f9169e31dbe2615b4
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Fix column-fill computed style offset.
diff --git a/src/select/propget.h b/src/select/propget.h
index 6150ff7..499f705 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -366,7 +366,7 @@ static inline uint8_t get_column_count(
#undef COLUMN_COUNT_INDEX
#define COLUMN_FILL_INDEX 8
-#define COLUMN_FILL_SHIFT 6
+#define COLUMN_FILL_SHIFT 4
#define COLUMN_FILL_MASK 0x30
static inline uint8_t get_column_fill(
const css_computed_style *style)
diff --git a/src/select/propset.h b/src/select/propset.h
index 834ed77..07ba906 100644
--- a/src/select/propset.h
+++ b/src/select/propset.h
@@ -434,7 +434,7 @@ static inline css_error set_column_count(
#undef COLUMN_COUNT_INDEX
#define COLUMN_FILL_INDEX 8
-#define COLUMN_FILL_SHIFT 6
+#define COLUMN_FILL_SHIFT 4
#define COLUMN_FILL_MASK 0x30
static inline css_error set_column_fill(
css_computed_style *style, uint8_t type)
diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat
index a178ac7..8a1cd6c 100644
--- a/test/data/select/tests1.dat
+++ b/test/data/select/tests1.dat
@@ -2031,7 +2031,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -2136,7 +2136,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -2241,7 +2241,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -2346,7 +2346,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -2451,7 +2451,7 @@ clear: inherit
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -2556,7 +2556,7 @@ clear: left
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -2661,7 +2661,7 @@ clear: both
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -2766,7 +2766,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -2871,7 +2871,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -2976,7 +2976,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -3081,7 +3081,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -3186,7 +3186,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -3291,7 +3291,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -3396,7 +3396,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -3501,7 +3501,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -3606,7 +3606,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -3711,7 +3711,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -3816,7 +3816,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -3921,7 +3921,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -4026,7 +4026,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -4222,7 +4222,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
@@ -4320,7 +4320,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
-column-fill: inherit
+column-fill: balance
column-gap: normal
column-rule-color: inherit
content: normal
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=2e1c5c54e1a14d1ea898...
commit 2e1c5c54e1a14d1ea89829f84f5b46d5cb593808
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add column-rule-color to computed style dumper and update unit tests.
diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat
index 217a21c..a178ac7 100644
--- a/test/data/select/tests1.dat
+++ b/test/data/select/tests1.dat
@@ -40,6 +40,7 @@ color: #ffff0000
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -140,6 +141,7 @@ color: #ffff0000
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -240,6 +242,7 @@ color: inherit
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -340,6 +343,7 @@ color: inherit
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -432,6 +436,7 @@ color: #ff000000
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -522,6 +527,7 @@ color: #ff000000
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -613,6 +619,7 @@ color: #ff000000
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -704,6 +711,7 @@ color: inherit
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -794,6 +802,7 @@ color: #ff000000
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -889,6 +898,7 @@ color: inherit
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -984,6 +994,7 @@ color: inherit
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -1080,6 +1091,7 @@ color: inherit
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -1179,6 +1191,7 @@ color: inherit
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -1277,6 +1290,7 @@ color: inherit
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -1381,6 +1395,7 @@ color: inherit
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -1485,6 +1500,7 @@ color: inherit
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -1589,6 +1605,7 @@ color: inherit
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -1697,6 +1714,7 @@ color: inherit
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -1804,6 +1822,7 @@ color: inherit
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -1909,6 +1928,7 @@ color: inherit
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -2013,6 +2033,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2117,6 +2138,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2221,6 +2243,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2325,6 +2348,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2429,6 +2453,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2533,6 +2558,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2637,6 +2663,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2741,6 +2768,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2845,6 +2873,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2949,6 +2978,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3053,6 +3083,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3157,6 +3188,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3261,6 +3293,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3365,6 +3398,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3469,6 +3503,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3573,6 +3608,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3677,6 +3713,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3781,6 +3818,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3885,6 +3923,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3989,6 +4028,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -4086,6 +4126,7 @@ color: inherit
column-count: auto
column-fill: balance
column-gap: normal
+column-rule-color: currentColor
content: normal
counter-increment: none
counter-reset: none
@@ -4183,6 +4224,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -4280,6 +4322,7 @@ color: inherit
column-count: auto
column-fill: inherit
column-gap: normal
+column-rule-color: inherit
content: normal
counter-increment: none
counter-reset: none
diff --git a/test/dump_computed.h b/test/dump_computed.h
index ace7fda..3da4617 100644
--- a/test/dump_computed.h
+++ b/test/dump_computed.h
@@ -889,6 +889,23 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
ptr += wrote;
*len -= wrote;
+ /* column-rule-color */
+ val = css_computed_column_rule_color(style, &color);
+ switch (val) {
+ case CSS_COLUMN_RULE_COLOR_INHERIT:
+ wrote = snprintf(ptr, *len, "column-rule-color: inherit\n");
+ break;
+ case CSS_COLUMN_RULE_COLOR_CURRENT_COLOR:
+ wrote = snprintf(ptr, *len, "column-rule-color: currentColor\n");
+ break;
+ case CSS_COLUMN_RULE_COLOR_COLOR:
+ wrote = snprintf(ptr, *len, "column-rule-color: #%08x\n",
+ color);
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
/* content */
val = css_computed_content(style, &content);
switch (val) {
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=b8f5a46346fab991dd38...
commit b8f5a46346fab991dd385ea10a585f96b8948c7f
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add public accessor for column-rule-color in computed styles.
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index 79da3d5..8f2437f 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -343,6 +343,10 @@ uint8_t css_computed_column_gap(
const css_computed_style *style,
css_fixed *length, css_unit *unit);
+uint8_t css_computed_column_rule_color(
+ const css_computed_style *style,
+ css_color *color);
+
uint8_t css_computed_display(
const css_computed_style *style, bool root);
diff --git a/src/select/computed.c b/src/select/computed.c
index 105633e..53f33d6 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -804,6 +804,12 @@ uint8_t css_computed_column_gap(const css_computed_style *style,
return get_column_gap(style, length, unit);
}
+uint8_t css_computed_column_rule_color(const css_computed_style *style,
+ css_color *color)
+{
+ return get_column_rule_color(style, color);
+}
+
uint8_t css_computed_display(const css_computed_style *style,
bool root)
{
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=f30a2de02b63140a4f81...
commit f30a2de02b63140a4f8194419cef20c7375d6756
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add column-rule-color to computed styles.
diff --git a/src/select/computed.h b/src/select/computed.h
index 12d160a..2f90985 100644
--- a/src/select/computed.h
+++ b/src/select/computed.h
@@ -20,12 +20,13 @@ typedef struct css_computed_uncommon {
* column_count 2 4
* column_fill 2 0
* column_gap 2 + 4 4
+ * column_rule_color 2 4
* letter_spacing 2 + 4 4
* outline_color 2 4
* outline_width 3 + 4 4
* word_spacing 2 + 4 4
* --- ---
- * 62 bits 48 bytes
+ * 64 bits 52 bytes
*
* Encode counter_increment and _reset as an array of name, value pairs,
* terminated with a blank entry.
@@ -49,11 +50,11 @@ typedef struct css_computed_uncommon {
* 2 bits sizeof(ptr)
*
* ___ ___
- * 71 bits 48 + 4sizeof(ptr) bytes
+ * 73 bits 52 + 4sizeof(ptr) bytes
*
- * 10 bytes 48 + 4sizeof(ptr) bytes
+ * 10 bytes 52 + 4sizeof(ptr) bytes
* ===================
- * 58 + 4sizeof(ptr) bytes
+ * 62 + 4sizeof(ptr) bytes
*
* Bit allocations:
*
@@ -67,7 +68,7 @@ typedef struct css_computed_uncommon {
* 7 cccccccc clip
* 8 ccccccoo clip | content
* 9 ccff.... column_count | column-fill | <unused>
- * 10 gggggg.. column-gap | <unused>
+ * 10 ggggggcc column-gap | column-rule-color
*/
uint8_t bits[10];
@@ -84,6 +85,7 @@ typedef struct css_computed_uncommon {
int32_t column_count;
css_fixed column_gap;
+ css_color column_rule_color;
css_computed_counter *counter_increment;
css_computed_counter *counter_reset;
diff --git a/src/select/properties/column_rule_color.c b/src/select/properties/column_rule_color.c
index 933cb60..d4b0e77 100644
--- a/src/select/properties/column_rule_color.c
+++ b/src/select/properties/column_rule_color.c
@@ -17,24 +17,31 @@
css_error css__cascade_column_rule_color(uint32_t opv, css_style *style,
css_select_state *state)
{
+ bool inherit = isInherit(opv);
+ uint16_t value = CSS_COLUMN_RULE_COLOR_INHERIT;
css_color color = 0;
if (isInherit(opv) == false) {
switch (getValue(opv)) {
- case COLUMN_RULE_COLOR_SET:
- color = *((css_fixed *) style->bytecode);
- advance_bytecode(style, sizeof(color));
- break;
case COLUMN_RULE_COLOR_TRANSPARENT:
+ value = CSS_COLUMN_RULE_COLOR_COLOR;
+ break;
case COLUMN_RULE_COLOR_CURRENT_COLOR:
- /** \todo convert to public values */
+ /* color: currentColor always computes to inherit */
+ value = CSS_COLUMN_RULE_COLOR_INHERIT;
+ inherit = true;
+ break;
+ case COLUMN_RULE_COLOR_SET:
+ value = CSS_COLUMN_RULE_COLOR_COLOR;
+ color = *((css_fixed *) style->bytecode);
+ advance_bytecode(style, sizeof(color));
break;
}
}
if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
- isInherit(opv))) {
- /** \todo set computed elevation */
+ inherit)) {
+ return set_column_rule_color(state->computed, value, color);
}
return CSS_OK;
@@ -43,27 +50,26 @@ css_error css__cascade_column_rule_color(uint32_t opv, css_style *style,
css_error css__set_column_rule_color_from_hint(const css_hint *hint,
css_computed_style *style)
{
- UNUSED(hint);
- UNUSED(style);
-
- return CSS_OK;
+ return set_column_rule_color(style, hint->status, hint->data.color);
}
css_error css__initial_column_rule_color(css_select_state *state)
{
- UNUSED(state);
-
- return CSS_OK;
+ return set_column_rule_color(state->computed,
+ CSS_COLUMN_RULE_COLOR_INHERIT, 0);
}
css_error css__compose_column_rule_color(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
- UNUSED(parent);
- UNUSED(child);
- UNUSED(result);
+ css_color color;
+ uint8_t type = get_column_rule_color(child, &color);
- return CSS_OK;
+ if (type == CSS_COLUMN_RULE_COLOR_INHERIT) {
+ type = get_column_rule_color(parent, &color);
+ }
+
+ return set_column_rule_color(result, type, color);
}
diff --git a/src/select/propget.h b/src/select/propget.h
index 63eea95..6150ff7 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -413,6 +413,31 @@ static inline uint8_t get_column_gap(
#undef COLUMN_GAP_SHIFT
#undef COLUMN_GAP_INDEX
+#define COLUMN_RULE_COLOR_INDEX 9
+#define COLUMN_RULE_COLOR_SHIFT 0
+#define COLUMN_RULE_COLOR_MASK 0x3
+static inline uint8_t get_column_rule_color(
+ const css_computed_style *style,
+ css_color *color)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[COLUMN_RULE_COLOR_INDEX];
+ bits &= COLUMN_RULE_COLOR_MASK;
+ bits >>= COLUMN_RULE_COLOR_SHIFT;
+
+ /* 2bits: type */
+ *color = style->uncommon->column_rule_color;
+
+ return bits;
+ }
+
+ *color = 0;
+ return CSS_COLUMN_RULE_COLOR_CURRENT_COLOR;
+}
+#undef COLUMN_RULE_COLOR_MASK
+#undef COLUMN_RULE_COLOR_SHIFT
+#undef COLUMN_RULE_COLOR_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
diff --git a/src/select/propset.h b/src/select/propset.h
index 8d43301..834ed77 100644
--- a/src/select/propset.h
+++ b/src/select/propset.h
@@ -27,7 +27,7 @@ static const css_computed_uncommon default_uncommon = {
0,
(CSS_CLIP_AUTO << 2) | CSS_CONTENT_NORMAL,
(CSS_COLUMN_COUNT_AUTO << 6) | (CSS_COLUMN_FILL_BALANCE << 4),
- (CSS_COLUMN_GAP_NORMAL << 2)
+ (CSS_COLUMN_GAP_NORMAL << 2) | (CSS_COLUMN_RULE_COLOR_CURRENT_COLOR)
},
{ 0, 0 },
{ 0, 0, 0, 0 },
@@ -37,6 +37,7 @@ static const css_computed_uncommon default_uncommon = {
0,
0,
0,
+ 0,
NULL,
NULL,
NULL,
@@ -479,6 +480,31 @@ static inline css_error set_column_gap(
#undef COLUMN_GAP_SHIFT
#undef COLUMN_GAP_INDEX
+#define COLUMN_RULE_COLOR_INDEX 9
+#define COLUMN_RULE_COLOR_SHIFT 0
+#define COLUMN_RULE_COLOR_MASK 0x3
+static inline css_error set_column_rule_color(
+ css_computed_style *style, uint8_t type,
+ css_color color)
+{
+ uint8_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->uncommon->bits[COLUMN_RULE_COLOR_INDEX];
+
+ /* 2bits: type */
+ *bits = (*bits & ~COLUMN_RULE_COLOR_MASK) |
+ ((type & 0x3) << COLUMN_RULE_COLOR_SHIFT);
+
+ style->uncommon->column_rule_color = color;
+
+ return CSS_OK;
+}
+#undef COLUMN_RULE_COLOR_MASK
+#undef COLUMN_RULE_COLOR_SHIFT
+#undef COLUMN_RULE_COLOR_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=4f240a620321b64354f6...
commit 4f240a620321b64354f64d07b382fdf3caa09109
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Share colour enum values.
diff --git a/src/bytecode/opcodes.h b/src/bytecode/opcodes.h
index d61d923..4f80142 100644
--- a/src/bytecode/opcodes.h
+++ b/src/bytecode/opcodes.h
@@ -180,9 +180,9 @@ enum op_column_gap {
};
enum op_column_rule_color {
- COLUMN_RULE_COLOR_TRANSPARENT = 0x0000,
- COLUMN_RULE_COLOR_CURRENT_COLOR = 0x0001,
- COLUMN_RULE_COLOR_SET = 0x0080
+ COLUMN_RULE_COLOR_TRANSPARENT = COLOR_TRANSPARENT,
+ COLUMN_RULE_COLOR_CURRENT_COLOR = COLOR_CURRENT_COLOR,
+ COLUMN_RULE_COLOR_SET = COLOR_SET
};
enum op_column_rule_style {
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=e12b2fe9078be45e0d0c...
commit e12b2fe9078be45e0d0cbcbeb9e725e054eff9f9
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Column rule colour of "invert" is not allowed.
diff --git a/src/bytecode/opcodes.h b/src/bytecode/opcodes.h
index 544687a..d61d923 100644
--- a/src/bytecode/opcodes.h
+++ b/src/bytecode/opcodes.h
@@ -182,7 +182,6 @@ enum op_column_gap {
enum op_column_rule_color {
COLUMN_RULE_COLOR_TRANSPARENT = 0x0000,
COLUMN_RULE_COLOR_CURRENT_COLOR = 0x0001,
- COLUMN_RULE_COLOR_INVERT = 0x0002,
COLUMN_RULE_COLOR_SET = 0x0080
};
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=a2b959b31cb146e5dfe7...
commit a2b959b31cb146e5dfe7cfc2f5ebdc299535c950
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Share enum values for another property.
diff --git a/include/libcss/properties.h b/include/libcss/properties.h
index 6bd3cb1..47555f2 100644
--- a/include/libcss/properties.h
+++ b/include/libcss/properties.h
@@ -737,9 +737,9 @@ enum css_width_e {
};
enum css_word_spacing_e {
- CSS_WORD_SPACING_INHERIT = 0x0,
- CSS_WORD_SPACING_SET = 0x1,
- CSS_WORD_SPACING_NORMAL = 0x2
+ CSS_WORD_SPACING_INHERIT = CSS_COLUMN_GAP_INHERIT,
+ CSS_WORD_SPACING_SET = CSS_COLUMN_GAP_SET,
+ CSS_WORD_SPACING_NORMAL = CSS_COLUMN_GAP_NORMAL
};
enum css_writing_mode_e {
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=9311b3d167a3e5b69e1c...
commit 9311b3d167a3e5b69e1cfbb388a35c68a6848059
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Remove trailing whitespace.
diff --git a/src/select/propget.h b/src/select/propget.h
index c450a45..63eea95 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -18,7 +18,7 @@
#define LETTER_SPACING_SHIFT 2
#define LETTER_SPACING_MASK 0xfc
static inline uint8_t get_letter_spacing(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
if (style->uncommon != NULL) {
@@ -72,7 +72,7 @@ static inline uint8_t get_outline_color(
#define OUTLINE_WIDTH_SHIFT 1
#define OUTLINE_WIDTH_MASK 0xfe
static inline uint8_t get_outline_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
if (style->uncommon != NULL) {
@@ -106,7 +106,7 @@ static inline uint8_t get_outline_width(
#define BORDER_SPACING_SHIFT1 0
#define BORDER_SPACING_MASK1 0xff
static inline uint8_t get_border_spacing(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *hlength, css_unit *hunit,
css_fixed *vlength, css_unit *vunit)
{
@@ -117,7 +117,7 @@ static inline uint8_t get_border_spacing(
/* 1 bit: type */
if (bits == CSS_BORDER_SPACING_SET) {
- uint8_t bits1 =
+ uint8_t bits1 =
style->uncommon->bits[BORDER_SPACING_INDEX1];
bits1 &= BORDER_SPACING_MASK1;
bits1 >>= BORDER_SPACING_SHIFT1;
@@ -150,7 +150,7 @@ static inline uint8_t get_border_spacing(
#define WORD_SPACING_SHIFT 2
#define WORD_SPACING_MASK 0xfc
static inline uint8_t get_word_spacing(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
if (style->uncommon != NULL) {
@@ -199,7 +199,7 @@ static inline uint8_t get_writing_mode(
#define COUNTER_INCREMENT_SHIFT 1
#define COUNTER_INCREMENT_MASK 0x2
static inline uint8_t get_counter_increment(
- const css_computed_style *style,
+ const css_computed_style *style,
const css_computed_counter **counters)
{
if (style->uncommon != NULL) {
@@ -223,7 +223,7 @@ static inline uint8_t get_counter_increment(
#define COUNTER_RESET_SHIFT 0
#define COUNTER_RESET_MASK 0x1
static inline uint8_t get_counter_reset(
- const css_computed_style *style,
+ const css_computed_style *style,
const css_computed_counter **counters)
{
if (style->uncommon != NULL) {
@@ -247,7 +247,7 @@ static inline uint8_t get_counter_reset(
#define CURSOR_SHIFT 3
#define CURSOR_MASK 0xf8
static inline uint8_t get_cursor(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string ***urls)
{
if (style->uncommon != NULL) {
@@ -277,7 +277,7 @@ static inline uint8_t get_cursor(
#define CLIP_SHIFT2 0
#define CLIP_MASK2 0xff
static inline uint8_t get_clip(
- const css_computed_style *style,
+ const css_computed_style *style,
css_computed_clip_rect *rect)
{
if (style->uncommon != NULL) {
@@ -287,7 +287,7 @@ static inline uint8_t get_clip(
/* 6bits: trblyy : top | right | bottom | left | type */
if ((bits & 0x3) == CSS_CLIP_RECT) {
- uint8_t bits1;
+ uint8_t bits1;
rect->left_auto = (bits & 0x4);
rect->bottom_auto = (bits & 0x8);
@@ -417,7 +417,7 @@ static inline uint8_t get_column_gap(
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
static inline uint8_t get_content(
- const css_computed_style *style,
+ const css_computed_style *style,
const css_computed_content_item **content)
{
if (style->uncommon != NULL) {
@@ -441,7 +441,7 @@ static inline uint8_t get_content(
#define VERTICAL_ALIGN_SHIFT 0
#define VERTICAL_ALIGN_MASK 0xff
static inline uint8_t get_vertical_align(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[VERTICAL_ALIGN_INDEX];
@@ -464,7 +464,7 @@ static inline uint8_t get_vertical_align(
#define FONT_SIZE_SHIFT 0
#define FONT_SIZE_MASK 0xff
static inline uint8_t get_font_size(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[FONT_SIZE_INDEX];
@@ -487,7 +487,7 @@ static inline uint8_t get_font_size(
#define BORDER_TOP_WIDTH_SHIFT 1
#define BORDER_TOP_WIDTH_MASK 0xfe
static inline uint8_t get_border_top_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[BORDER_TOP_WIDTH_INDEX];
@@ -510,7 +510,7 @@ static inline uint8_t get_border_top_width(
#define BORDER_RIGHT_WIDTH_SHIFT 1
#define BORDER_RIGHT_WIDTH_MASK 0xfe
static inline uint8_t get_border_right_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[BORDER_RIGHT_WIDTH_INDEX];
@@ -533,7 +533,7 @@ static inline uint8_t get_border_right_width(
#define BORDER_BOTTOM_WIDTH_SHIFT 1
#define BORDER_BOTTOM_WIDTH_MASK 0xfe
static inline uint8_t get_border_bottom_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[BORDER_BOTTOM_WIDTH_INDEX];
@@ -556,7 +556,7 @@ static inline uint8_t get_border_bottom_width(
#define BORDER_LEFT_WIDTH_SHIFT 1
#define BORDER_LEFT_WIDTH_MASK 0xfe
static inline uint8_t get_border_left_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[BORDER_LEFT_WIDTH_INDEX];
@@ -579,7 +579,7 @@ static inline uint8_t get_border_left_width(
#define BACKGROUND_IMAGE_SHIFT 0
#define BACKGROUND_IMAGE_MASK 0x1
static inline uint8_t get_background_image(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string **url)
{
uint8_t bits = style->bits[BACKGROUND_IMAGE_INDEX];
@@ -599,7 +599,7 @@ static inline uint8_t get_background_image(
#define COLOR_SHIFT 0
#define COLOR_MASK 0x1
static inline uint8_t get_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color)
{
uint8_t bits = style->bits[COLOR_INDEX];
@@ -619,7 +619,7 @@ static inline uint8_t get_color(
#define LIST_STYLE_IMAGE_SHIFT 0
#define LIST_STYLE_IMAGE_MASK 0x1
static inline uint8_t get_list_style_image(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string **url)
{
uint8_t bits = style->bits[LIST_STYLE_IMAGE_INDEX];
@@ -639,7 +639,7 @@ static inline uint8_t get_list_style_image(
#define QUOTES_SHIFT 0
#define QUOTES_MASK 0x1
static inline uint8_t get_quotes(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string ***quotes)
{
uint8_t bits = style->bits[QUOTES_INDEX];
@@ -659,7 +659,7 @@ static inline uint8_t get_quotes(
#define TOP_SHIFT 2
#define TOP_MASK 0xfc
static inline uint8_t get_top(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[TOP_INDEX];
@@ -692,7 +692,7 @@ static inline uint8_t get_top_bits(
#define RIGHT_SHIFT 2
#define RIGHT_MASK 0xfc
static inline uint8_t get_right(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[RIGHT_INDEX];
@@ -725,7 +725,7 @@ static inline uint8_t get_right_bits(
#define BOTTOM_SHIFT 2
#define BOTTOM_MASK 0xfc
static inline uint8_t get_bottom(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[BOTTOM_INDEX];
@@ -758,7 +758,7 @@ static inline uint8_t get_bottom_bits(
#define LEFT_SHIFT 2
#define LEFT_MASK 0xfc
static inline uint8_t get_left(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[LEFT_INDEX];
@@ -791,7 +791,7 @@ static inline uint8_t get_left_bits(
#define BORDER_TOP_COLOR_SHIFT 0
#define BORDER_TOP_COLOR_MASK 0x3
static inline uint8_t get_border_top_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color)
{
uint8_t bits = style->bits[BORDER_TOP_COLOR_INDEX];
@@ -811,7 +811,7 @@ static inline uint8_t get_border_top_color(
#define BORDER_RIGHT_COLOR_SHIFT 0
#define BORDER_RIGHT_COLOR_MASK 0x3
static inline uint8_t get_border_right_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color)
{
uint8_t bits = style->bits[BORDER_RIGHT_COLOR_INDEX];
@@ -831,7 +831,7 @@ static inline uint8_t get_border_right_color(
#define BORDER_BOTTOM_COLOR_SHIFT 0
#define BORDER_BOTTOM_COLOR_MASK 0x3
static inline uint8_t get_border_bottom_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color)
{
uint8_t bits = style->bits[BORDER_BOTTOM_COLOR_INDEX];
@@ -851,7 +851,7 @@ static inline uint8_t get_border_bottom_color(
#define BORDER_LEFT_COLOR_SHIFT 0
#define BORDER_LEFT_COLOR_MASK 0x3
static inline uint8_t get_border_left_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color)
{
uint8_t bits = style->bits[BORDER_LEFT_COLOR_INDEX];
@@ -871,7 +871,7 @@ static inline uint8_t get_border_left_color(
#define HEIGHT_SHIFT 2
#define HEIGHT_MASK 0xfc
static inline uint8_t get_height(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[HEIGHT_INDEX];
@@ -894,7 +894,7 @@ static inline uint8_t get_height(
#define LINE_HEIGHT_SHIFT 2
#define LINE_HEIGHT_MASK 0xfc
static inline uint8_t get_line_height(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[LINE_HEIGHT_INDEX];
@@ -902,7 +902,7 @@ static inline uint8_t get_line_height(
bits >>= LINE_HEIGHT_SHIFT;
/* 6bits: uuuutt : units | type */
- if ((bits & 0x3) == CSS_LINE_HEIGHT_NUMBER ||
+ if ((bits & 0x3) == CSS_LINE_HEIGHT_NUMBER ||
(bits & 0x3) == CSS_LINE_HEIGHT_DIMENSION) {
*length = style->line_height;
}
@@ -921,7 +921,7 @@ static inline uint8_t get_line_height(
#define BACKGROUND_COLOR_SHIFT 0
#define BACKGROUND_COLOR_MASK 0x3
static inline uint8_t get_background_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color)
{
uint8_t bits = style->bits[BACKGROUND_COLOR_INDEX];
@@ -941,7 +941,7 @@ static inline uint8_t get_background_color(
#define Z_INDEX_SHIFT 0
#define Z_INDEX_MASK 0x3
static inline uint8_t get_z_index(
- const css_computed_style *style,
+ const css_computed_style *style,
int32_t *z_index)
{
uint8_t bits = style->bits[Z_INDEX_INDEX];
@@ -961,7 +961,7 @@ static inline uint8_t get_z_index(
#define MARGIN_TOP_SHIFT 2
#define MARGIN_TOP_MASK 0xfc
static inline uint8_t get_margin_top(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[MARGIN_TOP_INDEX];
@@ -984,7 +984,7 @@ static inline uint8_t get_margin_top(
#define MARGIN_RIGHT_SHIFT 2
#define MARGIN_RIGHT_MASK 0xfc
static inline uint8_t get_margin_right(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[MARGIN_RIGHT_INDEX];
@@ -1007,7 +1007,7 @@ static inline uint8_t get_margin_right(
#define MARGIN_BOTTOM_SHIFT 2
#define MARGIN_BOTTOM_MASK 0xfc
static inline uint8_t get_margin_bottom(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[MARGIN_BOTTOM_INDEX];
@@ -1030,7 +1030,7 @@ static inline uint8_t get_margin_bottom(
#define MARGIN_LEFT_SHIFT 2
#define MARGIN_LEFT_MASK 0xfc
static inline uint8_t get_margin_left(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[MARGIN_LEFT_INDEX];
@@ -1121,7 +1121,7 @@ static inline uint8_t get_direction(
#define MAX_HEIGHT_SHIFT 2
#define MAX_HEIGHT_MASK 0xfc
static inline uint8_t get_max_height(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[MAX_HEIGHT_INDEX];
@@ -1144,7 +1144,7 @@ static inline uint8_t get_max_height(
#define MAX_WIDTH_SHIFT 2
#define MAX_WIDTH_MASK 0xfc
static inline uint8_t get_max_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[MAX_WIDTH_INDEX];
@@ -1167,7 +1167,7 @@ static inline uint8_t get_max_width(
#define WIDTH_SHIFT 2
#define WIDTH_MASK 0xfc
static inline uint8_t get_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[WIDTH_INDEX];
@@ -1241,7 +1241,7 @@ static inline uint8_t get_font_style(
#define MIN_HEIGHT_SHIFT 3
#define MIN_HEIGHT_MASK 0xf8
static inline uint8_t get_min_height(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[MIN_HEIGHT_INDEX];
@@ -1264,7 +1264,7 @@ static inline uint8_t get_min_height(
#define MIN_WIDTH_SHIFT 3
#define MIN_WIDTH_MASK 0xf8
static inline uint8_t get_min_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[MIN_WIDTH_INDEX];
@@ -1321,7 +1321,7 @@ static inline uint8_t get_clear(
#define PADDING_TOP_SHIFT 3
#define PADDING_TOP_MASK 0xf8
static inline uint8_t get_padding_top(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[PADDING_TOP_INDEX];
@@ -1344,7 +1344,7 @@ static inline uint8_t get_padding_top(
#define PADDING_RIGHT_SHIFT 3
#define PADDING_RIGHT_MASK 0xf8
static inline uint8_t get_padding_right(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[PADDING_RIGHT_INDEX];
@@ -1367,7 +1367,7 @@ static inline uint8_t get_padding_right(
#define PADDING_BOTTOM_SHIFT 3
#define PADDING_BOTTOM_MASK 0xf8
static inline uint8_t get_padding_bottom(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[PADDING_BOTTOM_INDEX];
@@ -1390,7 +1390,7 @@ static inline uint8_t get_padding_bottom(
#define PADDING_LEFT_SHIFT 3
#define PADDING_LEFT_MASK 0xf8
static inline uint8_t get_padding_left(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[PADDING_LEFT_INDEX];
@@ -1464,7 +1464,7 @@ static inline uint8_t get_position(
#define OPACITY_SHIFT 2
#define OPACITY_MASK 0x04
static inline uint8_t get_opacity(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *opacity)
{
uint8_t bits = style->bits[OPACITY_INDEX];
@@ -1503,7 +1503,7 @@ static inline uint8_t get_text_transform(
#define TEXT_INDENT_SHIFT 3
#define TEXT_INDENT_MASK 0xf8
static inline uint8_t get_text_indent(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[TEXT_INDENT_INDEX];
@@ -1546,7 +1546,7 @@ static inline uint8_t get_white_space(
#define BACKGROUND_POSITION_SHIFT1 0
#define BACKGROUND_POSITION_MASK1 0xff
static inline uint8_t get_background_position(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *hlength, css_unit *hunit,
css_fixed *vlength, css_unit *vunit)
{
@@ -1632,7 +1632,7 @@ static inline uint8_t get_text_decoration(
#define FONT_FAMILY_SHIFT 0
#define FONT_FAMILY_MASK 0x7
static inline uint8_t get_font_family(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string ***names)
{
uint8_t bits = style->bits[FONT_FAMILY_INDEX];
@@ -1872,7 +1872,7 @@ static inline uint8_t get_page_break_after(
#undef PAGE_BREAK_AFTER_MASK
#undef PAGE_BREAK_AFTER_SHIFT
#undef PAGE_BREAK_AFTER_INDEX
-
+
#define PAGE_BREAK_BEFORE_INDEX 0
#define PAGE_BREAK_BEFORE_SHIFT 3
#define PAGE_BREAK_BEFORE_MASK 0x38
@@ -1887,13 +1887,13 @@ static inline uint8_t get_page_break_before(
/* 3bits: type */
return bits;
}
-
+
return CSS_PAGE_BREAK_BEFORE_AUTO;
}
#undef PAGE_BREAK_BEFORE_MASK
#undef PAGE_BREAK_BEFORE_SHIFT
#undef PAGE_BREAK_BEFORE_INDEX
-
+
#define PAGE_BREAK_INSIDE_INDEX 0
#define PAGE_BREAK_INSIDE_SHIFT 6
#define PAGE_BREAK_INSIDE_MASK 0xc0
@@ -1926,13 +1926,13 @@ static inline uint8_t get_orphans(
uint8_t bits = style->page->bits[ORPHANS_INDEX];
bits &= ORPHANS_MASK;
bits >>= ORPHANS_SHIFT;
-
+
*orphans = style->page->orphans;
-
+
/* 1bit: type */
return bits;
}
-
+
*orphans = 2;
return CSS_ORPHANS_SET;
}
@@ -1951,13 +1951,13 @@ static inline uint8_t get_widows(
uint8_t bits = style->page->bits[WIDOWS_INDEX];
bits &= WIDOWS_MASK;
bits >>= WIDOWS_SHIFT;
-
+
*widows = style->page->widows;
-
+
/* 1bit: type */
return bits;
}
-
+
*widows = 2;
return CSS_WIDOWS_SET;
}
diff --git a/src/select/propset.h b/src/select/propset.h
index acb2817..8d43301 100644
--- a/src/select/propset.h
+++ b/src/select/propset.h
@@ -20,7 +20,7 @@ static const css_computed_uncommon default_uncommon = {
{ (CSS_LETTER_SPACING_INHERIT << 2) | CSS_OUTLINE_COLOR_INVERT,
(CSS_OUTLINE_WIDTH_MEDIUM << 1) | CSS_BORDER_SPACING_INHERIT,
0,
- (CSS_WORD_SPACING_INHERIT << 2) |
+ (CSS_WORD_SPACING_INHERIT << 2) |
(CSS_COUNTER_INCREMENT_NONE << 1) | CSS_COUNTER_RESET_NONE,
(CSS_CURSOR_INHERIT << 3) | (CSS_WRITING_MODE_INHERIT << 1) | 0,
0,
@@ -55,14 +55,14 @@ static const css_computed_uncommon default_uncommon = {
} while(0)
static const css_computed_page default_page = {
- {
- (CSS_PAGE_BREAK_INSIDE_AUTO << 6) |
+ {
+ (CSS_PAGE_BREAK_INSIDE_AUTO << 6) |
(CSS_PAGE_BREAK_BEFORE_AUTO << 3) |
CSS_PAGE_BREAK_AFTER_AUTO,
- (CSS_WIDOWS_SET << 1) |
+ (CSS_WIDOWS_SET << 1) |
CSS_ORPHANS_SET
},
- 2 << CSS_RADIX_POINT,
+ 2 << CSS_RADIX_POINT,
2 << CSS_RADIX_POINT
};
@@ -81,7 +81,7 @@ static const css_computed_page default_page = {
#define LETTER_SPACING_SHIFT 2
#define LETTER_SPACING_MASK 0xfc
static inline css_error set_letter_spacing(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits;
@@ -91,7 +91,7 @@ static inline css_error set_letter_spacing(
bits = &style->uncommon->bits[LETTER_SPACING_INDEX];
/* 6bits: uuuutt : unit | type */
- *bits = (*bits & ~LETTER_SPACING_MASK) |
+ *bits = (*bits & ~LETTER_SPACING_MASK) |
(((type & 0x3) | unit << 2) << LETTER_SPACING_SHIFT);
style->uncommon->letter_spacing = length;
@@ -130,7 +130,7 @@ static inline css_error set_outline_color(
#define OUTLINE_WIDTH_SHIFT 1
#define OUTLINE_WIDTH_MASK 0xfe
static inline css_error set_outline_width(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits;
@@ -157,7 +157,7 @@ static inline css_error set_outline_width(
#define BORDER_SPACING_INDEX1 2
#define BORDER_SPACING_SHIFT1 0
static inline css_error set_border_spacing(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed hlength, css_unit hunit,
css_fixed vlength, css_unit vunit)
{
@@ -168,7 +168,7 @@ static inline css_error set_border_spacing(
bits = &style->uncommon->bits[BORDER_SPACING_INDEX];
/* 1 bit: type */
- *bits = (*bits & ~BORDER_SPACING_MASK) |
+ *bits = (*bits & ~BORDER_SPACING_MASK) |
((type & 0x1) << BORDER_SPACING_SHIFT);
bits = &style->uncommon->bits[BORDER_SPACING_INDEX1];
@@ -192,7 +192,7 @@ static inline css_error set_border_spacing(
#define WORD_SPACING_SHIFT 2
#define WORD_SPACING_MASK 0xfc
static inline css_error set_word_spacing(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits;
@@ -204,7 +204,7 @@ static inline css_error set_word_spacing(
/* 6bits: uuuutt : unit | type */
*bits = (*bits & ~WORD_SPACING_MASK) |
(((type & 0x3) | (unit << 2)) << WORD_SPACING_SHIFT);
-
+
style->uncommon->word_spacing = length;
return CSS_OK;
@@ -239,7 +239,7 @@ static inline css_error set_writing_mode(
#define COUNTER_INCREMENT_SHIFT 1
#define COUNTER_INCREMENT_MASK 0x2
static inline css_error set_counter_increment(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_computed_counter *counters)
{
uint8_t *bits;
@@ -279,7 +279,7 @@ static inline css_error set_counter_increment(
#define COUNTER_RESET_SHIFT 0
#define COUNTER_RESET_MASK 0x1
static inline css_error set_counter_reset(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_computed_counter *counters)
{
uint8_t *bits;
@@ -319,7 +319,7 @@ static inline css_error set_counter_reset(
#define CURSOR_SHIFT 3
#define CURSOR_MASK 0xf8
static inline css_error set_cursor(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
lwc_string **urls)
{
uint8_t *bits;
@@ -363,7 +363,7 @@ static inline css_error set_cursor(
#define CLIP_INDEX2 6
#define CLIP_SHIFT2 0
static inline css_error set_clip(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_computed_clip_rect *rect)
{
uint8_t *bits;
@@ -373,7 +373,7 @@ static inline css_error set_clip(
bits = &style->uncommon->bits[CLIP_INDEX];
/* 6bits: trblyy : top | right | bottom | left | type */
- *bits = (*bits & ~CLIP_MASK) |
+ *bits = (*bits & ~CLIP_MASK) |
((type & 0x3) << CLIP_SHIFT);
if (type == CSS_CLIP_RECT) {
@@ -499,7 +499,7 @@ static inline css_error set_content(
*bits = (*bits & ~CONTENT_MASK) |
((type & 0x3) << CONTENT_SHIFT);
- for (c = content; c != NULL &&
+ for (c = content; c != NULL &&
c->type != CSS_COMPUTED_CONTENT_NONE; c++) {
switch (c->type) {
case CSS_COMPUTED_CONTENT_STRING:
@@ -516,9 +516,9 @@ static inline css_error set_content(
lwc_string_ref(c->data.counter.name);
break;
case CSS_COMPUTED_CONTENT_COUNTERS:
- c->data.counters.name =
+ c->data.counters.name =
lwc_string_ref(c->data.counters.name);
- c->data.counters.sep =
+ c->data.counters.sep =
lwc_string_ref(c->data.counters.sep);
break;
default:
@@ -530,7 +530,7 @@ static inline css_error set_content(
/* Free existing array */
if (oldcontent != NULL) {
- for (c = oldcontent;
+ for (c = oldcontent;
c->type != CSS_COMPUTED_CONTENT_NONE; c++) {
switch (c->type) {
case CSS_COMPUTED_CONTENT_STRING:
@@ -568,7 +568,7 @@ static inline css_error set_content(
#define VERTICAL_ALIGN_INDEX 0
#define VERTICAL_ALIGN_SHIFT 0
static inline css_error set_vertical_align(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[VERTICAL_ALIGN_INDEX];
@@ -586,7 +586,7 @@ static inline css_error set_vertical_align(
#define FONT_SIZE_INDEX 1
#define FONT_SIZE_SHIFT 0
static inline css_error set_font_size(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[FONT_SIZE_INDEX];
@@ -605,7 +605,7 @@ static inline css_error set_font_size(
#define BORDER_TOP_WIDTH_SHIFT 1
#define BORDER_TOP_WIDTH_MASK 0xfe
static inline css_error set_border_top_width(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[BORDER_TOP_WIDTH_INDEX];
@@ -626,7 +626,7 @@ static inline css_error set_border_top_width(
#define BORDER_RIGHT_WIDTH_SHIFT 1
#define BORDER_RIGHT_WIDTH_MASK 0xfe
static inline css_error set_border_right_width(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[BORDER_RIGHT_WIDTH_INDEX];
@@ -647,7 +647,7 @@ static inline css_error set_border_right_width(
#define BORDER_BOTTOM_WIDTH_SHIFT 1
#define BORDER_BOTTOM_WIDTH_MASK 0xfe
static inline css_error set_border_bottom_width(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[BORDER_BOTTOM_WIDTH_INDEX];
@@ -668,7 +668,7 @@ static inline css_error set_border_bottom_width(
#define BORDER_LEFT_WIDTH_SHIFT 1
#define BORDER_LEFT_WIDTH_MASK 0xfe
static inline css_error set_border_left_width(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[BORDER_LEFT_WIDTH_INDEX];
@@ -689,7 +689,7 @@ static inline css_error set_border_left_width(
#define BACKGROUND_IMAGE_SHIFT 0
#define BACKGROUND_IMAGE_MASK 0x1
static inline css_error set_background_image(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
lwc_string *url)
{
uint8_t *bits = &style->bits[BACKGROUND_IMAGE_INDEX];
@@ -718,7 +718,7 @@ static inline css_error set_background_image(
#define COLOR_SHIFT 0
#define COLOR_MASK 0x1
static inline css_error set_color(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_color color)
{
uint8_t *bits = &style->bits[COLOR_INDEX];
@@ -739,7 +739,7 @@ static inline css_error set_color(
#define LIST_STYLE_IMAGE_SHIFT 0
#define LIST_STYLE_IMAGE_MASK 0x1
static inline css_error set_list_style_image(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
lwc_string *url)
{
uint8_t *bits = &style->bits[LIST_STYLE_IMAGE_INDEX];
@@ -768,7 +768,7 @@ static inline css_error set_list_style_image(
#define QUOTES_SHIFT 0
#define QUOTES_MASK 0x1
static inline css_error set_quotes(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
lwc_string **quotes)
{
uint8_t *bits = &style->bits[QUOTES_INDEX];
@@ -803,7 +803,7 @@ static inline css_error set_quotes(
#define TOP_SHIFT 2
#define TOP_MASK 0xfc
static inline css_error set_top(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[TOP_INDEX];
@@ -824,7 +824,7 @@ static inline css_error set_top(
#define RIGHT_SHIFT 2
#define RIGHT_MASK 0xfc
static inline css_error set_right(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[RIGHT_INDEX];
@@ -845,7 +845,7 @@ static inline css_error set_right(
#define BOTTOM_SHIFT 2
#define BOTTOM_MASK 0xfc
static inline css_error set_bottom(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[BOTTOM_INDEX];
@@ -866,7 +866,7 @@ static inline css_error set_bottom(
#define LEFT_SHIFT 2
#define LEFT_MASK 0xfc
static inline css_error set_left(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[LEFT_INDEX];
@@ -887,7 +887,7 @@ static inline css_error set_left(
#define BORDER_TOP_COLOR_SHIFT 0
#define BORDER_TOP_COLOR_MASK 0x3
static inline css_error set_border_top_color(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_color color)
{
uint8_t *bits = &style->bits[BORDER_TOP_COLOR_INDEX];
@@ -908,7 +908,7 @@ static inline css_error set_border_top_color(
#define BORDER_RIGHT_COLOR_SHIFT 0
#define BORDER_RIGHT_COLOR_MASK 0x3
static inline css_error set_border_right_color(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_color color)
{
uint8_t *bits = &style->bits[BORDER_RIGHT_COLOR_INDEX];
@@ -929,7 +929,7 @@ static inline css_error set_border_right_color(
#define BORDER_BOTTOM_COLOR_SHIFT 0
#define BORDER_BOTTOM_COLOR_MASK 0x3
static inline css_error set_border_bottom_color(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_color color)
{
uint8_t *bits = &style->bits[BORDER_BOTTOM_COLOR_INDEX];
@@ -950,7 +950,7 @@ static inline css_error set_border_bottom_color(
#define BORDER_LEFT_COLOR_SHIFT 0
#define BORDER_LEFT_COLOR_MASK 0x3
static inline css_error set_border_left_color(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_color color)
{
uint8_t *bits = &style->bits[BORDER_LEFT_COLOR_INDEX];
@@ -971,7 +971,7 @@ static inline css_error set_border_left_color(
#define HEIGHT_SHIFT 2
#define HEIGHT_MASK 0xfc
static inline css_error set_height(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[HEIGHT_INDEX];
@@ -992,7 +992,7 @@ static inline css_error set_height(
#define LINE_HEIGHT_SHIFT 2
#define LINE_HEIGHT_MASK 0xfc
static inline css_error set_line_height(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[LINE_HEIGHT_INDEX];
@@ -1013,7 +1013,7 @@ static inline css_error set_line_height(
#define BACKGROUND_COLOR_SHIFT 0
#define BACKGROUND_COLOR_MASK 0x3
static inline css_error set_background_color(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_color color)
{
uint8_t *bits = &style->bits[BACKGROUND_COLOR_INDEX];
@@ -1034,7 +1034,7 @@ static inline css_error set_background_color(
#define Z_INDEX_SHIFT 0
#define Z_INDEX_MASK 0x3
static inline css_error set_z_index(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
int32_t z_index)
{
uint8_t *bits = &style->bits[Z_INDEX_INDEX];
@@ -1055,7 +1055,7 @@ static inline css_error set_z_index(
#define MARGIN_TOP_SHIFT 2
#define MARGIN_TOP_MASK 0xfc
static inline css_error set_margin_top(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[MARGIN_TOP_INDEX];
@@ -1076,7 +1076,7 @@ static inline css_error set_margin_top(
#define MARGIN_RIGHT_SHIFT 2
#define MARGIN_RIGHT_MASK 0xfc
static inline css_error set_margin_right(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[MARGIN_RIGHT_INDEX];
@@ -1097,7 +1097,7 @@ static inline css_error set_margin_right(
#define MARGIN_BOTTOM_SHIFT 2
#define MARGIN_BOTTOM_MASK 0xfc
static inline css_error set_margin_bottom(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[MARGIN_BOTTOM_INDEX];
@@ -1118,7 +1118,7 @@ static inline css_error set_margin_bottom(
#define MARGIN_LEFT_SHIFT 2
#define MARGIN_LEFT_MASK 0xfc
static inline css_error set_margin_left(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[MARGIN_LEFT_INDEX];
@@ -1211,7 +1211,7 @@ static inline css_error set_direction(
#define MAX_HEIGHT_SHIFT 2
#define MAX_HEIGHT_MASK 0xfc
static inline css_error set_max_height(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[MAX_HEIGHT_INDEX];
@@ -1232,7 +1232,7 @@ static inline css_error set_max_height(
#define MAX_WIDTH_SHIFT 2
#define MAX_WIDTH_MASK 0xfc
static inline css_error set_max_width(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[MAX_WIDTH_INDEX];
@@ -1253,7 +1253,7 @@ static inline css_error set_max_width(
#define WIDTH_SHIFT 2
#define WIDTH_MASK 0xfc
static inline css_error set_width(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[WIDTH_INDEX];
@@ -1328,7 +1328,7 @@ static inline css_error set_font_style(
#define MIN_HEIGHT_SHIFT 3
#define MIN_HEIGHT_MASK 0xf8
static inline css_error set_min_height(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[MIN_HEIGHT_INDEX];
@@ -1349,7 +1349,7 @@ static inline css_error set_min_height(
#define MIN_WIDTH_SHIFT 3
#define MIN_WIDTH_MASK 0xf8
static inline css_error set_min_width(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[MIN_WIDTH_INDEX];
@@ -1406,7 +1406,7 @@ static inline css_error set_clear(
#define PADDING_TOP_SHIFT 3
#define PADDING_TOP_MASK 0xf8
static inline css_error set_padding_top(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[PADDING_TOP_INDEX];
@@ -1427,7 +1427,7 @@ static inline css_error set_padding_top(
#define PADDING_RIGHT_SHIFT 3
#define PADDING_RIGHT_MASK 0xf8
static inline css_error set_padding_right(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[PADDING_RIGHT_INDEX];
@@ -1448,7 +1448,7 @@ static inline css_error set_padding_right(
#define PADDING_BOTTOM_SHIFT 3
#define PADDING_BOTTOM_MASK 0xf8
static inline css_error set_padding_bottom(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[PADDING_BOTTOM_INDEX];
@@ -1469,7 +1469,7 @@ static inline css_error set_padding_bottom(
#define PADDING_LEFT_SHIFT 3
#define PADDING_LEFT_MASK 0xf8
static inline css_error set_padding_left(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[PADDING_LEFT_INDEX];
@@ -1544,7 +1544,7 @@ static inline css_error set_position(
#define OPACITY_SHIFT 2
#define OPACITY_MASK 0x04
static inline css_error set_opacity(
- css_computed_style *style,
+ css_computed_style *style,
uint8_t type, css_fixed opacity)
{
uint8_t *bits = &style->bits[OPACITY_INDEX];
@@ -1583,7 +1583,7 @@ static inline css_error set_text_transform(
#define TEXT_INDENT_SHIFT 3
#define TEXT_INDENT_MASK 0xf8
static inline css_error set_text_indent(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[TEXT_INDENT_INDEX];
@@ -1624,7 +1624,7 @@ static inline css_error set_white_space(
#define BACKGROUND_POSITION_INDEX1 26
#define BACKGROUND_POSITION_SHIFT1 0
static inline css_error set_background_position(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed hlength, css_unit hunit,
css_fixed vlength, css_unit vunit)
{
@@ -1633,7 +1633,7 @@ static inline css_error set_background_position(
bits = &style->bits[BACKGROUND_POSITION_INDEX];
/* 1 bit: type */
- *bits = (*bits & ~BACKGROUND_POSITION_MASK) |
+ *bits = (*bits & ~BACKGROUND_POSITION_MASK) |
((type & 0x1) << BACKGROUND_POSITION_SHIFT);
bits = &style->bits[BACKGROUND_POSITION_INDEX1];
@@ -1710,7 +1710,7 @@ static inline css_error set_text_decoration(
#define FONT_FAMILY_SHIFT 0
#define FONT_FAMILY_MASK 0x7
static inline css_error set_font_family(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
lwc_string **names)
{
uint8_t *bits = &style->bits[FONT_FAMILY_INDEX];
@@ -1998,9 +1998,9 @@ static inline css_error set_page_break_before(
return CSS_OK;
}
}
-
+
ENSURE_PAGE;
-
+
bits = &style->page->bits[PAGE_BREAK_BEFORE_INDEX];
/* 3bits: type */
@@ -2026,7 +2026,7 @@ static inline css_error set_page_break_inside(
return CSS_OK;
}
}
-
+
ENSURE_PAGE;
bits = &style->page->bits[PAGE_BREAK_INSIDE_INDEX];
@@ -2048,7 +2048,7 @@ static inline css_error set_orphans(
css_computed_style *style, uint8_t type, int32_t count)
{
uint8_t *bits;
-
+
if (style->page == NULL) {
if (type == CSS_ORPHANS_SET && count == 2) {
return CSS_OK;
@@ -2056,14 +2056,14 @@ static inline css_error set_orphans(
}
ENSURE_PAGE;
-
+
bits = &style->page->bits[ORPHANS_INDEX];
-
+
/* 1bit: type */
*bits = (*bits & ~ORPHANS_MASK) | ((type & 0x1) << ORPHANS_SHIFT);
-
+
style->page->orphans = count;
-
+
return CSS_OK;
}
#undef ORPHANS_INDEX
@@ -2077,22 +2077,22 @@ static inline css_error set_widows(
css_computed_style *style, uint8_t type, int32_t count)
{
uint8_t *bits;
-
+
if (style->page == NULL) {
if (type == CSS_WIDOWS_SET && count == 2) {
return CSS_OK;
}
}
-
+
ENSURE_PAGE;
-
+
bits = &style->page->bits[WIDOWS_INDEX];
-
+
/* 1bit: type */
*bits = (*bits & ~WIDOWS_MASK) | ((type & 0x1) << WIDOWS_SHIFT);
-
+
style->page->widows = count;
-
+
return CSS_OK;
}
#undef WIDOWS_INDEX
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=9a2ff99021a4872bf3aa...
commit 9a2ff99021a4872bf3aaa15d3b4e293442c196b1
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add column-gap dumping to test rig, and update test data.
diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat
index c462066..217a21c 100644
--- a/test/data/select/tests1.dat
+++ b/test/data/select/tests1.dat
@@ -39,6 +39,7 @@ clip: auto
color: #ffff0000
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -138,6 +139,7 @@ clip: auto
color: #ffff0000
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -237,6 +239,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -336,6 +339,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -427,6 +431,7 @@ clip: auto
color: #ff000000
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -516,6 +521,7 @@ clip: auto
color: #ff000000
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -606,6 +612,7 @@ clip: auto
color: #ff000000
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -696,6 +703,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -785,6 +793,7 @@ clip: auto
color: #ff000000
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -879,6 +888,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -973,6 +983,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -1068,6 +1079,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -1166,6 +1178,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -1263,6 +1276,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -1366,6 +1380,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -1469,6 +1484,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -1572,6 +1588,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -1679,6 +1696,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -1785,6 +1803,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -1889,6 +1908,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -1992,6 +2012,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -2095,6 +2116,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -2198,6 +2220,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -2301,6 +2324,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -2404,6 +2428,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -2507,6 +2532,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -2610,6 +2636,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -2713,6 +2740,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -2816,6 +2844,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -2919,6 +2948,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -3022,6 +3052,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -3125,6 +3156,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -3228,6 +3260,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -3331,6 +3364,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -3434,6 +3468,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -3537,6 +3572,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -3640,6 +3676,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -3743,6 +3780,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -3846,6 +3884,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -3949,6 +3988,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -4045,6 +4085,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: balance
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -4141,6 +4182,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
@@ -4237,6 +4279,7 @@ clip: auto
color: inherit
column-count: auto
column-fill: inherit
+column-gap: normal
content: normal
counter-increment: none
counter-reset: none
diff --git a/test/dump_computed.h b/test/dump_computed.h
index 530b617..ace7fda 100644
--- a/test/dump_computed.h
+++ b/test/dump_computed.h
@@ -862,6 +862,33 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
ptr += wrote;
*len -= wrote;
+ /* column-gap */
+ val = css_computed_column_gap(style, &len1, &unit1);
+ switch (val) {
+ case CSS_COLUMN_GAP_INHERIT:
+ wrote = snprintf(ptr, *len, "column-gap: inherit\n");
+ break;
+ case CSS_COLUMN_GAP_NORMAL:
+ wrote = snprintf(ptr, *len, "column-gap: normal\n");
+ break;
+ case CSS_COLUMN_GAP_SET:
+ wrote = snprintf(ptr, *len, "column-gap: ");
+ ptr += wrote;
+ *len -= wrote;
+
+ wrote = dump_css_unit(len1, unit1, ptr, *len);
+ ptr += wrote;
+ *len -= wrote;
+
+ wrote = snprintf(ptr, *len, "\n");
+ break;
+ default:
+ wrote = 0;
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
/* content */
val = css_computed_content(style, &content);
switch (val) {
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=f536ddb7ad859cc95c96...
commit f536ddb7ad859cc95c96b733a96a83774333d321
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add public computed style access function for column-gap property.
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index eb50a9c..79da3d5 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -339,6 +339,10 @@ uint8_t css_computed_column_count(
uint8_t css_computed_column_fill(
const css_computed_style *style);
+uint8_t css_computed_column_gap(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit);
+
uint8_t css_computed_display(
const css_computed_style *style, bool root);
diff --git a/src/select/computed.c b/src/select/computed.c
index 25e2d17..105633e 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -798,6 +798,12 @@ uint8_t css_computed_column_fill(const css_computed_style *style)
return get_column_fill(style);
}
+uint8_t css_computed_column_gap(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ return get_column_gap(style, length, unit);
+}
+
uint8_t css_computed_display(const css_computed_style *style,
bool root)
{
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=ad85983173b7cf21c5b4...
commit ad85983173b7cf21c5b46f7fb3798afdb38e9fea
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Implement selection for column-gap property.
diff --git a/src/select/computed.h b/src/select/computed.h
index 23b0cb6..12d160a 100644
--- a/src/select/computed.h
+++ b/src/select/computed.h
@@ -19,12 +19,13 @@ typedef struct css_computed_uncommon {
* clip 2 + 4(4) + 4 4(4)
* column_count 2 4
* column_fill 2 0
+ * column_gap 2 + 4 4
* letter_spacing 2 + 4 4
* outline_color 2 4
* outline_width 3 + 4 4
* word_spacing 2 + 4 4
* --- ---
- * 56 bits 44 bytes
+ * 62 bits 48 bytes
*
* Encode counter_increment and _reset as an array of name, value pairs,
* terminated with a blank entry.
@@ -48,11 +49,11 @@ typedef struct css_computed_uncommon {
* 2 bits sizeof(ptr)
*
* ___ ___
- * 65 bits 44 + 4sizeof(ptr) bytes
+ * 71 bits 48 + 4sizeof(ptr) bytes
*
- * 8 bytes 44 + 4sizeof(ptr) bytes
+ * 10 bytes 48 + 4sizeof(ptr) bytes
* ===================
- * 52 + 4sizeof(ptr) bytes
+ * 58 + 4sizeof(ptr) bytes
*
* Bit allocations:
*
@@ -66,8 +67,9 @@ typedef struct css_computed_uncommon {
* 7 cccccccc clip
* 8 ccccccoo clip | content
* 9 ccff.... column_count | column-fill | <unused>
+ * 10 gggggg.. column-gap | <unused>
*/
- uint8_t bits[9];
+ uint8_t bits[10];
css_fixed border_spacing[2];
@@ -81,6 +83,7 @@ typedef struct css_computed_uncommon {
css_fixed word_spacing;
int32_t column_count;
+ css_fixed column_gap;
css_computed_counter *counter_increment;
css_computed_counter *counter_reset;
diff --git a/src/select/properties/column_gap.c b/src/select/properties/column_gap.c
index 8b7a841..641f529 100644
--- a/src/select/properties/column_gap.c
+++ b/src/select/properties/column_gap.c
@@ -17,54 +17,40 @@
css_error css__cascade_column_gap(uint32_t opv, css_style *style,
css_select_state *state)
{
- css_fixed length = 0;
- uint32_t unit = UNIT_PX;
-
- if (isInherit(opv) == false) {
- switch (getValue(opv)) {
- case COLUMN_GAP_SET:
- length = *((css_fixed *) style->bytecode);
- advance_bytecode(style, sizeof(length));
- unit = *((uint32_t *) style->bytecode);
- advance_bytecode(style, sizeof(unit));
- break;
- case COLUMN_GAP_NORMAL:
- /** \todo convert to public values */
- break;
- }
- }
-
- if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
- isInherit(opv))) {
- /** \todo set computed elevation */
- }
-
- return CSS_OK;
+ return css__cascade_length_normal(opv, style, state, set_column_gap);
}
css_error css__set_column_gap_from_hint(const css_hint *hint,
css_computed_style *style)
{
- UNUSED(hint);
- UNUSED(style);
-
- return CSS_OK;
+ return set_column_gap(style, hint->status,
+ hint->data.length.value, hint->data.length.unit);
}
css_error css__initial_column_gap(css_select_state *state)
{
- UNUSED(state);
-
- return CSS_OK;
+ return set_column_gap(state->computed, CSS_COLUMN_GAP_NORMAL,
+ INTTOFIX(1), CSS_UNIT_EM);
}
css_error css__compose_column_gap(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
- UNUSED(parent);
- UNUSED(child);
- UNUSED(result);
+ css_fixed length = INTTOFIX(1);
+ css_unit unit = CSS_UNIT_EM;
+ uint8_t type = get_column_gap(child, &length, &unit);
+
+ if ((child->uncommon == NULL && parent->uncommon != NULL) ||
+ type == CSS_COLUMN_GAP_INHERIT ||
+ (child->uncommon != NULL && result != child)) {
+ if ((child->uncommon == NULL && parent->uncommon != NULL) ||
+ type == CSS_COLUMN_GAP_INHERIT) {
+ type = get_column_gap(parent, &length, &unit);
+ }
+
+ return set_column_gap(result, type, length, unit);
+ }
return CSS_OK;
}
diff --git a/src/select/propget.h b/src/select/propget.h
index 7085eba..c450a45 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -386,6 +386,33 @@ static inline uint8_t get_column_fill(
#undef COLUMN_FILL_SHIFT
#undef COLUMN_FILL_INDEX
+#define COLUMN_GAP_INDEX 9
+#define COLUMN_GAP_SHIFT 2
+#define COLUMN_GAP_MASK 0xfc
+static inline uint8_t get_column_gap(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[COLUMN_GAP_INDEX];
+ bits &= COLUMN_GAP_MASK;
+ bits >>= COLUMN_GAP_SHIFT;
+
+ /* 6bits: uuuutt : units | type */
+ if ((bits & 0x3) == CSS_COLUMN_GAP_SET) {
+ *length = style->uncommon->column_gap;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+ }
+
+ return CSS_COLUMN_GAP_NORMAL;
+}
+#undef COLUMN_GAP_MASK
+#undef COLUMN_GAP_SHIFT
+#undef COLUMN_GAP_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
diff --git a/src/select/propset.h b/src/select/propset.h
index 23d8076..acb2817 100644
--- a/src/select/propset.h
+++ b/src/select/propset.h
@@ -26,7 +26,8 @@ static const css_computed_uncommon default_uncommon = {
0,
0,
(CSS_CLIP_AUTO << 2) | CSS_CONTENT_NORMAL,
- (CSS_COLUMN_COUNT_AUTO << 6) | (CSS_COLUMN_FILL_BALANCE << 4)
+ (CSS_COLUMN_COUNT_AUTO << 6) | (CSS_COLUMN_FILL_BALANCE << 4),
+ (CSS_COLUMN_GAP_NORMAL << 2)
},
{ 0, 0 },
{ 0, 0, 0, 0 },
@@ -35,6 +36,7 @@ static const css_computed_uncommon default_uncommon = {
0,
0,
0,
+ 0,
NULL,
NULL,
NULL,
@@ -452,6 +454,31 @@ static inline css_error set_column_fill(
#undef COLUMN_FILL_SHIFT
#undef COLUMN_FILL_INDEX
+#define COLUMN_GAP_INDEX 9
+#define COLUMN_GAP_SHIFT 2
+#define COLUMN_GAP_MASK 0xfc
+static inline css_error set_column_gap(
+ css_computed_style *style, uint8_t type,
+ css_fixed length, css_unit unit)
+{
+ uint8_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->uncommon->bits[COLUMN_GAP_INDEX];
+
+ /* 6bits: uuuutt : units | type */
+ *bits = (*bits & ~COLUMN_GAP_MASK) |
+ (((type & 0x3) | (unit << 2)) << COLUMN_GAP_SHIFT);
+
+ style->uncommon->column_gap = length;
+
+ return CSS_OK;
+}
+#undef COLUMN_GAP_MASK
+#undef COLUMN_GAP_SHIFT
+#undef COLUMN_GAP_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=a5c3cbf24c7112238643...
commit a5c3cbf24c7112238643b58b346d6169ef904881
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Make enums for length/normal values match up.
diff --git a/include/libcss/properties.h b/include/libcss/properties.h
index dbcd75a..6bd3cb1 100644
--- a/include/libcss/properties.h
+++ b/include/libcss/properties.h
@@ -282,8 +282,8 @@ enum css_column_fill_e {
enum css_column_gap_e {
CSS_COLUMN_GAP_INHERIT = 0x0,
- CSS_COLUMN_GAP_NORMAL = 0x1,
- CSS_COLUMN_GAP_SET = 0x2
+ CSS_COLUMN_GAP_SET = 0x1,
+ CSS_COLUMN_GAP_NORMAL = 0x2
};
enum css_column_rule_color_e {
@@ -474,9 +474,9 @@ enum css_left_e {
};
enum css_letter_spacing_e {
- CSS_LETTER_SPACING_INHERIT = 0x0,
- CSS_LETTER_SPACING_SET = 0x1,
- CSS_LETTER_SPACING_NORMAL = 0x2
+ CSS_LETTER_SPACING_INHERIT = CSS_COLUMN_GAP_INHERIT,
+ CSS_LETTER_SPACING_SET = CSS_COLUMN_GAP_SET,
+ CSS_LETTER_SPACING_NORMAL = CSS_COLUMN_GAP_NORMAL
};
enum css_line_height_e {
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=a89f22e914af738de5f6...
commit a89f22e914af738de5f6c8097c1f091836ed79c1
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Ignore files ending with '~'.
diff --git a/.gitignore b/.gitignore
index d5c7a48..ed1b138 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,3 @@
build-*
Makefile.config.override
-
+*~
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=692a03f5545fbdf9d104...
commit 692a03f5545fbdf9d104f3bd585cec8bf3d7b8cd
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add dumping of column-fill property to selection test rig. Update test data.
diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat
index 99eb44e..c462066 100644
--- a/test/data/select/tests1.dat
+++ b/test/data/select/tests1.dat
@@ -38,6 +38,7 @@ clear: none
clip: auto
color: #ffff0000
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -136,6 +137,7 @@ clear: none
clip: auto
color: #ffff0000
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -234,6 +236,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -332,6 +335,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -422,6 +426,7 @@ clear: none
clip: auto
color: #ff000000
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -510,6 +515,7 @@ clear: none
clip: auto
color: #ff000000
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -599,6 +605,7 @@ clear: none
clip: auto
color: #ff000000
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -688,6 +695,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -776,6 +784,7 @@ clear: none
clip: auto
color: #ff000000
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -869,6 +878,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -962,6 +972,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -1056,6 +1067,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -1153,6 +1165,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -1249,6 +1262,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -1351,6 +1365,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -1453,6 +1468,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -1555,6 +1571,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -1661,6 +1678,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -1766,6 +1784,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -1869,6 +1888,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -1971,6 +1991,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2073,6 +2094,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2175,6 +2197,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2277,6 +2300,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2379,6 +2403,7 @@ clear: inherit
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2481,6 +2506,7 @@ clear: left
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2583,6 +2609,7 @@ clear: both
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2685,6 +2712,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2787,6 +2815,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2889,6 +2918,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -2991,6 +3021,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3093,6 +3124,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3195,6 +3227,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3297,6 +3330,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3399,6 +3433,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3501,6 +3536,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3603,6 +3639,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3705,6 +3742,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3807,6 +3845,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -3909,6 +3948,7 @@ clear: right
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -4004,6 +4044,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: balance
content: normal
counter-increment: none
counter-reset: none
@@ -4099,6 +4140,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
@@ -4194,6 +4236,7 @@ clear: none
clip: auto
color: inherit
column-count: auto
+column-fill: inherit
content: normal
counter-increment: none
counter-reset: none
diff --git a/test/dump_computed.h b/test/dump_computed.h
index e1519f0..530b617 100644
--- a/test/dump_computed.h
+++ b/test/dump_computed.h
@@ -843,6 +843,25 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
ptr += wrote;
*len -= wrote;
+ /* column-fill */
+ val = css_computed_column_fill(style);
+ switch (val) {
+ case CSS_COLUMN_FILL_INHERIT:
+ wrote = snprintf(ptr, *len, "column-fill: inherit\n");
+ break;
+ case CSS_COLUMN_FILL_AUTO:
+ wrote = snprintf(ptr, *len, "column-fill: auto\n");
+ break;
+ case CSS_COLUMN_FILL_BALANCE:
+ wrote = snprintf(ptr, *len, "column-fill: balance\n");
+ break;
+ default:
+ wrote = 0;
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
/* content */
val = css_computed_content(style, &content);
switch (val) {
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=fa4d9a7560d7cf25affc...
commit fa4d9a7560d7cf25affce86a51f6410430a4e63b
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add public accessor for column-fill property value.
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index 79103cd..eb50a9c 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -336,6 +336,9 @@ uint8_t css_computed_column_count(
const css_computed_style *style,
int32_t *column_count);
+uint8_t css_computed_column_fill(
+ const css_computed_style *style);
+
uint8_t css_computed_display(
const css_computed_style *style, bool root);
diff --git a/src/select/computed.c b/src/select/computed.c
index 81c7bc7..25e2d17 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -793,6 +793,11 @@ uint8_t css_computed_column_count(const css_computed_style *style,
return get_column_count(style, column_count);
}
+uint8_t css_computed_column_fill(const css_computed_style *style)
+{
+ return get_column_fill(style);
+}
+
uint8_t css_computed_display(const css_computed_style *style,
bool root)
{
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=d250b1019c669478cf46...
commit d250b1019c669478cf462b64ca060e7aedb5def1
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Implement selection for column-fill property.
diff --git a/src/select/computed.h b/src/select/computed.h
index ff52df3..23b0cb6 100644
--- a/src/select/computed.h
+++ b/src/select/computed.h
@@ -18,12 +18,13 @@ typedef struct css_computed_uncommon {
* border_spacing 1 + 2(4) 2(4)
* clip 2 + 4(4) + 4 4(4)
* column_count 2 4
+ * column_fill 2 0
* letter_spacing 2 + 4 4
* outline_color 2 4
* outline_width 3 + 4 4
* word_spacing 2 + 4 4
* --- ---
- * 54 bits 44 bytes
+ * 56 bits 44 bytes
*
* Encode counter_increment and _reset as an array of name, value pairs,
* terminated with a blank entry.
@@ -47,7 +48,7 @@ typedef struct css_computed_uncommon {
* 2 bits sizeof(ptr)
*
* ___ ___
- * 63 bits 44 + 4sizeof(ptr) bytes
+ * 65 bits 44 + 4sizeof(ptr) bytes
*
* 8 bytes 44 + 4sizeof(ptr) bytes
* ===================
@@ -64,7 +65,7 @@ typedef struct css_computed_uncommon {
* 6 cccccccc clip
* 7 cccccccc clip
* 8 ccccccoo clip | content
- * 9 cc...... column_count | <unused>
+ * 9 ccff.... column_count | column-fill | <unused>
*/
uint8_t bits[9];
diff --git a/src/select/properties/column_fill.c b/src/select/properties/column_fill.c
index 2322c03..9b4f1e0 100644
--- a/src/select/properties/column_fill.c
+++ b/src/select/properties/column_fill.c
@@ -17,20 +17,24 @@
css_error css__cascade_column_fill(uint32_t opv, css_style *style,
css_select_state *state)
{
+ uint16_t value = CSS_COLUMN_FILL_INHERIT;
+
UNUSED(style);
if (isInherit(opv) == false) {
switch (getValue(opv)) {
case COLUMN_FILL_BALANCE:
+ value = CSS_COLUMN_FILL_BALANCE;
+ break;
case COLUMN_FILL_AUTO:
- /** \todo convert to public values */
+ value = CSS_COLUMN_FILL_AUTO;
break;
}
}
if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
isInherit(opv))) {
- /** \todo set computed elevation */
+ return set_column_fill(state->computed, value);
}
return CSS_OK;
@@ -39,27 +43,24 @@ css_error css__cascade_column_fill(uint32_t opv, css_style *style,
css_error css__set_column_fill_from_hint(const css_hint *hint,
css_computed_style *style)
{
- UNUSED(hint);
- UNUSED(style);
-
- return CSS_OK;
+ return set_column_fill(style, hint->status);
}
css_error css__initial_column_fill(css_select_state *state)
{
- UNUSED(state);
-
- return CSS_OK;
+ return set_column_fill(state->computed, CSS_COLUMN_FILL_BALANCE);
}
css_error css__compose_column_fill(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
- UNUSED(parent);
- UNUSED(child);
- UNUSED(result);
+ uint8_t type = get_column_fill(child);
- return CSS_OK;
+ if (type == CSS_COLUMN_FILL_INHERIT) {
+ type = get_column_fill(parent);
+ }
+
+ return set_column_fill(result, type);
}
diff --git a/src/select/propget.h b/src/select/propget.h
index a9b8edc..7085eba 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -365,6 +365,27 @@ static inline uint8_t get_column_count(
#undef COLUMN_COUNT_SHIFT
#undef COLUMN_COUNT_INDEX
+#define COLUMN_FILL_INDEX 8
+#define COLUMN_FILL_SHIFT 6
+#define COLUMN_FILL_MASK 0x30
+static inline uint8_t get_column_fill(
+ const css_computed_style *style)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[COLUMN_FILL_INDEX];
+ bits &= COLUMN_FILL_MASK;
+ bits >>= COLUMN_FILL_SHIFT;
+
+ /* 2bits: type */
+ return bits;
+ }
+
+ return CSS_COLUMN_FILL_BALANCE;
+}
+#undef COLUMN_FILL_MASK
+#undef COLUMN_FILL_SHIFT
+#undef COLUMN_FILL_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
diff --git a/src/select/propset.h b/src/select/propset.h
index 52d9d8a..23d8076 100644
--- a/src/select/propset.h
+++ b/src/select/propset.h
@@ -26,7 +26,7 @@ static const css_computed_uncommon default_uncommon = {
0,
0,
(CSS_CLIP_AUTO << 2) | CSS_CONTENT_NORMAL,
- (CSS_COLUMN_COUNT_AUTO << 6)
+ (CSS_COLUMN_COUNT_AUTO << 6) | (CSS_COLUMN_FILL_BALANCE << 4)
},
{ 0, 0 },
{ 0, 0, 0, 0 },
@@ -430,6 +430,28 @@ static inline css_error set_column_count(
#undef COLUMN_COUNT_SHIFT
#undef COLUMN_COUNT_INDEX
+#define COLUMN_FILL_INDEX 8
+#define COLUMN_FILL_SHIFT 6
+#define COLUMN_FILL_MASK 0x30
+static inline css_error set_column_fill(
+ css_computed_style *style, uint8_t type)
+{
+ uint8_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->uncommon->bits[COLUMN_FILL_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~COLUMN_FILL_MASK) |
+ ((type & 0x3) << COLUMN_FILL_SHIFT);
+
+ return CSS_OK;
+}
+#undef COLUMN_FILL_MASK
+#undef COLUMN_FILL_SHIFT
+#undef COLUMN_FILL_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=121504a4a2b0f8d1e16e...
commit 121504a4a2b0f8d1e16e507ca71916479c0e5c69
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Improve output when selection test fails.
Makes it easier to spot where the difference is.
diff --git a/test/select-common.c b/test/select-common.c
index 783790a..fef53ea 100644
--- a/test/select-common.c
+++ b/test/select-common.c
@@ -721,6 +721,41 @@ void css__parse_expected(line_ctx *ctx, const char *data, size_t len)
ctx->expused += len;
}
+static void show_differences(size_t len, const char *exp, const char *res)
+{
+ const char *pos_exp, *opos_exp;
+ const char *pos_res, *opos_res;
+
+ opos_exp = pos_exp = exp;
+ opos_res = pos_res = res;
+
+ printf("Line differences:\n");
+ while (pos_exp < exp + len && pos_res < res + len) {
+ if (*pos_exp == '\n' && *pos_res == '\n') {
+ if (pos_exp - opos_exp != pos_res - opos_res ||
+ memcmp(opos_exp, opos_res,
+ pos_exp - opos_exp) != 0) {
+ printf("Expected:\t%.*s\n",
+ (int)(pos_exp - opos_exp),
+ opos_exp);
+ printf(" Result:\t%.*s\n",
+ (int)(pos_res - opos_res),
+ opos_res);
+ printf("\n");
+ }
+ opos_exp = ++pos_exp;
+ opos_res = ++pos_res;
+ } else if (*pos_exp == '\n') {
+ pos_res++;
+ } else if (*pos_res == '\n') {
+ pos_exp++;
+ } else {
+ pos_exp++;
+ pos_res++;
+ }
+ }
+}
+
void run_test(line_ctx *ctx, const char *exp, size_t explen)
{
css_select_ctx *select;
@@ -756,10 +791,13 @@ void run_test(line_ctx *ctx, const char *exp, size_t explen)
dump_computed_style(results->styles[ctx->pseudo_element], buf, &buflen);
if (8192 - buflen != explen || memcmp(buf, exp, explen) != 0) {
+ size_t len = 8192 - buflen < explen ? 8192 - buflen : explen;
printf("Expected (%u):\n%.*s\n",
(int) explen, (int) explen, exp);
printf("Result (%u):\n%.*s\n", (int) (8192 - buflen),
(int) (8192 - buflen), buf);
+
+ show_differences(len, exp, buf);
assert(0 && "Result doesn't match expected");
}
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=45e6f65d4365f0a8af54...
commit 45e6f65d4365f0a8af540149f9eddf3fb7ecce95
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Update computed style dumper to dump column-count, and update test data.
diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat
index 96e57bf..99eb44e 100644
--- a/test/data/select/tests1.dat
+++ b/test/data/select/tests1.dat
@@ -37,6 +37,7 @@ caption-side: inherit
clear: none
clip: auto
color: #ffff0000
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -134,6 +135,7 @@ caption-side: inherit
clear: none
clip: auto
color: #ffff0000
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -231,6 +233,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -328,6 +331,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -417,6 +421,7 @@ caption-side: top
clear: none
clip: auto
color: #ff000000
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -504,6 +509,7 @@ caption-side: top
clear: none
clip: auto
color: #ff000000
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -592,6 +598,7 @@ caption-side: top
clear: none
clip: auto
color: #ff000000
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -680,6 +687,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -767,6 +775,7 @@ caption-side: top
clear: none
clip: auto
color: #ff000000
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -859,6 +868,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -951,6 +961,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1044,6 +1055,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1140,6 +1152,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1235,6 +1248,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1336,6 +1350,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1437,6 +1452,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1538,6 +1554,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1643,6 +1660,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1747,6 +1765,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1849,6 +1868,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1950,6 +1970,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2051,6 +2072,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2152,6 +2174,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2253,6 +2276,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2354,6 +2378,7 @@ caption-side: inherit
clear: inherit
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2455,6 +2480,7 @@ caption-side: inherit
clear: left
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2556,6 +2582,7 @@ caption-side: inherit
clear: both
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2657,6 +2684,7 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2758,6 +2786,7 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2859,6 +2888,7 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2960,6 +2990,7 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3061,6 +3092,7 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3162,6 +3194,7 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3263,6 +3296,7 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3364,6 +3398,7 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3465,6 +3500,7 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3566,6 +3602,7 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3667,6 +3704,7 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3768,6 +3806,7 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3869,6 +3908,7 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3963,6 +4003,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -4057,6 +4098,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -4151,6 +4193,7 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
content: normal
counter-increment: none
counter-reset: none
@@ -4207,3 +4250,4 @@ word-spacing: inherit
writing-mode: vertical-lr
z-index: auto
#reset
+
diff --git a/test/dump_computed.h b/test/dump_computed.h
index 5f83767..e1519f0 100644
--- a/test/dump_computed.h
+++ b/test/dump_computed.h
@@ -151,7 +151,7 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
const css_computed_content_item *content = NULL;
const css_computed_counter *counter = NULL;
lwc_string **string_list = NULL;
- int32_t zindex = 0;
+ int32_t integer = 0;
/* background-attachment */
val = css_computed_background_attachment(style);
@@ -824,6 +824,25 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
ptr += wrote;
*len -= wrote;
+ /* column-count */
+ val = css_computed_column_count(style, &integer);
+ switch (val) {
+ case CSS_COLUMN_COUNT_INHERIT:
+ wrote = snprintf(ptr, *len, "column-count: inherit\n");
+ break;
+ case CSS_COLUMN_COUNT_AUTO:
+ wrote = snprintf(ptr, *len, "column-count: auto\n");
+ break;
+ case CSS_COLUMN_COUNT_SET:
+ wrote = snprintf(ptr, *len, "column-count: %d\n", integer);
+ break;
+ default:
+ wrote = 0;
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
/* content */
val = css_computed_content(style, &content);
switch (val) {
@@ -2520,7 +2539,7 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
*len -= wrote;
/* z-index */
- val = css_computed_z_index(style, &zindex);
+ val = css_computed_z_index(style, &integer);
switch (val) {
case CSS_Z_INDEX_INHERIT:
wrote = snprintf(ptr, *len, "z-index: inherit\n");
@@ -2529,7 +2548,7 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
wrote = snprintf(ptr, *len, "z-index: auto\n");
break;
case CSS_Z_INDEX_SET:
- wrote = snprintf(ptr, *len, "z-index: %d\n", zindex);
+ wrote = snprintf(ptr, *len, "z-index: %d\n", integer);
break;
default:
wrote = 0;
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=1925f7fb88c6a8f881d6...
commit 1925f7fb88c6a8f881d6809ce2a70dd5c79f2503
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add public accessor for column-count in computed styles.
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index 1039e7f..79103cd 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -332,6 +332,10 @@ uint8_t css_computed_background_position(
css_fixed *hlength, css_unit *hunit,
css_fixed *vlength, css_unit *vunit);
+uint8_t css_computed_column_count(
+ const css_computed_style *style,
+ int32_t *column_count);
+
uint8_t css_computed_display(
const css_computed_style *style, bool root);
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=441735a225e782661566...
commit 441735a225e7826615669a754b6bccf2b7d46ef4
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Cascade and compose column-count property into computed style.
diff --git a/src/select/computed.c b/src/select/computed.c
index 9b59dc4..81c7bc7 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -787,6 +787,12 @@ uint8_t css_computed_background_position(const css_computed_style *style,
return get_background_position(style, hlength, hunit, vlength, vunit);
}
+uint8_t css_computed_column_count(const css_computed_style *style,
+ int32_t *column_count)
+{
+ return get_column_count(style, column_count);
+}
+
uint8_t css_computed_display(const css_computed_style *style,
bool root)
{
diff --git a/src/select/computed.h b/src/select/computed.h
index e7f3742..ff52df3 100644
--- a/src/select/computed.h
+++ b/src/select/computed.h
@@ -17,12 +17,13 @@ typedef struct css_computed_uncommon {
/*
* border_spacing 1 + 2(4) 2(4)
* clip 2 + 4(4) + 4 4(4)
+ * column_count 2 4
* letter_spacing 2 + 4 4
* outline_color 2 4
* outline_width 3 + 4 4
* word_spacing 2 + 4 4
* --- ---
- * 52 bits 40 bytes
+ * 54 bits 44 bytes
*
* Encode counter_increment and _reset as an array of name, value pairs,
* terminated with a blank entry.
@@ -46,11 +47,11 @@ typedef struct css_computed_uncommon {
* 2 bits sizeof(ptr)
*
* ___ ___
- * 61 bits 40 + 4sizeof(ptr) bytes
+ * 63 bits 44 + 4sizeof(ptr) bytes
*
- * 8 bytes 40 + 4sizeof(ptr) bytes
+ * 8 bytes 44 + 4sizeof(ptr) bytes
* ===================
- * 48 + 4sizeof(ptr) bytes
+ * 52 + 4sizeof(ptr) bytes
*
* Bit allocations:
*
@@ -63,8 +64,9 @@ typedef struct css_computed_uncommon {
* 6 cccccccc clip
* 7 cccccccc clip
* 8 ccccccoo clip | content
+ * 9 cc...... column_count | <unused>
*/
- uint8_t bits[8];
+ uint8_t bits[9];
css_fixed border_spacing[2];
@@ -77,6 +79,8 @@ typedef struct css_computed_uncommon {
css_fixed word_spacing;
+ int32_t column_count;
+
css_computed_counter *counter_increment;
css_computed_counter *counter_reset;
diff --git a/src/select/properties/column_count.c b/src/select/properties/column_count.c
index 5fe7465..ecee5f3 100644
--- a/src/select/properties/column_count.c
+++ b/src/select/properties/column_count.c
@@ -17,23 +17,25 @@
css_error css__cascade_column_count(uint32_t opv, css_style *style,
css_select_state *state)
{
+ uint16_t value = CSS_COLUMN_COUNT_INHERIT;
css_fixed count = 0;
if (isInherit(opv) == false) {
switch (getValue(opv)) {
case COLUMN_COUNT_SET:
+ value = CSS_COLUMN_COUNT_SET;
count = *((css_fixed *) style->bytecode);
advance_bytecode(style, sizeof(count));
break;
case COLUMN_COUNT_AUTO:
- /** \todo convert to public values */
+ value = CSS_COLUMN_COUNT_AUTO;
break;
}
}
if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
isInherit(opv))) {
- /** \todo set computed elevation */
+ return set_column_count(state->computed, value, count);
}
return CSS_OK;
@@ -42,26 +44,31 @@ css_error css__cascade_column_count(uint32_t opv, css_style *style,
css_error css__set_column_count_from_hint(const css_hint *hint,
css_computed_style *style)
{
- UNUSED(hint);
- UNUSED(style);
-
- return CSS_OK;
+ return set_column_count(style, hint->status, hint->data.integer);
}
css_error css__initial_column_count(css_select_state *state)
{
- UNUSED(state);
-
- return CSS_OK;
+ return set_column_count(state->computed, CSS_COLUMN_COUNT_AUTO, 0);
}
css_error css__compose_column_count(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
- UNUSED(parent);
- UNUSED(child);
- UNUSED(result);
+ int32_t count = 0;
+ uint8_t type = get_column_count(child, &count);
+
+ if ((child->uncommon == NULL && parent->uncommon != NULL) ||
+ type == CSS_COLUMN_COUNT_INHERIT ||
+ (child->uncommon != NULL && result != child)) {
+ if ((child->uncommon == NULL && parent->uncommon != NULL) ||
+ type == CSS_OUTLINE_COLOR_INHERIT) {
+ type = get_column_count(parent, &count);
+ }
+
+ return set_column_count(result, type, count);
+ }
return CSS_OK;
}
diff --git a/src/select/propget.h b/src/select/propget.h
index b124cfe..a9b8edc 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -342,6 +342,29 @@ static inline uint8_t get_clip(
#undef CLIP_SHIFT
#undef CLIP_INDEX
+#define COLUMN_COUNT_INDEX 8
+#define COLUMN_COUNT_SHIFT 6
+#define COLUMN_COUNT_MASK 0xc0
+static inline uint8_t get_column_count(
+ const css_computed_style *style, int32_t *count)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[COLUMN_COUNT_INDEX];
+ bits &= COLUMN_COUNT_MASK;
+ bits >>= COLUMN_COUNT_SHIFT;
+
+ /* 2bits: tt : type */
+ *count = style->uncommon->column_count;
+
+ return bits;
+ }
+
+ return CSS_COLUMN_COUNT_AUTO;
+}
+#undef COLUMN_COUNT_MASK
+#undef COLUMN_COUNT_SHIFT
+#undef COLUMN_COUNT_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
diff --git a/src/select/propset.h b/src/select/propset.h
index b7da5a6..52d9d8a 100644
--- a/src/select/propset.h
+++ b/src/select/propset.h
@@ -25,7 +25,8 @@ static const css_computed_uncommon default_uncommon = {
(CSS_CURSOR_INHERIT << 3) | (CSS_WRITING_MODE_INHERIT << 1) | 0,
0,
0,
- (CSS_CLIP_AUTO << 2) | CSS_CONTENT_NORMAL
+ (CSS_CLIP_AUTO << 2) | CSS_CONTENT_NORMAL,
+ (CSS_COLUMN_COUNT_AUTO << 6)
},
{ 0, 0 },
{ 0, 0, 0, 0 },
@@ -33,6 +34,7 @@ static const css_computed_uncommon default_uncommon = {
0,
0,
0,
+ 0,
NULL,
NULL,
NULL,
@@ -404,6 +406,30 @@ static inline css_error set_clip(
#undef CLIP_SHIFT
#undef CLIP_INDEX
+#define COLUMN_COUNT_INDEX 8
+#define COLUMN_COUNT_SHIFT 6
+#define COLUMN_COUNT_MASK 0xc0
+static inline css_error set_column_count(
+ css_computed_style *style, uint8_t type, int32_t count)
+{
+ uint8_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->uncommon->bits[COLUMN_COUNT_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~COLUMN_COUNT_MASK) |
+ ((type & 0x3) << COLUMN_COUNT_SHIFT);
+
+ style->uncommon->column_count = count;
+
+ return CSS_OK;
+}
+#undef COLUMN_COUNT_MASK
+#undef COLUMN_COUNT_SHIFT
+#undef COLUMN_COUNT_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=55d72b3ce74fba727100...
commit 55d72b3ce74fba72710076fb0cef53aa06b2cf65
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Put the column properties in the computed style's uncommon section.
diff --git a/src/select/dispatch.c b/src/select/dispatch.c
index b03e468..2c72e86 100644
--- a/src/select/dispatch.c
+++ b/src/select/dispatch.c
@@ -536,42 +536,42 @@ struct prop_table prop_dispatch[CSS_N_PROPERTIES] = {
{
PROPERTY_FUNCS(column_count),
0,
- GROUP_NORMAL
+ GROUP_UNCOMMON
},
{
PROPERTY_FUNCS(column_fill),
0,
- GROUP_NORMAL
+ GROUP_UNCOMMON
},
{
PROPERTY_FUNCS(column_gap),
0,
- GROUP_NORMAL
+ GROUP_UNCOMMON
},
{
PROPERTY_FUNCS(column_rule_color),
0,
- GROUP_NORMAL
+ GROUP_UNCOMMON
},
{
PROPERTY_FUNCS(column_rule_style),
0,
- GROUP_NORMAL
+ GROUP_UNCOMMON
},
{
PROPERTY_FUNCS(column_rule_width),
0,
- GROUP_NORMAL
+ GROUP_UNCOMMON
},
{
PROPERTY_FUNCS(column_span),
0,
- GROUP_NORMAL
+ GROUP_UNCOMMON
},
{
PROPERTY_FUNCS(column_width),
0,
- GROUP_NORMAL
+ GROUP_UNCOMMON
},
{
PROPERTY_FUNCS(writing_mode),
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=06bb5d691bdf96bf99fa...
commit 06bb5d691bdf96bf99fa52eabcb21c9c0bd80eb4
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Remove trailing whitespace.
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index 8e327d2..1039e7f 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -19,7 +19,7 @@ extern "C"
#include <libcss/functypes.h>
#include <libcss/properties.h>
#include <libcss/types.h>
-
+
struct css_hint;
struct css_select_handler;
@@ -75,7 +75,7 @@ typedef struct css_computed_content_item {
} counters;
} data;
} css_computed_content_item;
-
+
css_error css_computed_style_create(css_computed_style **result);
css_error css_computed_style_destroy(css_computed_style *style);
@@ -85,7 +85,7 @@ css_error css_computed_style_initialise(css_computed_style *style,
css_error css_computed_style_compose(const css_computed_style *parent,
const css_computed_style *child,
css_error (*compute_font_size)(void *pw,
- const struct css_hint *parent,
+ const struct css_hint *parent,
struct css_hint *size),
void *pw,
css_computed_style *result);
@@ -93,215 +93,215 @@ css_error css_computed_style_compose(const css_computed_style *parent,
/******************************************************************************
* Property accessors below here *
******************************************************************************/
-
+
uint8_t css_computed_letter_spacing(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
uint8_t css_computed_outline_color(
const css_computed_style *style, css_color *color);
-
+
uint8_t css_computed_outline_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_border_spacing(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *hlength, css_unit *hunit,
css_fixed *vlength, css_unit *vunit);
-
+
uint8_t css_computed_word_spacing(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_counter_increment(
- const css_computed_style *style,
+ const css_computed_style *style,
const css_computed_counter **counters);
-
+
uint8_t css_computed_counter_reset(
- const css_computed_style *style,
+ const css_computed_style *style,
const css_computed_counter **counters);
-
+
uint8_t css_computed_cursor(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string ***urls);
uint8_t css_computed_clip(
- const css_computed_style *style,
+ const css_computed_style *style,
css_computed_clip_rect *rect);
-
+
uint8_t css_computed_content(
- const css_computed_style *style,
+ const css_computed_style *style,
const css_computed_content_item **content);
-
+
uint8_t css_computed_vertical_align(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_font_size(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_border_top_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_border_right_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_border_bottom_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_border_left_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_background_image(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string **url);
-
+
uint8_t css_computed_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color);
-
+
uint8_t css_computed_list_style_image(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string **url);
-
+
uint8_t css_computed_quotes(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string ***quotes);
-
+
uint8_t css_computed_top(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_right(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_bottom(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_left(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_border_top_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color);
-
+
uint8_t css_computed_border_right_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color);
-
+
uint8_t css_computed_border_bottom_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color);
-
+
uint8_t css_computed_border_left_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color);
-
+
uint8_t css_computed_height(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_line_height(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_background_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color);
-
+
uint8_t css_computed_z_index(
- const css_computed_style *style,
+ const css_computed_style *style,
int32_t *z_index);
-
+
uint8_t css_computed_margin_top(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_margin_right(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_margin_bottom(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_margin_left(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_background_attachment(
const css_computed_style *style);
-
+
uint8_t css_computed_border_collapse(
const css_computed_style *style);
-
+
uint8_t css_computed_caption_side(
const css_computed_style *style);
-
+
uint8_t css_computed_direction(
const css_computed_style *style);
-
+
uint8_t css_computed_max_height(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_max_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_empty_cells(
const css_computed_style *style);
-
+
uint8_t css_computed_float(
const css_computed_style *style);
-
+
uint8_t css_computed_writing_mode(
const css_computed_style *style);
uint8_t css_computed_font_style(
const css_computed_style *style);
-
+
uint8_t css_computed_min_height(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_min_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_background_repeat(
const css_computed_style *style);
-
+
uint8_t css_computed_clear(
const css_computed_style *style);
-
+
uint8_t css_computed_padding_top(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_padding_right(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_padding_bottom(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_padding_left(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
uint8_t css_computed_overflow_x(
@@ -312,75 +312,75 @@ uint8_t css_computed_overflow_y(
uint8_t css_computed_position(
const css_computed_style *style);
-
+
uint8_t css_computed_opacity(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *opacity);
-
+
uint8_t css_computed_text_transform(
const css_computed_style *style);
-
+
uint8_t css_computed_text_indent(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_white_space(
const css_computed_style *style);
-
+
uint8_t css_computed_background_position(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *hlength, css_unit *hunit,
css_fixed *vlength, css_unit *vunit);
-
+
uint8_t css_computed_display(
const css_computed_style *style, bool root);
-
+
uint8_t css_computed_display_static(
const css_computed_style *style);
-
+
uint8_t css_computed_font_variant(
const css_computed_style *style);
-
+
uint8_t css_computed_text_decoration(
const css_computed_style *style);
-
+
uint8_t css_computed_font_family(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string ***names);
-
+
uint8_t css_computed_border_top_style(
const css_computed_style *style);
-
+
uint8_t css_computed_border_right_style(
const css_computed_style *style);
-
+
uint8_t css_computed_border_bottom_style(
const css_computed_style *style);
-
+
uint8_t css_computed_border_left_style(
const css_computed_style *style);
-
+
uint8_t css_computed_font_weight(
const css_computed_style *style);
-
+
uint8_t css_computed_list_style_type(
const css_computed_style *style);
-
+
uint8_t css_computed_outline_style(
const css_computed_style *style);
-
+
uint8_t css_computed_table_layout(
const css_computed_style *style);
-
+
uint8_t css_computed_unicode_bidi(
const css_computed_style *style);
-
+
uint8_t css_computed_visibility(
const css_computed_style *style);
-
+
uint8_t css_computed_list_style_position(
const css_computed_style *style);
-
+
uint8_t css_computed_text_align(
const css_computed_style *style);
@@ -394,11 +394,11 @@ uint8_t css_computed_page_break_inside(
const css_computed_style *style);
uint8_t css_computed_orphans(
- const css_computed_style *style,
+ const css_computed_style *style,
int32_t *orphans);
uint8_t css_computed_widows(
- const css_computed_style *style,
+ const css_computed_style *style,
int32_t *widows);
#ifdef __cplusplus
-----------------------------------------------------------------------
Summary of changes:
.gitignore | 2 +-
include/libcss/computed.h | 283 +++++++++---------
include/libcss/properties.h | 21 +-
src/bytecode/opcodes.h | 7 +-
src/select/computed.c | 45 +++
src/select/computed.h | 38 ++-
src/select/dispatch.c | 16 +-
src/select/properties/column_count.c | 31 +-
src/select/properties/column_fill.c | 27 +-
src/select/properties/column_gap.c | 52 ++--
src/select/properties/column_rule_color.c | 42 +--
src/select/properties/column_rule_style.c | 47 +--
src/select/properties/column_rule_width.c | 50 +---
src/select/properties/column_span.c | 29 +-
src/select/properties/column_width.c | 54 ++--
src/select/propget.h | 312 ++++++++++++++++----
src/select/propset.h | 352 ++++++++++++++++++-----
test/data/select/tests1.dat | 444 +++++++++++++++++++++++++++++
test/dump_computed.h | 210 +++++++++++++-
test/select-common.c | 38 +++
20 files changed, 1605 insertions(+), 495 deletions(-)
diff --git a/.gitignore b/.gitignore
index d5c7a48..ed1b138 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,3 @@
build-*
Makefile.config.override
-
+*~
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index 8e327d2..b384cba 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -19,7 +19,7 @@ extern "C"
#include <libcss/functypes.h>
#include <libcss/properties.h>
#include <libcss/types.h>
-
+
struct css_hint;
struct css_select_handler;
@@ -75,7 +75,7 @@ typedef struct css_computed_content_item {
} counters;
} data;
} css_computed_content_item;
-
+
css_error css_computed_style_create(css_computed_style **result);
css_error css_computed_style_destroy(css_computed_style *style);
@@ -85,7 +85,7 @@ css_error css_computed_style_initialise(css_computed_style *style,
css_error css_computed_style_compose(const css_computed_style *parent,
const css_computed_style *child,
css_error (*compute_font_size)(void *pw,
- const struct css_hint *parent,
+ const struct css_hint *parent,
struct css_hint *size),
void *pw,
css_computed_style *result);
@@ -93,215 +93,215 @@ css_error css_computed_style_compose(const css_computed_style *parent,
/******************************************************************************
* Property accessors below here *
******************************************************************************/
-
+
uint8_t css_computed_letter_spacing(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
uint8_t css_computed_outline_color(
const css_computed_style *style, css_color *color);
-
+
uint8_t css_computed_outline_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_border_spacing(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *hlength, css_unit *hunit,
css_fixed *vlength, css_unit *vunit);
-
+
uint8_t css_computed_word_spacing(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_counter_increment(
- const css_computed_style *style,
+ const css_computed_style *style,
const css_computed_counter **counters);
-
+
uint8_t css_computed_counter_reset(
- const css_computed_style *style,
+ const css_computed_style *style,
const css_computed_counter **counters);
-
+
uint8_t css_computed_cursor(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string ***urls);
uint8_t css_computed_clip(
- const css_computed_style *style,
+ const css_computed_style *style,
css_computed_clip_rect *rect);
-
+
uint8_t css_computed_content(
- const css_computed_style *style,
+ const css_computed_style *style,
const css_computed_content_item **content);
-
+
uint8_t css_computed_vertical_align(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_font_size(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_border_top_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_border_right_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_border_bottom_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_border_left_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_background_image(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string **url);
-
+
uint8_t css_computed_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color);
-
+
uint8_t css_computed_list_style_image(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string **url);
-
+
uint8_t css_computed_quotes(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string ***quotes);
-
+
uint8_t css_computed_top(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_right(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_bottom(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_left(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_border_top_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color);
-
+
uint8_t css_computed_border_right_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color);
-
+
uint8_t css_computed_border_bottom_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color);
-
+
uint8_t css_computed_border_left_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color);
-
+
uint8_t css_computed_height(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_line_height(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_background_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color);
-
+
uint8_t css_computed_z_index(
- const css_computed_style *style,
+ const css_computed_style *style,
int32_t *z_index);
-
+
uint8_t css_computed_margin_top(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_margin_right(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_margin_bottom(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_margin_left(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_background_attachment(
const css_computed_style *style);
-
+
uint8_t css_computed_border_collapse(
const css_computed_style *style);
-
+
uint8_t css_computed_caption_side(
const css_computed_style *style);
-
+
uint8_t css_computed_direction(
const css_computed_style *style);
-
+
uint8_t css_computed_max_height(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_max_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_empty_cells(
const css_computed_style *style);
-
+
uint8_t css_computed_float(
const css_computed_style *style);
-
+
uint8_t css_computed_writing_mode(
const css_computed_style *style);
uint8_t css_computed_font_style(
const css_computed_style *style);
-
+
uint8_t css_computed_min_height(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_min_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_background_repeat(
const css_computed_style *style);
-
+
uint8_t css_computed_clear(
const css_computed_style *style);
-
+
uint8_t css_computed_padding_top(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_padding_right(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_padding_bottom(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_padding_left(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
uint8_t css_computed_overflow_x(
@@ -312,75 +312,104 @@ uint8_t css_computed_overflow_y(
uint8_t css_computed_position(
const css_computed_style *style);
-
+
uint8_t css_computed_opacity(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *opacity);
-
+
uint8_t css_computed_text_transform(
const css_computed_style *style);
-
+
uint8_t css_computed_text_indent(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit);
-
+
uint8_t css_computed_white_space(
const css_computed_style *style);
-
+
uint8_t css_computed_background_position(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *hlength, css_unit *hunit,
css_fixed *vlength, css_unit *vunit);
-
+
+uint8_t css_computed_column_count(
+ const css_computed_style *style,
+ int32_t *column_count);
+
+uint8_t css_computed_column_fill(
+ const css_computed_style *style);
+
+uint8_t css_computed_column_gap(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit);
+
+uint8_t css_computed_column_rule_color(
+ const css_computed_style *style,
+ css_color *color);
+
+uint8_t css_computed_column_rule_style(
+ const css_computed_style *style);
+
+uint8_t css_computed_column_rule_width(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit);
+
+uint8_t css_computed_column_span(
+ const css_computed_style *style);
+
+uint8_t css_computed_column_width(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit);
+
uint8_t css_computed_display(
const css_computed_style *style, bool root);
-
+
uint8_t css_computed_display_static(
const css_computed_style *style);
-
+
uint8_t css_computed_font_variant(
const css_computed_style *style);
-
+
uint8_t css_computed_text_decoration(
const css_computed_style *style);
-
+
uint8_t css_computed_font_family(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string ***names);
-
+
uint8_t css_computed_border_top_style(
const css_computed_style *style);
-
+
uint8_t css_computed_border_right_style(
const css_computed_style *style);
-
+
uint8_t css_computed_border_bottom_style(
const css_computed_style *style);
-
+
uint8_t css_computed_border_left_style(
const css_computed_style *style);
-
+
uint8_t css_computed_font_weight(
const css_computed_style *style);
-
+
uint8_t css_computed_list_style_type(
const css_computed_style *style);
-
+
uint8_t css_computed_outline_style(
const css_computed_style *style);
-
+
uint8_t css_computed_table_layout(
const css_computed_style *style);
-
+
uint8_t css_computed_unicode_bidi(
const css_computed_style *style);
-
+
uint8_t css_computed_visibility(
const css_computed_style *style);
-
+
uint8_t css_computed_list_style_position(
const css_computed_style *style);
-
+
uint8_t css_computed_text_align(
const css_computed_style *style);
@@ -394,11 +423,11 @@ uint8_t css_computed_page_break_inside(
const css_computed_style *style);
uint8_t css_computed_orphans(
- const css_computed_style *style,
+ const css_computed_style *style,
int32_t *orphans);
uint8_t css_computed_widows(
- const css_computed_style *style,
+ const css_computed_style *style,
int32_t *widows);
#ifdef __cplusplus
diff --git a/include/libcss/properties.h b/include/libcss/properties.h
index dbcd75a..899a552 100644
--- a/include/libcss/properties.h
+++ b/include/libcss/properties.h
@@ -282,8 +282,8 @@ enum css_column_fill_e {
enum css_column_gap_e {
CSS_COLUMN_GAP_INHERIT = 0x0,
- CSS_COLUMN_GAP_NORMAL = 0x1,
- CSS_COLUMN_GAP_SET = 0x2
+ CSS_COLUMN_GAP_SET = 0x1,
+ CSS_COLUMN_GAP_NORMAL = 0x2
};
enum css_column_rule_color_e {
@@ -295,6 +295,7 @@ enum css_column_rule_color_e {
enum css_column_rule_style_e {
CSS_COLUMN_RULE_STYLE_INHERIT = CSS_BORDER_STYLE_INHERIT,
CSS_COLUMN_RULE_STYLE_NONE = CSS_BORDER_STYLE_NONE,
+ CSS_COLUMN_RULE_STYLE_HIDDEN = CSS_BORDER_STYLE_HIDDEN,
CSS_COLUMN_RULE_STYLE_DOTTED = CSS_BORDER_STYLE_DOTTED,
CSS_COLUMN_RULE_STYLE_DASHED = CSS_BORDER_STYLE_DASHED,
CSS_COLUMN_RULE_STYLE_SOLID = CSS_BORDER_STYLE_SOLID,
@@ -321,8 +322,8 @@ enum css_column_span_e {
enum css_column_width_e {
CSS_COLUMN_WIDTH_INHERIT = 0x0,
- CSS_COLUMN_WIDTH_AUTO = 0x1,
- CSS_COLUMN_WIDTH_SET = 0x2
+ CSS_COLUMN_WIDTH_SET = 0x1,
+ CSS_COLUMN_WIDTH_AUTO = 0x2
};
enum css_content_e {
@@ -474,9 +475,9 @@ enum css_left_e {
};
enum css_letter_spacing_e {
- CSS_LETTER_SPACING_INHERIT = 0x0,
- CSS_LETTER_SPACING_SET = 0x1,
- CSS_LETTER_SPACING_NORMAL = 0x2
+ CSS_LETTER_SPACING_INHERIT = CSS_COLUMN_GAP_INHERIT,
+ CSS_LETTER_SPACING_SET = CSS_COLUMN_GAP_SET,
+ CSS_LETTER_SPACING_NORMAL = CSS_COLUMN_GAP_NORMAL
};
enum css_line_height_e {
@@ -737,9 +738,9 @@ enum css_width_e {
};
enum css_word_spacing_e {
- CSS_WORD_SPACING_INHERIT = 0x0,
- CSS_WORD_SPACING_SET = 0x1,
- CSS_WORD_SPACING_NORMAL = 0x2
+ CSS_WORD_SPACING_INHERIT = CSS_COLUMN_GAP_INHERIT,
+ CSS_WORD_SPACING_SET = CSS_COLUMN_GAP_SET,
+ CSS_WORD_SPACING_NORMAL = CSS_COLUMN_GAP_NORMAL
};
enum css_writing_mode_e {
diff --git a/src/bytecode/opcodes.h b/src/bytecode/opcodes.h
index 544687a..4f80142 100644
--- a/src/bytecode/opcodes.h
+++ b/src/bytecode/opcodes.h
@@ -180,10 +180,9 @@ enum op_column_gap {
};
enum op_column_rule_color {
- COLUMN_RULE_COLOR_TRANSPARENT = 0x0000,
- COLUMN_RULE_COLOR_CURRENT_COLOR = 0x0001,
- COLUMN_RULE_COLOR_INVERT = 0x0002,
- COLUMN_RULE_COLOR_SET = 0x0080
+ COLUMN_RULE_COLOR_TRANSPARENT = COLOR_TRANSPARENT,
+ COLUMN_RULE_COLOR_CURRENT_COLOR = COLOR_CURRENT_COLOR,
+ COLUMN_RULE_COLOR_SET = COLOR_SET
};
enum op_column_rule_style {
diff --git a/src/select/computed.c b/src/select/computed.c
index 9b59dc4..8054b02 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -787,6 +787,51 @@ uint8_t css_computed_background_position(const css_computed_style *style,
return get_background_position(style, hlength, hunit, vlength, vunit);
}
+uint8_t css_computed_column_count(const css_computed_style *style,
+ int32_t *column_count)
+{
+ return get_column_count(style, column_count);
+}
+
+uint8_t css_computed_column_fill(const css_computed_style *style)
+{
+ return get_column_fill(style);
+}
+
+uint8_t css_computed_column_gap(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ return get_column_gap(style, length, unit);
+}
+
+uint8_t css_computed_column_rule_color(const css_computed_style *style,
+ css_color *color)
+{
+ return get_column_rule_color(style, color);
+}
+
+uint8_t css_computed_column_rule_style(const css_computed_style *style)
+{
+ return get_column_rule_style(style);
+}
+
+uint8_t css_computed_column_rule_width(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ return get_column_rule_width(style, length, unit);
+}
+
+uint8_t css_computed_column_span(const css_computed_style *style)
+{
+ return get_column_span(style);
+}
+
+uint8_t css_computed_column_width(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ return get_column_width(style, length, unit);
+}
+
uint8_t css_computed_display(const css_computed_style *style,
bool root)
{
diff --git a/src/select/computed.h b/src/select/computed.h
index e7f3742..574d36b 100644
--- a/src/select/computed.h
+++ b/src/select/computed.h
@@ -17,12 +17,20 @@ typedef struct css_computed_uncommon {
/*
* border_spacing 1 + 2(4) 2(4)
* clip 2 + 4(4) + 4 4(4)
+ * column_count 2 4
+ * column_fill 2 0
+ * column_gap 2 + 4 4
+ * column_rule_color 2 4
+ * column_rule_style 4 0
+ * column_rule_width 3 + 4 4
+ * column_span 2 0
+ * column_width 2 + 4 4
* letter_spacing 2 + 4 4
* outline_color 2 4
* outline_width 3 + 4 4
* word_spacing 2 + 4 4
* --- ---
- * 52 bits 40 bytes
+ * 83 bits 60 bytes
*
* Encode counter_increment and _reset as an array of name, value pairs,
* terminated with a blank entry.
@@ -46,25 +54,29 @@ typedef struct css_computed_uncommon {
* 2 bits sizeof(ptr)
*
* ___ ___
- * 61 bits 40 + 4sizeof(ptr) bytes
+ * 96 bits 62 + 4sizeof(ptr) bytes
*
- * 8 bytes 40 + 4sizeof(ptr) bytes
+ * 12 bytes 62 + 4sizeof(ptr) bytes
* ===================
- * 48 + 4sizeof(ptr) bytes
+ * 72 + 4sizeof(ptr) bytes
*
* Bit allocations:
*
* 76543210
- * 1 llllllcc letter-spacing | outline-color
- * 2 ooooooob outline-width | border-spacing
+ * 1 llllllcc letter-spacing | outline-color
+ * 2 ooooooob outline-width | border-spacing
* 3 bbbbbbbb border-spacing
- * 4 wwwwwwir word-spacing | counter-increment | counter-reset
- * 5 uuuuumm. cursor | writing-mode | <unused>
+ * 4 wwwwwwir word-spacing | counter-increment | counter-reset
+ * 5 uuuuumm. cursor | writing-mode | <unused>
* 6 cccccccc clip
* 7 cccccccc clip
- * 8 ccccccoo clip | content
+ * 8 ccccccoo clip | content
+ * 9 ccffssss column_count | column-fill | column-rule-style
+ * 10 ggggggcc column-gap | column-rule-color
+ * 11 wwwwwww. column-rule-width | <unused>
+ * 12 sswwwwww column-span | column_width
*/
- uint8_t bits[8];
+ uint8_t bits[12];
css_fixed border_spacing[2];
@@ -77,6 +89,12 @@ typedef struct css_computed_uncommon {
css_fixed word_spacing;
+ int32_t column_count;
+ css_fixed column_gap;
+ css_color column_rule_color;
+ css_fixed column_rule_width;
+ css_fixed column_width;
+
css_computed_counter *counter_increment;
css_computed_counter *counter_reset;
diff --git a/src/select/dispatch.c b/src/select/dispatch.c
index b03e468..2c72e86 100644
--- a/src/select/dispatch.c
+++ b/src/select/dispatch.c
@@ -536,42 +536,42 @@ struct prop_table prop_dispatch[CSS_N_PROPERTIES] = {
{
PROPERTY_FUNCS(column_count),
0,
- GROUP_NORMAL
+ GROUP_UNCOMMON
},
{
PROPERTY_FUNCS(column_fill),
0,
- GROUP_NORMAL
+ GROUP_UNCOMMON
},
{
PROPERTY_FUNCS(column_gap),
0,
- GROUP_NORMAL
+ GROUP_UNCOMMON
},
{
PROPERTY_FUNCS(column_rule_color),
0,
- GROUP_NORMAL
+ GROUP_UNCOMMON
},
{
PROPERTY_FUNCS(column_rule_style),
0,
- GROUP_NORMAL
+ GROUP_UNCOMMON
},
{
PROPERTY_FUNCS(column_rule_width),
0,
- GROUP_NORMAL
+ GROUP_UNCOMMON
},
{
PROPERTY_FUNCS(column_span),
0,
- GROUP_NORMAL
+ GROUP_UNCOMMON
},
{
PROPERTY_FUNCS(column_width),
0,
- GROUP_NORMAL
+ GROUP_UNCOMMON
},
{
PROPERTY_FUNCS(writing_mode),
diff --git a/src/select/properties/column_count.c b/src/select/properties/column_count.c
index 5fe7465..ecee5f3 100644
--- a/src/select/properties/column_count.c
+++ b/src/select/properties/column_count.c
@@ -17,23 +17,25 @@
css_error css__cascade_column_count(uint32_t opv, css_style *style,
css_select_state *state)
{
+ uint16_t value = CSS_COLUMN_COUNT_INHERIT;
css_fixed count = 0;
if (isInherit(opv) == false) {
switch (getValue(opv)) {
case COLUMN_COUNT_SET:
+ value = CSS_COLUMN_COUNT_SET;
count = *((css_fixed *) style->bytecode);
advance_bytecode(style, sizeof(count));
break;
case COLUMN_COUNT_AUTO:
- /** \todo convert to public values */
+ value = CSS_COLUMN_COUNT_AUTO;
break;
}
}
if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
isInherit(opv))) {
- /** \todo set computed elevation */
+ return set_column_count(state->computed, value, count);
}
return CSS_OK;
@@ -42,26 +44,31 @@ css_error css__cascade_column_count(uint32_t opv, css_style *style,
css_error css__set_column_count_from_hint(const css_hint *hint,
css_computed_style *style)
{
- UNUSED(hint);
- UNUSED(style);
-
- return CSS_OK;
+ return set_column_count(style, hint->status, hint->data.integer);
}
css_error css__initial_column_count(css_select_state *state)
{
- UNUSED(state);
-
- return CSS_OK;
+ return set_column_count(state->computed, CSS_COLUMN_COUNT_AUTO, 0);
}
css_error css__compose_column_count(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
- UNUSED(parent);
- UNUSED(child);
- UNUSED(result);
+ int32_t count = 0;
+ uint8_t type = get_column_count(child, &count);
+
+ if ((child->uncommon == NULL && parent->uncommon != NULL) ||
+ type == CSS_COLUMN_COUNT_INHERIT ||
+ (child->uncommon != NULL && result != child)) {
+ if ((child->uncommon == NULL && parent->uncommon != NULL) ||
+ type == CSS_OUTLINE_COLOR_INHERIT) {
+ type = get_column_count(parent, &count);
+ }
+
+ return set_column_count(result, type, count);
+ }
return CSS_OK;
}
diff --git a/src/select/properties/column_fill.c b/src/select/properties/column_fill.c
index 2322c03..9b4f1e0 100644
--- a/src/select/properties/column_fill.c
+++ b/src/select/properties/column_fill.c
@@ -17,20 +17,24 @@
css_error css__cascade_column_fill(uint32_t opv, css_style *style,
css_select_state *state)
{
+ uint16_t value = CSS_COLUMN_FILL_INHERIT;
+
UNUSED(style);
if (isInherit(opv) == false) {
switch (getValue(opv)) {
case COLUMN_FILL_BALANCE:
+ value = CSS_COLUMN_FILL_BALANCE;
+ break;
case COLUMN_FILL_AUTO:
- /** \todo convert to public values */
+ value = CSS_COLUMN_FILL_AUTO;
break;
}
}
if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
isInherit(opv))) {
- /** \todo set computed elevation */
+ return set_column_fill(state->computed, value);
}
return CSS_OK;
@@ -39,27 +43,24 @@ css_error css__cascade_column_fill(uint32_t opv, css_style *style,
css_error css__set_column_fill_from_hint(const css_hint *hint,
css_computed_style *style)
{
- UNUSED(hint);
- UNUSED(style);
-
- return CSS_OK;
+ return set_column_fill(style, hint->status);
}
css_error css__initial_column_fill(css_select_state *state)
{
- UNUSED(state);
-
- return CSS_OK;
+ return set_column_fill(state->computed, CSS_COLUMN_FILL_BALANCE);
}
css_error css__compose_column_fill(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
- UNUSED(parent);
- UNUSED(child);
- UNUSED(result);
+ uint8_t type = get_column_fill(child);
- return CSS_OK;
+ if (type == CSS_COLUMN_FILL_INHERIT) {
+ type = get_column_fill(parent);
+ }
+
+ return set_column_fill(result, type);
}
diff --git a/src/select/properties/column_gap.c b/src/select/properties/column_gap.c
index 8b7a841..641f529 100644
--- a/src/select/properties/column_gap.c
+++ b/src/select/properties/column_gap.c
@@ -17,54 +17,40 @@
css_error css__cascade_column_gap(uint32_t opv, css_style *style,
css_select_state *state)
{
- css_fixed length = 0;
- uint32_t unit = UNIT_PX;
-
- if (isInherit(opv) == false) {
- switch (getValue(opv)) {
- case COLUMN_GAP_SET:
- length = *((css_fixed *) style->bytecode);
- advance_bytecode(style, sizeof(length));
- unit = *((uint32_t *) style->bytecode);
- advance_bytecode(style, sizeof(unit));
- break;
- case COLUMN_GAP_NORMAL:
- /** \todo convert to public values */
- break;
- }
- }
-
- if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
- isInherit(opv))) {
- /** \todo set computed elevation */
- }
-
- return CSS_OK;
+ return css__cascade_length_normal(opv, style, state, set_column_gap);
}
css_error css__set_column_gap_from_hint(const css_hint *hint,
css_computed_style *style)
{
- UNUSED(hint);
- UNUSED(style);
-
- return CSS_OK;
+ return set_column_gap(style, hint->status,
+ hint->data.length.value, hint->data.length.unit);
}
css_error css__initial_column_gap(css_select_state *state)
{
- UNUSED(state);
-
- return CSS_OK;
+ return set_column_gap(state->computed, CSS_COLUMN_GAP_NORMAL,
+ INTTOFIX(1), CSS_UNIT_EM);
}
css_error css__compose_column_gap(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
- UNUSED(parent);
- UNUSED(child);
- UNUSED(result);
+ css_fixed length = INTTOFIX(1);
+ css_unit unit = CSS_UNIT_EM;
+ uint8_t type = get_column_gap(child, &length, &unit);
+
+ if ((child->uncommon == NULL && parent->uncommon != NULL) ||
+ type == CSS_COLUMN_GAP_INHERIT ||
+ (child->uncommon != NULL && result != child)) {
+ if ((child->uncommon == NULL && parent->uncommon != NULL) ||
+ type == CSS_COLUMN_GAP_INHERIT) {
+ type = get_column_gap(parent, &length, &unit);
+ }
+
+ return set_column_gap(result, type, length, unit);
+ }
return CSS_OK;
}
diff --git a/src/select/properties/column_rule_color.c b/src/select/properties/column_rule_color.c
index 933cb60..d4b0e77 100644
--- a/src/select/properties/column_rule_color.c
+++ b/src/select/properties/column_rule_color.c
@@ -17,24 +17,31 @@
css_error css__cascade_column_rule_color(uint32_t opv, css_style *style,
css_select_state *state)
{
+ bool inherit = isInherit(opv);
+ uint16_t value = CSS_COLUMN_RULE_COLOR_INHERIT;
css_color color = 0;
if (isInherit(opv) == false) {
switch (getValue(opv)) {
- case COLUMN_RULE_COLOR_SET:
- color = *((css_fixed *) style->bytecode);
- advance_bytecode(style, sizeof(color));
- break;
case COLUMN_RULE_COLOR_TRANSPARENT:
+ value = CSS_COLUMN_RULE_COLOR_COLOR;
+ break;
case COLUMN_RULE_COLOR_CURRENT_COLOR:
- /** \todo convert to public values */
+ /* color: currentColor always computes to inherit */
+ value = CSS_COLUMN_RULE_COLOR_INHERIT;
+ inherit = true;
+ break;
+ case COLUMN_RULE_COLOR_SET:
+ value = CSS_COLUMN_RULE_COLOR_COLOR;
+ color = *((css_fixed *) style->bytecode);
+ advance_bytecode(style, sizeof(color));
break;
}
}
if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
- isInherit(opv))) {
- /** \todo set computed elevation */
+ inherit)) {
+ return set_column_rule_color(state->computed, value, color);
}
return CSS_OK;
@@ -43,27 +50,26 @@ css_error css__cascade_column_rule_color(uint32_t opv, css_style *style,
css_error css__set_column_rule_color_from_hint(const css_hint *hint,
css_computed_style *style)
{
- UNUSED(hint);
- UNUSED(style);
-
- return CSS_OK;
+ return set_column_rule_color(style, hint->status, hint->data.color);
}
css_error css__initial_column_rule_color(css_select_state *state)
{
- UNUSED(state);
-
- return CSS_OK;
+ return set_column_rule_color(state->computed,
+ CSS_COLUMN_RULE_COLOR_INHERIT, 0);
}
css_error css__compose_column_rule_color(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
- UNUSED(parent);
- UNUSED(child);
- UNUSED(result);
+ css_color color;
+ uint8_t type = get_column_rule_color(child, &color);
- return CSS_OK;
+ if (type == CSS_COLUMN_RULE_COLOR_INHERIT) {
+ type = get_column_rule_color(parent, &color);
+ }
+
+ return set_column_rule_color(result, type, color);
}
diff --git a/src/select/properties/column_rule_style.c b/src/select/properties/column_rule_style.c
index ba558a2..586ce5d 100644
--- a/src/select/properties/column_rule_style.c
+++ b/src/select/properties/column_rule_style.c
@@ -17,57 +17,32 @@
css_error css__cascade_column_rule_style(uint32_t opv, css_style *style,
css_select_state *state)
{
- UNUSED(style);
-
- if (isInherit(opv) == false) {
- switch (getValue(opv)) {
- case COLUMN_RULE_STYLE_NONE:
- case COLUMN_RULE_STYLE_HIDDEN:
- case COLUMN_RULE_STYLE_DOTTED:
- case COLUMN_RULE_STYLE_DASHED:
- case COLUMN_RULE_STYLE_SOLID:
- case COLUMN_RULE_STYLE_DOUBLE:
- case COLUMN_RULE_STYLE_GROOVE:
- case COLUMN_RULE_STYLE_RIDGE:
- case COLUMN_RULE_STYLE_INSET:
- case COLUMN_RULE_STYLE_OUTSET:
- /** \todo convert to public values */
- break;
- }
- }
-
- if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
- isInherit(opv))) {
- /** \todo set computed elevation */
- }
-
- return CSS_OK;
+ return css__cascade_border_style(opv, style, state,
+ set_column_rule_style);
}
css_error css__set_column_rule_style_from_hint(const css_hint *hint,
css_computed_style *style)
{
- UNUSED(hint);
- UNUSED(style);
-
- return CSS_OK;
+ return set_column_rule_style(style, hint->status);
}
css_error css__initial_column_rule_style(css_select_state *state)
{
- UNUSED(state);
-
- return CSS_OK;
+ return set_column_rule_style(state->computed,
+ CSS_COLUMN_RULE_STYLE_NONE);
}
css_error css__compose_column_rule_style(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
- UNUSED(parent);
- UNUSED(child);
- UNUSED(result);
+ uint8_t type = get_column_rule_style(child);
+
+ if (type == CSS_COLUMN_RULE_STYLE_INHERIT) {
+ type = get_column_rule_style(parent);
+ }
- return CSS_OK;
+ return set_column_rule_style(result, type);
}
diff --git a/src/select/properties/column_rule_width.c b/src/select/properties/column_rule_width.c
index 2c0ca0d..8694a09 100644
--- a/src/select/properties/column_rule_width.c
+++ b/src/select/properties/column_rule_width.c
@@ -17,57 +17,35 @@
css_error css__cascade_column_rule_width(uint32_t opv, css_style *style,
css_select_state *state)
{
- css_fixed length = 0;
- uint32_t unit = UNIT_PX;
-
- if (isInherit(opv) == false) {
- switch (getValue(opv)) {
- case COLUMN_RULE_WIDTH_SET:
- length = *((css_fixed *) style->bytecode);
- advance_bytecode(style, sizeof(length));
- unit = *((uint32_t *) style->bytecode);
- advance_bytecode(style, sizeof(unit));
- break;
- case COLUMN_RULE_WIDTH_THIN:
- case COLUMN_RULE_WIDTH_MEDIUM:
- case COLUMN_RULE_WIDTH_THICK:
- /** \todo convert to public values */
- break;
- }
- }
-
- if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
- isInherit(opv))) {
- /** \todo set computed elevation */
- }
-
- return CSS_OK;
+ return css__cascade_border_width(opv, style, state,
+ set_column_rule_width);
}
css_error css__set_column_rule_width_from_hint(const css_hint *hint,
css_computed_style *style)
{
- UNUSED(hint);
- UNUSED(style);
-
- return CSS_OK;
+ return set_column_rule_width(style, hint->status,
+ hint->data.length.value, hint->data.length.unit);
}
css_error css__initial_column_rule_width(css_select_state *state)
{
- UNUSED(state);
-
- return CSS_OK;
+ return set_column_rule_width(state->computed,
+ CSS_COLUMN_RULE_WIDTH_MEDIUM, 0, CSS_UNIT_PX);
}
css_error css__compose_column_rule_width(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
- UNUSED(parent);
- UNUSED(child);
- UNUSED(result);
+ css_fixed length = 0;
+ css_unit unit = CSS_UNIT_PX;
+ uint8_t type = get_column_rule_width(child, &length, &unit);
+
+ if (type == CSS_COLUMN_RULE_WIDTH_INHERIT) {
+ type = get_column_rule_width(parent, &length, &unit);
+ }
- return CSS_OK;
+ return set_column_rule_width(result, type, length, unit);
}
diff --git a/src/select/properties/column_span.c b/src/select/properties/column_span.c
index 92048a0..2c870d3 100644
--- a/src/select/properties/column_span.c
+++ b/src/select/properties/column_span.c
@@ -14,23 +14,27 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_column_span(uint32_t opv, css_style *style,
+css_error css__cascade_column_span(uint32_t opv, css_style *style,
css_select_state *state)
{
+ uint16_t value = CSS_COLUMN_SPAN_INHERIT;
+
UNUSED(style);
if (isInherit(opv) == false) {
switch (getValue(opv)) {
case COLUMN_SPAN_NONE:
+ value = CSS_COLUMN_SPAN_NONE;
+ break;
case COLUMN_SPAN_ALL:
- /** \todo convert to public values */
+ value = CSS_COLUMN_SPAN_ALL;
break;
}
}
if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
isInherit(opv))) {
- /** \todo set computed elevation */
+ return set_column_span(state->computed, value);
}
return CSS_OK;
@@ -39,27 +43,24 @@ css_error css__cascade_column_span(uint32_t opv, css_style *style,
css_error css__set_column_span_from_hint(const css_hint *hint,
css_computed_style *style)
{
- UNUSED(hint);
- UNUSED(style);
-
- return CSS_OK;
+ return set_column_span(style, hint->status);
}
css_error css__initial_column_span(css_select_state *state)
{
- UNUSED(state);
-
- return CSS_OK;
+ return set_column_span(state->computed, CSS_COLUMN_SPAN_NONE);
}
css_error css__compose_column_span(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
- UNUSED(parent);
- UNUSED(child);
- UNUSED(result);
+ uint8_t type = get_column_span(child);
- return CSS_OK;
+ if (type == CSS_COLUMN_SPAN_INHERIT) {
+ type = get_column_span(parent);
+ }
+
+ return set_column_span(result, type);
}
diff --git a/src/select/properties/column_width.c b/src/select/properties/column_width.c
index fd053d9..45eb7fc 100644
--- a/src/select/properties/column_width.c
+++ b/src/select/properties/column_width.c
@@ -14,57 +14,43 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_column_width(uint32_t opv, css_style *style,
+css_error css__cascade_column_width(uint32_t opv, css_style *style,
css_select_state *state)
{
- css_fixed length = 0;
- uint32_t unit = UNIT_PX;
-
- if (isInherit(opv) == false) {
- switch (getValue(opv)) {
- case COLUMN_WIDTH_SET:
- length = *((css_fixed *) style->bytecode);
- advance_bytecode(style, sizeof(length));
- unit = *((uint32_t *) style->bytecode);
- advance_bytecode(style, sizeof(unit));
- break;
- case COLUMN_WIDTH_AUTO:
- /** \todo convert to public values */
- break;
- }
- }
-
- if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
- isInherit(opv))) {
- /** \todo set computed elevation */
- }
-
- return CSS_OK;
+ return css__cascade_length_normal(opv, style, state, set_column_width);
}
css_error css__set_column_width_from_hint(const css_hint *hint,
css_computed_style *style)
{
- UNUSED(hint);
- UNUSED(style);
-
- return CSS_OK;
+ return set_column_width(style, hint->status,
+ hint->data.length.value, hint->data.length.unit);
}
css_error css__initial_column_width(css_select_state *state)
{
- UNUSED(state);
-
- return CSS_OK;
+ return set_column_width(state->computed, CSS_COLUMN_WIDTH_AUTO,
+ INTTOFIX(1), CSS_UNIT_EM);
}
css_error css__compose_column_width(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
- UNUSED(parent);
- UNUSED(child);
- UNUSED(result);
+ css_fixed length = INTTOFIX(1);
+ css_unit unit = CSS_UNIT_EM;
+ uint8_t type = get_column_width(child, &length, &unit);
+
+ if ((child->uncommon == NULL && parent->uncommon != NULL) ||
+ type == CSS_COLUMN_WIDTH_INHERIT ||
+ (child->uncommon != NULL && result != child)) {
+ if ((child->uncommon == NULL && parent->uncommon != NULL) ||
+ type == CSS_COLUMN_WIDTH_INHERIT) {
+ type = get_column_width(parent, &length, &unit);
+ }
+
+ return set_column_width(result, type, length, unit);
+ }
return CSS_OK;
}
diff --git a/src/select/propget.h b/src/select/propget.h
index b124cfe..08ed0f4 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -18,7 +18,7 @@
#define LETTER_SPACING_SHIFT 2
#define LETTER_SPACING_MASK 0xfc
static inline uint8_t get_letter_spacing(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
if (style->uncommon != NULL) {
@@ -72,7 +72,7 @@ static inline uint8_t get_outline_color(
#define OUTLINE_WIDTH_SHIFT 1
#define OUTLINE_WIDTH_MASK 0xfe
static inline uint8_t get_outline_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
if (style->uncommon != NULL) {
@@ -106,7 +106,7 @@ static inline uint8_t get_outline_width(
#define BORDER_SPACING_SHIFT1 0
#define BORDER_SPACING_MASK1 0xff
static inline uint8_t get_border_spacing(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *hlength, css_unit *hunit,
css_fixed *vlength, css_unit *vunit)
{
@@ -117,7 +117,7 @@ static inline uint8_t get_border_spacing(
/* 1 bit: type */
if (bits == CSS_BORDER_SPACING_SET) {
- uint8_t bits1 =
+ uint8_t bits1 =
style->uncommon->bits[BORDER_SPACING_INDEX1];
bits1 &= BORDER_SPACING_MASK1;
bits1 >>= BORDER_SPACING_SHIFT1;
@@ -150,7 +150,7 @@ static inline uint8_t get_border_spacing(
#define WORD_SPACING_SHIFT 2
#define WORD_SPACING_MASK 0xfc
static inline uint8_t get_word_spacing(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
if (style->uncommon != NULL) {
@@ -199,7 +199,7 @@ static inline uint8_t get_writing_mode(
#define COUNTER_INCREMENT_SHIFT 1
#define COUNTER_INCREMENT_MASK 0x2
static inline uint8_t get_counter_increment(
- const css_computed_style *style,
+ const css_computed_style *style,
const css_computed_counter **counters)
{
if (style->uncommon != NULL) {
@@ -223,7 +223,7 @@ static inline uint8_t get_counter_increment(
#define COUNTER_RESET_SHIFT 0
#define COUNTER_RESET_MASK 0x1
static inline uint8_t get_counter_reset(
- const css_computed_style *style,
+ const css_computed_style *style,
const css_computed_counter **counters)
{
if (style->uncommon != NULL) {
@@ -247,7 +247,7 @@ static inline uint8_t get_counter_reset(
#define CURSOR_SHIFT 3
#define CURSOR_MASK 0xf8
static inline uint8_t get_cursor(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string ***urls)
{
if (style->uncommon != NULL) {
@@ -277,7 +277,7 @@ static inline uint8_t get_cursor(
#define CLIP_SHIFT2 0
#define CLIP_MASK2 0xff
static inline uint8_t get_clip(
- const css_computed_style *style,
+ const css_computed_style *style,
css_computed_clip_rect *rect)
{
if (style->uncommon != NULL) {
@@ -287,7 +287,7 @@ static inline uint8_t get_clip(
/* 6bits: trblyy : top | right | bottom | left | type */
if ((bits & 0x3) == CSS_CLIP_RECT) {
- uint8_t bits1;
+ uint8_t bits1;
rect->left_auto = (bits & 0x4);
rect->bottom_auto = (bits & 0x8);
@@ -342,11 +342,203 @@ static inline uint8_t get_clip(
#undef CLIP_SHIFT
#undef CLIP_INDEX
+#define COLUMN_COUNT_INDEX 8
+#define COLUMN_COUNT_SHIFT 6
+#define COLUMN_COUNT_MASK 0xc0
+static inline uint8_t get_column_count(
+ const css_computed_style *style, int32_t *count)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[COLUMN_COUNT_INDEX];
+ bits &= COLUMN_COUNT_MASK;
+ bits >>= COLUMN_COUNT_SHIFT;
+
+ /* 2bits: tt : type */
+ *count = style->uncommon->column_count;
+
+ return bits;
+ }
+
+ return CSS_COLUMN_COUNT_AUTO;
+}
+#undef COLUMN_COUNT_MASK
+#undef COLUMN_COUNT_SHIFT
+#undef COLUMN_COUNT_INDEX
+
+#define COLUMN_FILL_INDEX 8
+#define COLUMN_FILL_SHIFT 4
+#define COLUMN_FILL_MASK 0x30
+static inline uint8_t get_column_fill(
+ const css_computed_style *style)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[COLUMN_FILL_INDEX];
+ bits &= COLUMN_FILL_MASK;
+ bits >>= COLUMN_FILL_SHIFT;
+
+ /* 2bits: type */
+ return bits;
+ }
+
+ return CSS_COLUMN_FILL_BALANCE;
+}
+#undef COLUMN_FILL_MASK
+#undef COLUMN_FILL_SHIFT
+#undef COLUMN_FILL_INDEX
+
+#define COLUMN_GAP_INDEX 9
+#define COLUMN_GAP_SHIFT 2
+#define COLUMN_GAP_MASK 0xfc
+static inline uint8_t get_column_gap(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[COLUMN_GAP_INDEX];
+ bits &= COLUMN_GAP_MASK;
+ bits >>= COLUMN_GAP_SHIFT;
+
+ /* 6bits: uuuutt : units | type */
+ if ((bits & 0x3) == CSS_COLUMN_GAP_SET) {
+ *length = style->uncommon->column_gap;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+ }
+
+ return CSS_COLUMN_GAP_NORMAL;
+}
+#undef COLUMN_GAP_MASK
+#undef COLUMN_GAP_SHIFT
+#undef COLUMN_GAP_INDEX
+
+#define COLUMN_RULE_COLOR_INDEX 9
+#define COLUMN_RULE_COLOR_SHIFT 0
+#define COLUMN_RULE_COLOR_MASK 0x3
+static inline uint8_t get_column_rule_color(
+ const css_computed_style *style,
+ css_color *color)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[COLUMN_RULE_COLOR_INDEX];
+ bits &= COLUMN_RULE_COLOR_MASK;
+ bits >>= COLUMN_RULE_COLOR_SHIFT;
+
+ /* 2bits: type */
+ *color = style->uncommon->column_rule_color;
+
+ return bits;
+ }
+
+ *color = 0;
+ return CSS_COLUMN_RULE_COLOR_CURRENT_COLOR;
+}
+#undef COLUMN_RULE_COLOR_MASK
+#undef COLUMN_RULE_COLOR_SHIFT
+#undef COLUMN_RULE_COLOR_INDEX
+
+#define COLUMN_RULE_STYLE_INDEX 8
+#define COLUMN_RULE_STYLE_SHIFT 0
+#define COLUMN_RULE_STYLE_MASK 0xf
+static inline uint8_t get_column_rule_style(
+ const css_computed_style *style)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[COLUMN_RULE_STYLE_INDEX];
+ bits &= COLUMN_RULE_STYLE_MASK;
+ bits >>= COLUMN_RULE_STYLE_SHIFT;
+
+ /* 4bits: type */
+ return bits;
+ }
+
+ return CSS_COLUMN_RULE_STYLE_NONE;
+}
+#undef COLUMN_RULE_STYLE_MASK
+#undef COLUMN_RULE_STYLE_SHIFT
+#undef COLUMN_RULE_STYLE_INDEX
+
+#define COLUMN_RULE_WIDTH_INDEX 10
+#define COLUMN_RULE_WIDTH_SHIFT 1
+#define COLUMN_RULE_WIDTH_MASK 0xfe
+static inline uint8_t get_column_rule_width(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[COLUMN_RULE_WIDTH_INDEX];
+ bits &= COLUMN_RULE_WIDTH_MASK;
+ bits >>= COLUMN_RULE_WIDTH_SHIFT;
+
+ /* 7bits: uuuuttt : units | type */
+ if ((bits & 0x7) == CSS_COLUMN_RULE_WIDTH_WIDTH) {
+ *length = style->uncommon->column_rule_width;
+ *unit = bits >> 3;
+ }
+
+ return (bits & 0x7);
+ }
+
+ return CSS_COLUMN_RULE_WIDTH_MEDIUM;
+}
+#undef COLUMN_RULE_WIDTH_MASK
+#undef COLUMN_RULE_WIDTH_SHIFT
+#undef COLUMN_RULE_WIDTH_INDEX
+
+#define COLUMN_SPAN_INDEX 11
+#define COLUMN_SPAN_SHIFT 6
+#define COLUMN_SPAN_MASK 0xc0
+static inline uint8_t get_column_span(
+ const css_computed_style *style)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[COLUMN_SPAN_INDEX];
+ bits &= COLUMN_SPAN_MASK;
+ bits >>= COLUMN_SPAN_SHIFT;
+
+ /* 2bits: type */
+ return bits;
+ }
+
+ return CSS_COLUMN_SPAN_NONE;
+}
+#undef COLUMN_SPAN_MASK
+#undef COLUMN_SPAN_SHIFT
+#undef COLUMN_SPAN_INDEX
+
+#define COLUMN_WIDTH_INDEX 11
+#define COLUMN_WIDTH_SHIFT 0
+#define COLUMN_WIDTH_MASK 0x3f
+static inline uint8_t get_column_width(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[COLUMN_WIDTH_INDEX];
+ bits &= COLUMN_WIDTH_MASK;
+ bits >>= COLUMN_WIDTH_SHIFT;
+
+ /* 6bits: uuuutt : units | type */
+ if ((bits & 0x3) == CSS_COLUMN_WIDTH_SET) {
+ *length = style->uncommon->column_width;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+ }
+
+ return CSS_COLUMN_WIDTH_AUTO;
+}
+#undef COLUMN_WIDTH_MASK
+#undef COLUMN_WIDTH_SHIFT
+#undef COLUMN_WIDTH_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
static inline uint8_t get_content(
- const css_computed_style *style,
+ const css_computed_style *style,
const css_computed_content_item **content)
{
if (style->uncommon != NULL) {
@@ -370,7 +562,7 @@ static inline uint8_t get_content(
#define VERTICAL_ALIGN_SHIFT 0
#define VERTICAL_ALIGN_MASK 0xff
static inline uint8_t get_vertical_align(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[VERTICAL_ALIGN_INDEX];
@@ -393,7 +585,7 @@ static inline uint8_t get_vertical_align(
#define FONT_SIZE_SHIFT 0
#define FONT_SIZE_MASK 0xff
static inline uint8_t get_font_size(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[FONT_SIZE_INDEX];
@@ -416,7 +608,7 @@ static inline uint8_t get_font_size(
#define BORDER_TOP_WIDTH_SHIFT 1
#define BORDER_TOP_WIDTH_MASK 0xfe
static inline uint8_t get_border_top_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[BORDER_TOP_WIDTH_INDEX];
@@ -439,7 +631,7 @@ static inline uint8_t get_border_top_width(
#define BORDER_RIGHT_WIDTH_SHIFT 1
#define BORDER_RIGHT_WIDTH_MASK 0xfe
static inline uint8_t get_border_right_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[BORDER_RIGHT_WIDTH_INDEX];
@@ -462,7 +654,7 @@ static inline uint8_t get_border_right_width(
#define BORDER_BOTTOM_WIDTH_SHIFT 1
#define BORDER_BOTTOM_WIDTH_MASK 0xfe
static inline uint8_t get_border_bottom_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[BORDER_BOTTOM_WIDTH_INDEX];
@@ -485,7 +677,7 @@ static inline uint8_t get_border_bottom_width(
#define BORDER_LEFT_WIDTH_SHIFT 1
#define BORDER_LEFT_WIDTH_MASK 0xfe
static inline uint8_t get_border_left_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[BORDER_LEFT_WIDTH_INDEX];
@@ -508,7 +700,7 @@ static inline uint8_t get_border_left_width(
#define BACKGROUND_IMAGE_SHIFT 0
#define BACKGROUND_IMAGE_MASK 0x1
static inline uint8_t get_background_image(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string **url)
{
uint8_t bits = style->bits[BACKGROUND_IMAGE_INDEX];
@@ -528,7 +720,7 @@ static inline uint8_t get_background_image(
#define COLOR_SHIFT 0
#define COLOR_MASK 0x1
static inline uint8_t get_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color)
{
uint8_t bits = style->bits[COLOR_INDEX];
@@ -548,7 +740,7 @@ static inline uint8_t get_color(
#define LIST_STYLE_IMAGE_SHIFT 0
#define LIST_STYLE_IMAGE_MASK 0x1
static inline uint8_t get_list_style_image(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string **url)
{
uint8_t bits = style->bits[LIST_STYLE_IMAGE_INDEX];
@@ -568,7 +760,7 @@ static inline uint8_t get_list_style_image(
#define QUOTES_SHIFT 0
#define QUOTES_MASK 0x1
static inline uint8_t get_quotes(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string ***quotes)
{
uint8_t bits = style->bits[QUOTES_INDEX];
@@ -588,7 +780,7 @@ static inline uint8_t get_quotes(
#define TOP_SHIFT 2
#define TOP_MASK 0xfc
static inline uint8_t get_top(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[TOP_INDEX];
@@ -621,7 +813,7 @@ static inline uint8_t get_top_bits(
#define RIGHT_SHIFT 2
#define RIGHT_MASK 0xfc
static inline uint8_t get_right(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[RIGHT_INDEX];
@@ -654,7 +846,7 @@ static inline uint8_t get_right_bits(
#define BOTTOM_SHIFT 2
#define BOTTOM_MASK 0xfc
static inline uint8_t get_bottom(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[BOTTOM_INDEX];
@@ -687,7 +879,7 @@ static inline uint8_t get_bottom_bits(
#define LEFT_SHIFT 2
#define LEFT_MASK 0xfc
static inline uint8_t get_left(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[LEFT_INDEX];
@@ -720,7 +912,7 @@ static inline uint8_t get_left_bits(
#define BORDER_TOP_COLOR_SHIFT 0
#define BORDER_TOP_COLOR_MASK 0x3
static inline uint8_t get_border_top_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color)
{
uint8_t bits = style->bits[BORDER_TOP_COLOR_INDEX];
@@ -740,7 +932,7 @@ static inline uint8_t get_border_top_color(
#define BORDER_RIGHT_COLOR_SHIFT 0
#define BORDER_RIGHT_COLOR_MASK 0x3
static inline uint8_t get_border_right_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color)
{
uint8_t bits = style->bits[BORDER_RIGHT_COLOR_INDEX];
@@ -760,7 +952,7 @@ static inline uint8_t get_border_right_color(
#define BORDER_BOTTOM_COLOR_SHIFT 0
#define BORDER_BOTTOM_COLOR_MASK 0x3
static inline uint8_t get_border_bottom_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color)
{
uint8_t bits = style->bits[BORDER_BOTTOM_COLOR_INDEX];
@@ -780,7 +972,7 @@ static inline uint8_t get_border_bottom_color(
#define BORDER_LEFT_COLOR_SHIFT 0
#define BORDER_LEFT_COLOR_MASK 0x3
static inline uint8_t get_border_left_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color)
{
uint8_t bits = style->bits[BORDER_LEFT_COLOR_INDEX];
@@ -800,7 +992,7 @@ static inline uint8_t get_border_left_color(
#define HEIGHT_SHIFT 2
#define HEIGHT_MASK 0xfc
static inline uint8_t get_height(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[HEIGHT_INDEX];
@@ -823,7 +1015,7 @@ static inline uint8_t get_height(
#define LINE_HEIGHT_SHIFT 2
#define LINE_HEIGHT_MASK 0xfc
static inline uint8_t get_line_height(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[LINE_HEIGHT_INDEX];
@@ -831,7 +1023,7 @@ static inline uint8_t get_line_height(
bits >>= LINE_HEIGHT_SHIFT;
/* 6bits: uuuutt : units | type */
- if ((bits & 0x3) == CSS_LINE_HEIGHT_NUMBER ||
+ if ((bits & 0x3) == CSS_LINE_HEIGHT_NUMBER ||
(bits & 0x3) == CSS_LINE_HEIGHT_DIMENSION) {
*length = style->line_height;
}
@@ -850,7 +1042,7 @@ static inline uint8_t get_line_height(
#define BACKGROUND_COLOR_SHIFT 0
#define BACKGROUND_COLOR_MASK 0x3
static inline uint8_t get_background_color(
- const css_computed_style *style,
+ const css_computed_style *style,
css_color *color)
{
uint8_t bits = style->bits[BACKGROUND_COLOR_INDEX];
@@ -870,7 +1062,7 @@ static inline uint8_t get_background_color(
#define Z_INDEX_SHIFT 0
#define Z_INDEX_MASK 0x3
static inline uint8_t get_z_index(
- const css_computed_style *style,
+ const css_computed_style *style,
int32_t *z_index)
{
uint8_t bits = style->bits[Z_INDEX_INDEX];
@@ -890,7 +1082,7 @@ static inline uint8_t get_z_index(
#define MARGIN_TOP_SHIFT 2
#define MARGIN_TOP_MASK 0xfc
static inline uint8_t get_margin_top(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[MARGIN_TOP_INDEX];
@@ -913,7 +1105,7 @@ static inline uint8_t get_margin_top(
#define MARGIN_RIGHT_SHIFT 2
#define MARGIN_RIGHT_MASK 0xfc
static inline uint8_t get_margin_right(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[MARGIN_RIGHT_INDEX];
@@ -936,7 +1128,7 @@ static inline uint8_t get_margin_right(
#define MARGIN_BOTTOM_SHIFT 2
#define MARGIN_BOTTOM_MASK 0xfc
static inline uint8_t get_margin_bottom(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[MARGIN_BOTTOM_INDEX];
@@ -959,7 +1151,7 @@ static inline uint8_t get_margin_bottom(
#define MARGIN_LEFT_SHIFT 2
#define MARGIN_LEFT_MASK 0xfc
static inline uint8_t get_margin_left(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[MARGIN_LEFT_INDEX];
@@ -1050,7 +1242,7 @@ static inline uint8_t get_direction(
#define MAX_HEIGHT_SHIFT 2
#define MAX_HEIGHT_MASK 0xfc
static inline uint8_t get_max_height(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[MAX_HEIGHT_INDEX];
@@ -1073,7 +1265,7 @@ static inline uint8_t get_max_height(
#define MAX_WIDTH_SHIFT 2
#define MAX_WIDTH_MASK 0xfc
static inline uint8_t get_max_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[MAX_WIDTH_INDEX];
@@ -1096,7 +1288,7 @@ static inline uint8_t get_max_width(
#define WIDTH_SHIFT 2
#define WIDTH_MASK 0xfc
static inline uint8_t get_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[WIDTH_INDEX];
@@ -1170,7 +1362,7 @@ static inline uint8_t get_font_style(
#define MIN_HEIGHT_SHIFT 3
#define MIN_HEIGHT_MASK 0xf8
static inline uint8_t get_min_height(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[MIN_HEIGHT_INDEX];
@@ -1193,7 +1385,7 @@ static inline uint8_t get_min_height(
#define MIN_WIDTH_SHIFT 3
#define MIN_WIDTH_MASK 0xf8
static inline uint8_t get_min_width(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[MIN_WIDTH_INDEX];
@@ -1250,7 +1442,7 @@ static inline uint8_t get_clear(
#define PADDING_TOP_SHIFT 3
#define PADDING_TOP_MASK 0xf8
static inline uint8_t get_padding_top(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[PADDING_TOP_INDEX];
@@ -1273,7 +1465,7 @@ static inline uint8_t get_padding_top(
#define PADDING_RIGHT_SHIFT 3
#define PADDING_RIGHT_MASK 0xf8
static inline uint8_t get_padding_right(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[PADDING_RIGHT_INDEX];
@@ -1296,7 +1488,7 @@ static inline uint8_t get_padding_right(
#define PADDING_BOTTOM_SHIFT 3
#define PADDING_BOTTOM_MASK 0xf8
static inline uint8_t get_padding_bottom(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[PADDING_BOTTOM_INDEX];
@@ -1319,7 +1511,7 @@ static inline uint8_t get_padding_bottom(
#define PADDING_LEFT_SHIFT 3
#define PADDING_LEFT_MASK 0xf8
static inline uint8_t get_padding_left(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[PADDING_LEFT_INDEX];
@@ -1393,7 +1585,7 @@ static inline uint8_t get_position(
#define OPACITY_SHIFT 2
#define OPACITY_MASK 0x04
static inline uint8_t get_opacity(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *opacity)
{
uint8_t bits = style->bits[OPACITY_INDEX];
@@ -1432,7 +1624,7 @@ static inline uint8_t get_text_transform(
#define TEXT_INDENT_SHIFT 3
#define TEXT_INDENT_MASK 0xf8
static inline uint8_t get_text_indent(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
uint8_t bits = style->bits[TEXT_INDENT_INDEX];
@@ -1475,7 +1667,7 @@ static inline uint8_t get_white_space(
#define BACKGROUND_POSITION_SHIFT1 0
#define BACKGROUND_POSITION_MASK1 0xff
static inline uint8_t get_background_position(
- const css_computed_style *style,
+ const css_computed_style *style,
css_fixed *hlength, css_unit *hunit,
css_fixed *vlength, css_unit *vunit)
{
@@ -1561,7 +1753,7 @@ static inline uint8_t get_text_decoration(
#define FONT_FAMILY_SHIFT 0
#define FONT_FAMILY_MASK 0x7
static inline uint8_t get_font_family(
- const css_computed_style *style,
+ const css_computed_style *style,
lwc_string ***names)
{
uint8_t bits = style->bits[FONT_FAMILY_INDEX];
@@ -1801,7 +1993,7 @@ static inline uint8_t get_page_break_after(
#undef PAGE_BREAK_AFTER_MASK
#undef PAGE_BREAK_AFTER_SHIFT
#undef PAGE_BREAK_AFTER_INDEX
-
+
#define PAGE_BREAK_BEFORE_INDEX 0
#define PAGE_BREAK_BEFORE_SHIFT 3
#define PAGE_BREAK_BEFORE_MASK 0x38
@@ -1816,13 +2008,13 @@ static inline uint8_t get_page_break_before(
/* 3bits: type */
return bits;
}
-
+
return CSS_PAGE_BREAK_BEFORE_AUTO;
}
#undef PAGE_BREAK_BEFORE_MASK
#undef PAGE_BREAK_BEFORE_SHIFT
#undef PAGE_BREAK_BEFORE_INDEX
-
+
#define PAGE_BREAK_INSIDE_INDEX 0
#define PAGE_BREAK_INSIDE_SHIFT 6
#define PAGE_BREAK_INSIDE_MASK 0xc0
@@ -1855,13 +2047,13 @@ static inline uint8_t get_orphans(
uint8_t bits = style->page->bits[ORPHANS_INDEX];
bits &= ORPHANS_MASK;
bits >>= ORPHANS_SHIFT;
-
+
*orphans = style->page->orphans;
-
+
/* 1bit: type */
return bits;
}
-
+
*orphans = 2;
return CSS_ORPHANS_SET;
}
@@ -1880,13 +2072,13 @@ static inline uint8_t get_widows(
uint8_t bits = style->page->bits[WIDOWS_INDEX];
bits &= WIDOWS_MASK;
bits >>= WIDOWS_SHIFT;
-
+
*widows = style->page->widows;
-
+
/* 1bit: type */
return bits;
}
-
+
*widows = 2;
return CSS_WIDOWS_SET;
}
diff --git a/src/select/propset.h b/src/select/propset.h
index b7da5a6..769d3b3 100644
--- a/src/select/propset.h
+++ b/src/select/propset.h
@@ -20,12 +20,17 @@ static const css_computed_uncommon default_uncommon = {
{ (CSS_LETTER_SPACING_INHERIT << 2) | CSS_OUTLINE_COLOR_INVERT,
(CSS_OUTLINE_WIDTH_MEDIUM << 1) | CSS_BORDER_SPACING_INHERIT,
0,
- (CSS_WORD_SPACING_INHERIT << 2) |
+ (CSS_WORD_SPACING_INHERIT << 2) |
(CSS_COUNTER_INCREMENT_NONE << 1) | CSS_COUNTER_RESET_NONE,
(CSS_CURSOR_INHERIT << 3) | (CSS_WRITING_MODE_INHERIT << 1) | 0,
0,
0,
- (CSS_CLIP_AUTO << 2) | CSS_CONTENT_NORMAL
+ (CSS_CLIP_AUTO << 2) | CSS_CONTENT_NORMAL,
+ (CSS_COLUMN_COUNT_AUTO << 6) | (CSS_COLUMN_FILL_BALANCE << 4) |
+ (CSS_COLUMN_RULE_STYLE_NONE << 0),
+ (CSS_COLUMN_GAP_NORMAL << 2) | (CSS_COLUMN_RULE_COLOR_CURRENT_COLOR),
+ (CSS_COLUMN_RULE_WIDTH_MEDIUM << 1),
+ (CSS_COLUMN_SPAN_NONE << 6) | CSS_COLUMN_WIDTH_AUTO
},
{ 0, 0 },
{ 0, 0, 0, 0 },
@@ -33,6 +38,11 @@ static const css_computed_uncommon default_uncommon = {
0,
0,
0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
NULL,
NULL,
NULL,
@@ -51,14 +61,14 @@ static const css_computed_uncommon default_uncommon = {
} while(0)
static const css_computed_page default_page = {
- {
- (CSS_PAGE_BREAK_INSIDE_AUTO << 6) |
+ {
+ (CSS_PAGE_BREAK_INSIDE_AUTO << 6) |
(CSS_PAGE_BREAK_BEFORE_AUTO << 3) |
CSS_PAGE_BREAK_AFTER_AUTO,
- (CSS_WIDOWS_SET << 1) |
+ (CSS_WIDOWS_SET << 1) |
CSS_ORPHANS_SET
},
- 2 << CSS_RADIX_POINT,
+ 2 << CSS_RADIX_POINT,
2 << CSS_RADIX_POINT
};
@@ -77,7 +87,7 @@ static const css_computed_page default_page = {
#define LETTER_SPACING_SHIFT 2
#define LETTER_SPACING_MASK 0xfc
static inline css_error set_letter_spacing(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits;
@@ -87,7 +97,7 @@ static inline css_error set_letter_spacing(
bits = &style->uncommon->bits[LETTER_SPACING_INDEX];
/* 6bits: uuuutt : unit | type */
- *bits = (*bits & ~LETTER_SPACING_MASK) |
+ *bits = (*bits & ~LETTER_SPACING_MASK) |
(((type & 0x3) | unit << 2) << LETTER_SPACING_SHIFT);
style->uncommon->letter_spacing = length;
@@ -126,7 +136,7 @@ static inline css_error set_outline_color(
#define OUTLINE_WIDTH_SHIFT 1
#define OUTLINE_WIDTH_MASK 0xfe
static inline css_error set_outline_width(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits;
@@ -153,7 +163,7 @@ static inline css_error set_outline_width(
#define BORDER_SPACING_INDEX1 2
#define BORDER_SPACING_SHIFT1 0
static inline css_error set_border_spacing(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed hlength, css_unit hunit,
css_fixed vlength, css_unit vunit)
{
@@ -164,7 +174,7 @@ static inline css_error set_border_spacing(
bits = &style->uncommon->bits[BORDER_SPACING_INDEX];
/* 1 bit: type */
- *bits = (*bits & ~BORDER_SPACING_MASK) |
+ *bits = (*bits & ~BORDER_SPACING_MASK) |
((type & 0x1) << BORDER_SPACING_SHIFT);
bits = &style->uncommon->bits[BORDER_SPACING_INDEX1];
@@ -188,7 +198,7 @@ static inline css_error set_border_spacing(
#define WORD_SPACING_SHIFT 2
#define WORD_SPACING_MASK 0xfc
static inline css_error set_word_spacing(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits;
@@ -200,7 +210,7 @@ static inline css_error set_word_spacing(
/* 6bits: uuuutt : unit | type */
*bits = (*bits & ~WORD_SPACING_MASK) |
(((type & 0x3) | (unit << 2)) << WORD_SPACING_SHIFT);
-
+
style->uncommon->word_spacing = length;
return CSS_OK;
@@ -235,7 +245,7 @@ static inline css_error set_writing_mode(
#define COUNTER_INCREMENT_SHIFT 1
#define COUNTER_INCREMENT_MASK 0x2
static inline css_error set_counter_increment(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_computed_counter *counters)
{
uint8_t *bits;
@@ -275,7 +285,7 @@ static inline css_error set_counter_increment(
#define COUNTER_RESET_SHIFT 0
#define COUNTER_RESET_MASK 0x1
static inline css_error set_counter_reset(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_computed_counter *counters)
{
uint8_t *bits;
@@ -315,7 +325,7 @@ static inline css_error set_counter_reset(
#define CURSOR_SHIFT 3
#define CURSOR_MASK 0xf8
static inline css_error set_cursor(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
lwc_string **urls)
{
uint8_t *bits;
@@ -359,7 +369,7 @@ static inline css_error set_cursor(
#define CLIP_INDEX2 6
#define CLIP_SHIFT2 0
static inline css_error set_clip(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_computed_clip_rect *rect)
{
uint8_t *bits;
@@ -369,7 +379,7 @@ static inline css_error set_clip(
bits = &style->uncommon->bits[CLIP_INDEX];
/* 6bits: trblyy : top | right | bottom | left | type */
- *bits = (*bits & ~CLIP_MASK) |
+ *bits = (*bits & ~CLIP_MASK) |
((type & 0x3) << CLIP_SHIFT);
if (type == CSS_CLIP_RECT) {
@@ -404,6 +414,196 @@ static inline css_error set_clip(
#undef CLIP_SHIFT
#undef CLIP_INDEX
+#define COLUMN_COUNT_INDEX 8
+#define COLUMN_COUNT_SHIFT 6
+#define COLUMN_COUNT_MASK 0xc0
+static inline css_error set_column_count(
+ css_computed_style *style, uint8_t type, int32_t count)
+{
+ uint8_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->uncommon->bits[COLUMN_COUNT_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~COLUMN_COUNT_MASK) |
+ ((type & 0x3) << COLUMN_COUNT_SHIFT);
+
+ style->uncommon->column_count = count;
+
+ return CSS_OK;
+}
+#undef COLUMN_COUNT_MASK
+#undef COLUMN_COUNT_SHIFT
+#undef COLUMN_COUNT_INDEX
+
+#define COLUMN_FILL_INDEX 8
+#define COLUMN_FILL_SHIFT 4
+#define COLUMN_FILL_MASK 0x30
+static inline css_error set_column_fill(
+ css_computed_style *style, uint8_t type)
+{
+ uint8_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->uncommon->bits[COLUMN_FILL_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~COLUMN_FILL_MASK) |
+ ((type & 0x3) << COLUMN_FILL_SHIFT);
+
+ return CSS_OK;
+}
+#undef COLUMN_FILL_MASK
+#undef COLUMN_FILL_SHIFT
+#undef COLUMN_FILL_INDEX
+
+#define COLUMN_GAP_INDEX 9
+#define COLUMN_GAP_SHIFT 2
+#define COLUMN_GAP_MASK 0xfc
+static inline css_error set_column_gap(
+ css_computed_style *style, uint8_t type,
+ css_fixed length, css_unit unit)
+{
+ uint8_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->uncommon->bits[COLUMN_GAP_INDEX];
+
+ /* 6bits: uuuutt : units | type */
+ *bits = (*bits & ~COLUMN_GAP_MASK) |
+ (((type & 0x3) | (unit << 2)) << COLUMN_GAP_SHIFT);
+
+ style->uncommon->column_gap = length;
+
+ return CSS_OK;
+}
+#undef COLUMN_GAP_MASK
+#undef COLUMN_GAP_SHIFT
+#undef COLUMN_GAP_INDEX
+
+#define COLUMN_RULE_COLOR_INDEX 9
+#define COLUMN_RULE_COLOR_SHIFT 0
+#define COLUMN_RULE_COLOR_MASK 0x3
+static inline css_error set_column_rule_color(
+ css_computed_style *style, uint8_t type,
+ css_color color)
+{
+ uint8_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->uncommon->bits[COLUMN_RULE_COLOR_INDEX];
+
+ /* 2bits: type */
+ *bits = (*bits & ~COLUMN_RULE_COLOR_MASK) |
+ ((type & 0x3) << COLUMN_RULE_COLOR_SHIFT);
+
+ style->uncommon->column_rule_color = color;
+
+ return CSS_OK;
+}
+#undef COLUMN_RULE_COLOR_MASK
+#undef COLUMN_RULE_COLOR_SHIFT
+#undef COLUMN_RULE_COLOR_INDEX
+
+#define COLUMN_RULE_STYLE_INDEX 8
+#define COLUMN_RULE_STYLE_SHIFT 0
+#define COLUMN_RULE_STYLE_MASK 0xf
+static inline css_error set_column_rule_style(
+ css_computed_style *style, uint8_t type)
+{
+ uint8_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->uncommon->bits[COLUMN_RULE_STYLE_INDEX];
+
+ /* 4bits: type */
+ *bits = (*bits & ~COLUMN_RULE_STYLE_MASK) |
+ ((type & 0xf) << COLUMN_RULE_STYLE_SHIFT);
+
+ return CSS_OK;
+}
+#undef COLUMN_RULE_STYLE_MASK
+#undef COLUMN_RULE_STYLE_SHIFT
+#undef COLUMN_RULE_STYLE_INDEX
+
+#define COLUMN_RULE_WIDTH_INDEX 10
+#define COLUMN_RULE_WIDTH_SHIFT 1
+#define COLUMN_RULE_WIDTH_MASK 0xfe
+static inline css_error set_column_rule_width(
+ css_computed_style *style, uint8_t type,
+ css_fixed length, css_unit unit)
+{
+ uint8_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->uncommon->bits[COLUMN_RULE_WIDTH_INDEX];
+
+ /* 7bits: uuuuttt : units | type */
+ *bits = (*bits & ~COLUMN_RULE_WIDTH_MASK) |
+ (((type & 0x7) | (unit << 3)) << COLUMN_RULE_WIDTH_SHIFT);
+
+ style->uncommon->column_rule_width = length;
+
+ return CSS_OK;
+}
+#undef COLUMN_RULE_WIDTH_MASK
+#undef COLUMN_RULE_WIDTH_SHIFT
+#undef COLUMN_RULE_WIDTH_INDEX
+
+#define COLUMN_SPAN_INDEX 11
+#define COLUMN_SPAN_SHIFT 6
+#define COLUMN_SPAN_MASK 0xc0
+static inline css_error set_column_span(
+ css_computed_style *style, uint8_t type)
+{
+ uint8_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->uncommon->bits[COLUMN_SPAN_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~COLUMN_SPAN_MASK) |
+ ((type & 0x3) << COLUMN_SPAN_SHIFT);
+
+ return CSS_OK;
+}
+#undef COLUMN_SPAN_MASK
+#undef COLUMN_SPAN_SHIFT
+#undef COLUMN_SPAN_INDEX
+
+#define COLUMN_WIDTH_INDEX 11
+#define COLUMN_WIDTH_SHIFT 0
+#define COLUMN_WIDTH_MASK 0x3f
+static inline css_error set_column_width(
+ css_computed_style *style, uint8_t type,
+ css_fixed length, css_unit unit)
+{
+ uint8_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->uncommon->bits[COLUMN_WIDTH_INDEX];
+
+ /* 6bits: uuuutt : units | type */
+ *bits = (*bits & ~COLUMN_WIDTH_MASK) |
+ (((type & 0x3) | (unit << 2)) << COLUMN_WIDTH_SHIFT);
+
+ style->uncommon->column_width = length;
+
+ return CSS_OK;
+}
+#undef COLUMN_WIDTH_MASK
+#undef COLUMN_WIDTH_SHIFT
+#undef COLUMN_WIDTH_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3
@@ -424,7 +624,7 @@ static inline css_error set_content(
*bits = (*bits & ~CONTENT_MASK) |
((type & 0x3) << CONTENT_SHIFT);
- for (c = content; c != NULL &&
+ for (c = content; c != NULL &&
c->type != CSS_COMPUTED_CONTENT_NONE; c++) {
switch (c->type) {
case CSS_COMPUTED_CONTENT_STRING:
@@ -441,9 +641,9 @@ static inline css_error set_content(
lwc_string_ref(c->data.counter.name);
break;
case CSS_COMPUTED_CONTENT_COUNTERS:
- c->data.counters.name =
+ c->data.counters.name =
lwc_string_ref(c->data.counters.name);
- c->data.counters.sep =
+ c->data.counters.sep =
lwc_string_ref(c->data.counters.sep);
break;
default:
@@ -455,7 +655,7 @@ static inline css_error set_content(
/* Free existing array */
if (oldcontent != NULL) {
- for (c = oldcontent;
+ for (c = oldcontent;
c->type != CSS_COMPUTED_CONTENT_NONE; c++) {
switch (c->type) {
case CSS_COMPUTED_CONTENT_STRING:
@@ -493,7 +693,7 @@ static inline css_error set_content(
#define VERTICAL_ALIGN_INDEX 0
#define VERTICAL_ALIGN_SHIFT 0
static inline css_error set_vertical_align(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[VERTICAL_ALIGN_INDEX];
@@ -511,7 +711,7 @@ static inline css_error set_vertical_align(
#define FONT_SIZE_INDEX 1
#define FONT_SIZE_SHIFT 0
static inline css_error set_font_size(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[FONT_SIZE_INDEX];
@@ -530,7 +730,7 @@ static inline css_error set_font_size(
#define BORDER_TOP_WIDTH_SHIFT 1
#define BORDER_TOP_WIDTH_MASK 0xfe
static inline css_error set_border_top_width(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[BORDER_TOP_WIDTH_INDEX];
@@ -551,7 +751,7 @@ static inline css_error set_border_top_width(
#define BORDER_RIGHT_WIDTH_SHIFT 1
#define BORDER_RIGHT_WIDTH_MASK 0xfe
static inline css_error set_border_right_width(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[BORDER_RIGHT_WIDTH_INDEX];
@@ -572,7 +772,7 @@ static inline css_error set_border_right_width(
#define BORDER_BOTTOM_WIDTH_SHIFT 1
#define BORDER_BOTTOM_WIDTH_MASK 0xfe
static inline css_error set_border_bottom_width(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[BORDER_BOTTOM_WIDTH_INDEX];
@@ -593,7 +793,7 @@ static inline css_error set_border_bottom_width(
#define BORDER_LEFT_WIDTH_SHIFT 1
#define BORDER_LEFT_WIDTH_MASK 0xfe
static inline css_error set_border_left_width(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[BORDER_LEFT_WIDTH_INDEX];
@@ -614,7 +814,7 @@ static inline css_error set_border_left_width(
#define BACKGROUND_IMAGE_SHIFT 0
#define BACKGROUND_IMAGE_MASK 0x1
static inline css_error set_background_image(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
lwc_string *url)
{
uint8_t *bits = &style->bits[BACKGROUND_IMAGE_INDEX];
@@ -643,7 +843,7 @@ static inline css_error set_background_image(
#define COLOR_SHIFT 0
#define COLOR_MASK 0x1
static inline css_error set_color(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_color color)
{
uint8_t *bits = &style->bits[COLOR_INDEX];
@@ -664,7 +864,7 @@ static inline css_error set_color(
#define LIST_STYLE_IMAGE_SHIFT 0
#define LIST_STYLE_IMAGE_MASK 0x1
static inline css_error set_list_style_image(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
lwc_string *url)
{
uint8_t *bits = &style->bits[LIST_STYLE_IMAGE_INDEX];
@@ -693,7 +893,7 @@ static inline css_error set_list_style_image(
#define QUOTES_SHIFT 0
#define QUOTES_MASK 0x1
static inline css_error set_quotes(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
lwc_string **quotes)
{
uint8_t *bits = &style->bits[QUOTES_INDEX];
@@ -728,7 +928,7 @@ static inline css_error set_quotes(
#define TOP_SHIFT 2
#define TOP_MASK 0xfc
static inline css_error set_top(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[TOP_INDEX];
@@ -749,7 +949,7 @@ static inline css_error set_top(
#define RIGHT_SHIFT 2
#define RIGHT_MASK 0xfc
static inline css_error set_right(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[RIGHT_INDEX];
@@ -770,7 +970,7 @@ static inline css_error set_right(
#define BOTTOM_SHIFT 2
#define BOTTOM_MASK 0xfc
static inline css_error set_bottom(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[BOTTOM_INDEX];
@@ -791,7 +991,7 @@ static inline css_error set_bottom(
#define LEFT_SHIFT 2
#define LEFT_MASK 0xfc
static inline css_error set_left(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[LEFT_INDEX];
@@ -812,7 +1012,7 @@ static inline css_error set_left(
#define BORDER_TOP_COLOR_SHIFT 0
#define BORDER_TOP_COLOR_MASK 0x3
static inline css_error set_border_top_color(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_color color)
{
uint8_t *bits = &style->bits[BORDER_TOP_COLOR_INDEX];
@@ -833,7 +1033,7 @@ static inline css_error set_border_top_color(
#define BORDER_RIGHT_COLOR_SHIFT 0
#define BORDER_RIGHT_COLOR_MASK 0x3
static inline css_error set_border_right_color(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_color color)
{
uint8_t *bits = &style->bits[BORDER_RIGHT_COLOR_INDEX];
@@ -854,7 +1054,7 @@ static inline css_error set_border_right_color(
#define BORDER_BOTTOM_COLOR_SHIFT 0
#define BORDER_BOTTOM_COLOR_MASK 0x3
static inline css_error set_border_bottom_color(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_color color)
{
uint8_t *bits = &style->bits[BORDER_BOTTOM_COLOR_INDEX];
@@ -875,7 +1075,7 @@ static inline css_error set_border_bottom_color(
#define BORDER_LEFT_COLOR_SHIFT 0
#define BORDER_LEFT_COLOR_MASK 0x3
static inline css_error set_border_left_color(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_color color)
{
uint8_t *bits = &style->bits[BORDER_LEFT_COLOR_INDEX];
@@ -896,7 +1096,7 @@ static inline css_error set_border_left_color(
#define HEIGHT_SHIFT 2
#define HEIGHT_MASK 0xfc
static inline css_error set_height(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[HEIGHT_INDEX];
@@ -917,7 +1117,7 @@ static inline css_error set_height(
#define LINE_HEIGHT_SHIFT 2
#define LINE_HEIGHT_MASK 0xfc
static inline css_error set_line_height(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[LINE_HEIGHT_INDEX];
@@ -938,7 +1138,7 @@ static inline css_error set_line_height(
#define BACKGROUND_COLOR_SHIFT 0
#define BACKGROUND_COLOR_MASK 0x3
static inline css_error set_background_color(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_color color)
{
uint8_t *bits = &style->bits[BACKGROUND_COLOR_INDEX];
@@ -959,7 +1159,7 @@ static inline css_error set_background_color(
#define Z_INDEX_SHIFT 0
#define Z_INDEX_MASK 0x3
static inline css_error set_z_index(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
int32_t z_index)
{
uint8_t *bits = &style->bits[Z_INDEX_INDEX];
@@ -980,7 +1180,7 @@ static inline css_error set_z_index(
#define MARGIN_TOP_SHIFT 2
#define MARGIN_TOP_MASK 0xfc
static inline css_error set_margin_top(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[MARGIN_TOP_INDEX];
@@ -1001,7 +1201,7 @@ static inline css_error set_margin_top(
#define MARGIN_RIGHT_SHIFT 2
#define MARGIN_RIGHT_MASK 0xfc
static inline css_error set_margin_right(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[MARGIN_RIGHT_INDEX];
@@ -1022,7 +1222,7 @@ static inline css_error set_margin_right(
#define MARGIN_BOTTOM_SHIFT 2
#define MARGIN_BOTTOM_MASK 0xfc
static inline css_error set_margin_bottom(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[MARGIN_BOTTOM_INDEX];
@@ -1043,7 +1243,7 @@ static inline css_error set_margin_bottom(
#define MARGIN_LEFT_SHIFT 2
#define MARGIN_LEFT_MASK 0xfc
static inline css_error set_margin_left(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[MARGIN_LEFT_INDEX];
@@ -1136,7 +1336,7 @@ static inline css_error set_direction(
#define MAX_HEIGHT_SHIFT 2
#define MAX_HEIGHT_MASK 0xfc
static inline css_error set_max_height(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[MAX_HEIGHT_INDEX];
@@ -1157,7 +1357,7 @@ static inline css_error set_max_height(
#define MAX_WIDTH_SHIFT 2
#define MAX_WIDTH_MASK 0xfc
static inline css_error set_max_width(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[MAX_WIDTH_INDEX];
@@ -1178,7 +1378,7 @@ static inline css_error set_max_width(
#define WIDTH_SHIFT 2
#define WIDTH_MASK 0xfc
static inline css_error set_width(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[WIDTH_INDEX];
@@ -1253,7 +1453,7 @@ static inline css_error set_font_style(
#define MIN_HEIGHT_SHIFT 3
#define MIN_HEIGHT_MASK 0xf8
static inline css_error set_min_height(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[MIN_HEIGHT_INDEX];
@@ -1274,7 +1474,7 @@ static inline css_error set_min_height(
#define MIN_WIDTH_SHIFT 3
#define MIN_WIDTH_MASK 0xf8
static inline css_error set_min_width(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[MIN_WIDTH_INDEX];
@@ -1331,7 +1531,7 @@ static inline css_error set_clear(
#define PADDING_TOP_SHIFT 3
#define PADDING_TOP_MASK 0xf8
static inline css_error set_padding_top(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[PADDING_TOP_INDEX];
@@ -1352,7 +1552,7 @@ static inline css_error set_padding_top(
#define PADDING_RIGHT_SHIFT 3
#define PADDING_RIGHT_MASK 0xf8
static inline css_error set_padding_right(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[PADDING_RIGHT_INDEX];
@@ -1373,7 +1573,7 @@ static inline css_error set_padding_right(
#define PADDING_BOTTOM_SHIFT 3
#define PADDING_BOTTOM_MASK 0xf8
static inline css_error set_padding_bottom(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[PADDING_BOTTOM_INDEX];
@@ -1394,7 +1594,7 @@ static inline css_error set_padding_bottom(
#define PADDING_LEFT_SHIFT 3
#define PADDING_LEFT_MASK 0xf8
static inline css_error set_padding_left(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[PADDING_LEFT_INDEX];
@@ -1469,7 +1669,7 @@ static inline css_error set_position(
#define OPACITY_SHIFT 2
#define OPACITY_MASK 0x04
static inline css_error set_opacity(
- css_computed_style *style,
+ css_computed_style *style,
uint8_t type, css_fixed opacity)
{
uint8_t *bits = &style->bits[OPACITY_INDEX];
@@ -1508,7 +1708,7 @@ static inline css_error set_text_transform(
#define TEXT_INDENT_SHIFT 3
#define TEXT_INDENT_MASK 0xf8
static inline css_error set_text_indent(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
{
uint8_t *bits = &style->bits[TEXT_INDENT_INDEX];
@@ -1549,7 +1749,7 @@ static inline css_error set_white_space(
#define BACKGROUND_POSITION_INDEX1 26
#define BACKGROUND_POSITION_SHIFT1 0
static inline css_error set_background_position(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
css_fixed hlength, css_unit hunit,
css_fixed vlength, css_unit vunit)
{
@@ -1558,7 +1758,7 @@ static inline css_error set_background_position(
bits = &style->bits[BACKGROUND_POSITION_INDEX];
/* 1 bit: type */
- *bits = (*bits & ~BACKGROUND_POSITION_MASK) |
+ *bits = (*bits & ~BACKGROUND_POSITION_MASK) |
((type & 0x1) << BACKGROUND_POSITION_SHIFT);
bits = &style->bits[BACKGROUND_POSITION_INDEX1];
@@ -1635,7 +1835,7 @@ static inline css_error set_text_decoration(
#define FONT_FAMILY_SHIFT 0
#define FONT_FAMILY_MASK 0x7
static inline css_error set_font_family(
- css_computed_style *style, uint8_t type,
+ css_computed_style *style, uint8_t type,
lwc_string **names)
{
uint8_t *bits = &style->bits[FONT_FAMILY_INDEX];
@@ -1923,9 +2123,9 @@ static inline css_error set_page_break_before(
return CSS_OK;
}
}
-
+
ENSURE_PAGE;
-
+
bits = &style->page->bits[PAGE_BREAK_BEFORE_INDEX];
/* 3bits: type */
@@ -1951,7 +2151,7 @@ static inline css_error set_page_break_inside(
return CSS_OK;
}
}
-
+
ENSURE_PAGE;
bits = &style->page->bits[PAGE_BREAK_INSIDE_INDEX];
@@ -1973,7 +2173,7 @@ static inline css_error set_orphans(
css_computed_style *style, uint8_t type, int32_t count)
{
uint8_t *bits;
-
+
if (style->page == NULL) {
if (type == CSS_ORPHANS_SET && count == 2) {
return CSS_OK;
@@ -1981,14 +2181,14 @@ static inline css_error set_orphans(
}
ENSURE_PAGE;
-
+
bits = &style->page->bits[ORPHANS_INDEX];
-
+
/* 1bit: type */
*bits = (*bits & ~ORPHANS_MASK) | ((type & 0x1) << ORPHANS_SHIFT);
-
+
style->page->orphans = count;
-
+
return CSS_OK;
}
#undef ORPHANS_INDEX
@@ -2002,22 +2202,22 @@ static inline css_error set_widows(
css_computed_style *style, uint8_t type, int32_t count)
{
uint8_t *bits;
-
+
if (style->page == NULL) {
if (type == CSS_WIDOWS_SET && count == 2) {
return CSS_OK;
}
}
-
+
ENSURE_PAGE;
-
+
bits = &style->page->bits[WIDOWS_INDEX];
-
+
/* 1bit: type */
*bits = (*bits & ~WIDOWS_MASK) | ((type & 0x1) << WIDOWS_SHIFT);
-
+
style->page->widows = count;
-
+
return CSS_OK;
}
#undef WIDOWS_INDEX
diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat
index 96e57bf..c04f063 100644
--- a/test/data/select/tests1.dat
+++ b/test/data/select/tests1.dat
@@ -37,6 +37,14 @@ caption-side: inherit
clear: none
clip: auto
color: #ffff0000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -134,6 +142,14 @@ caption-side: inherit
clear: none
clip: auto
color: #ffff0000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -231,6 +247,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -328,6 +352,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -417,6 +449,14 @@ caption-side: top
clear: none
clip: auto
color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -504,6 +544,14 @@ caption-side: top
clear: none
clip: auto
color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -592,6 +640,14 @@ caption-side: top
clear: none
clip: auto
color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -680,6 +736,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -767,6 +831,14 @@ caption-side: top
clear: none
clip: auto
color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -859,6 +931,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -951,6 +1031,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1044,6 +1132,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1140,6 +1236,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1235,6 +1339,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1336,6 +1448,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1437,6 +1557,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1538,6 +1666,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1643,6 +1779,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1747,6 +1891,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1849,6 +2001,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -1950,6 +2110,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2051,6 +2219,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2152,6 +2328,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2253,6 +2437,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2354,6 +2546,14 @@ caption-side: inherit
clear: inherit
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2455,6 +2655,14 @@ caption-side: inherit
clear: left
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2556,6 +2764,14 @@ caption-side: inherit
clear: both
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2657,6 +2873,14 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2758,6 +2982,14 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2859,6 +3091,14 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -2960,6 +3200,14 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3061,6 +3309,14 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3162,6 +3418,14 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3263,6 +3527,14 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3364,6 +3636,14 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3465,6 +3745,14 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3566,6 +3854,14 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3667,6 +3963,14 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3768,6 +4072,14 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3869,6 +4181,14 @@ caption-side: inherit
clear: right
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -3963,6 +4283,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: currentColor
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -4057,6 +4385,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -4151,6 +4487,14 @@ caption-side: inherit
clear: none
clip: auto
color: inherit
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: inherit
+column-rule-style: none
+column-rule-width: medium
+column-span: none
+column-width: auto
content: normal
counter-increment: none
counter-reset: none
@@ -4207,3 +4551,103 @@ word-spacing: inherit
writing-mode: vertical-lr
z-index: auto
#reset
+
+#tree
+| div
+| p*
+#ua
+p{display: block;}
+#user
+#author
+p{column-count: 2; column-rule-color: #bbc; column-rule-style: solid; column-rule-width: 2px; column-span: all; column-width: 6em;}
+#errors
+#expected
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: inherit
+border-spacing: inherit
+border-top-color: currentColor
+border-right-color: currentColor
+border-bottom-color: currentColor
+border-left-color: currentColor
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: medium
+border-right-width: medium
+border-bottom-width: medium
+border-left-width: medium
+bottom: auto
+caption-side: inherit
+clear: none
+clip: auto
+color: inherit
+column-count: 2048
+column-fill: balance
+column-gap: normal
+column-rule-color: #ffbbbbcc
+column-rule-style: solid
+column-rule-width: 2px
+column-span: all
+column-width: 6em
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: inherit
+direction: inherit
+display: block
+empty-cells: inherit
+float: none
+font-family: inherit
+font-size: inherit
+font-style: inherit
+font-variant: inherit
+font-weight: inherit
+height: auto
+left: auto
+letter-spacing: inherit
+line-height: inherit
+list-style-image: inherit
+list-style-position: inherit
+list-style-type: inherit
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+outline-color: invert
+outline-style: none
+outline-width: medium
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: inherit
+right: auto
+table-layout: auto
+text-align: inherit
+text-decoration: none
+text-indent: inherit
+text-transform: inherit
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: inherit
+white-space: inherit
+width: auto
+word-spacing: inherit
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
diff --git a/test/dump_computed.h b/test/dump_computed.h
index 5f83767..a4c0b89 100644
--- a/test/dump_computed.h
+++ b/test/dump_computed.h
@@ -151,7 +151,7 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
const css_computed_content_item *content = NULL;
const css_computed_counter *counter = NULL;
lwc_string **string_list = NULL;
- int32_t zindex = 0;
+ int32_t integer = 0;
/* background-attachment */
val = css_computed_background_attachment(style);
@@ -824,6 +824,210 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
ptr += wrote;
*len -= wrote;
+ /* column-count */
+ val = css_computed_column_count(style, &integer);
+ switch (val) {
+ case CSS_COLUMN_COUNT_INHERIT:
+ wrote = snprintf(ptr, *len, "column-count: inherit\n");
+ break;
+ case CSS_COLUMN_COUNT_AUTO:
+ wrote = snprintf(ptr, *len, "column-count: auto\n");
+ break;
+ case CSS_COLUMN_COUNT_SET:
+ wrote = snprintf(ptr, *len, "column-count: %d\n", integer);
+ break;
+ default:
+ wrote = 0;
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
+ /* column-fill */
+ val = css_computed_column_fill(style);
+ switch (val) {
+ case CSS_COLUMN_FILL_INHERIT:
+ wrote = snprintf(ptr, *len, "column-fill: inherit\n");
+ break;
+ case CSS_COLUMN_FILL_AUTO:
+ wrote = snprintf(ptr, *len, "column-fill: auto\n");
+ break;
+ case CSS_COLUMN_FILL_BALANCE:
+ wrote = snprintf(ptr, *len, "column-fill: balance\n");
+ break;
+ default:
+ wrote = 0;
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
+ /* column-gap */
+ val = css_computed_column_gap(style, &len1, &unit1);
+ switch (val) {
+ case CSS_COLUMN_GAP_INHERIT:
+ wrote = snprintf(ptr, *len, "column-gap: inherit\n");
+ break;
+ case CSS_COLUMN_GAP_NORMAL:
+ wrote = snprintf(ptr, *len, "column-gap: normal\n");
+ break;
+ case CSS_COLUMN_GAP_SET:
+ wrote = snprintf(ptr, *len, "column-gap: ");
+ ptr += wrote;
+ *len -= wrote;
+
+ wrote = dump_css_unit(len1, unit1, ptr, *len);
+ ptr += wrote;
+ *len -= wrote;
+
+ wrote = snprintf(ptr, *len, "\n");
+ break;
+ default:
+ wrote = 0;
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
+ /* column-rule-color */
+ val = css_computed_column_rule_color(style, &color);
+ switch (val) {
+ case CSS_COLUMN_RULE_COLOR_INHERIT:
+ wrote = snprintf(ptr, *len, "column-rule-color: inherit\n");
+ break;
+ case CSS_COLUMN_RULE_COLOR_CURRENT_COLOR:
+ wrote = snprintf(ptr, *len, "column-rule-color: currentColor\n");
+ break;
+ case CSS_COLUMN_RULE_COLOR_COLOR:
+ wrote = snprintf(ptr, *len, "column-rule-color: #%08x\n",
+ color);
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
+ /* column-rule-style */
+ val = css_computed_column_rule_style(style);
+ switch (val) {
+ case CSS_COLUMN_RULE_STYLE_INHERIT:
+ wrote = snprintf(ptr, *len, "column-rule-style: inherit\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_NONE:
+ wrote = snprintf(ptr, *len, "column-rule-style: none\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_HIDDEN:
+ wrote = snprintf(ptr, *len, "column-rule-style: hidden\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_DOTTED:
+ wrote = snprintf(ptr, *len, "column-rule-style: dotted\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_DASHED:
+ wrote = snprintf(ptr, *len, "column-rule-style: dashed\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_SOLID:
+ wrote = snprintf(ptr, *len, "column-rule-style: solid\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_DOUBLE:
+ wrote = snprintf(ptr, *len, "column-rule-style: double\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_GROOVE:
+ wrote = snprintf(ptr, *len, "column-rule-style: groove\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_RIDGE:
+ wrote = snprintf(ptr, *len, "column-rule-style: ridge\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_INSET:
+ wrote = snprintf(ptr, *len, "column-rule-style: inset\n");
+ break;
+ case CSS_COLUMN_RULE_STYLE_OUTSET:
+ wrote = snprintf(ptr, *len, "column-rule-style: outset\n");
+ break;
+ default:
+ wrote = 0;
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
+ /* column-rule-width */
+ val = css_computed_column_rule_width(style, &len1, &unit1);
+ switch (val) {
+ case CSS_COLUMN_RULE_WIDTH_INHERIT:
+ wrote = snprintf(ptr, *len, "column-rule-width: inherit\n");
+ break;
+ case CSS_COLUMN_RULE_WIDTH_THIN:
+ wrote = snprintf(ptr, *len, "column-rule-width: thin\n");
+ break;
+ case CSS_COLUMN_RULE_WIDTH_MEDIUM:
+ wrote = snprintf(ptr, *len, "column-rule-width: medium\n");
+ break;
+ case CSS_COLUMN_RULE_WIDTH_THICK:
+ wrote = snprintf(ptr, *len, "column-rule-width: thick\n");
+ break;
+ case CSS_COLUMN_RULE_WIDTH_WIDTH:
+ wrote = snprintf(ptr, *len, "column-rule-width: ");
+ ptr += wrote;
+ *len -= wrote;
+
+ wrote = dump_css_unit(len1, unit1, ptr, *len);
+ ptr += wrote;
+ *len -= wrote;
+
+ wrote = snprintf(ptr, *len, "\n");
+ break;
+ default:
+ wrote = 0;
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
+ /* column-span */
+ val = css_computed_column_span(style);
+ switch (val) {
+ case CSS_COLUMN_SPAN_INHERIT:
+ wrote = snprintf(ptr, *len, "column-span: inherit\n");
+ break;
+ case CSS_COLUMN_SPAN_NONE:
+ wrote = snprintf(ptr, *len, "column-span: none\n");
+ break;
+ case CSS_COLUMN_SPAN_ALL:
+ wrote = snprintf(ptr, *len, "column-span: all\n");
+ break;
+ default:
+ wrote = 0;
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
+ /* column-width */
+ val = css_computed_column_width(style, &len1, &unit1);
+ switch (val) {
+ case CSS_COLUMN_WIDTH_INHERIT:
+ wrote = snprintf(ptr, *len, "column-width: inherit\n");
+ break;
+ case CSS_COLUMN_WIDTH_AUTO:
+ wrote = snprintf(ptr, *len, "column-width: auto\n");
+ break;
+ case CSS_COLUMN_WIDTH_SET:
+ wrote = snprintf(ptr, *len, "column-width: ");
+ ptr += wrote;
+ *len -= wrote;
+
+ wrote = dump_css_unit(len1, unit1, ptr, *len);
+ ptr += wrote;
+ *len -= wrote;
+
+ wrote = snprintf(ptr, *len, "\n");
+ break;
+ default:
+ wrote = 0;
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
/* content */
val = css_computed_content(style, &content);
switch (val) {
@@ -2520,7 +2724,7 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
*len -= wrote;
/* z-index */
- val = css_computed_z_index(style, &zindex);
+ val = css_computed_z_index(style, &integer);
switch (val) {
case CSS_Z_INDEX_INHERIT:
wrote = snprintf(ptr, *len, "z-index: inherit\n");
@@ -2529,7 +2733,7 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
wrote = snprintf(ptr, *len, "z-index: auto\n");
break;
case CSS_Z_INDEX_SET:
- wrote = snprintf(ptr, *len, "z-index: %d\n", zindex);
+ wrote = snprintf(ptr, *len, "z-index: %d\n", integer);
break;
default:
wrote = 0;
diff --git a/test/select-common.c b/test/select-common.c
index 783790a..fef53ea 100644
--- a/test/select-common.c
+++ b/test/select-common.c
@@ -721,6 +721,41 @@ void css__parse_expected(line_ctx *ctx, const char *data, size_t len)
ctx->expused += len;
}
+static void show_differences(size_t len, const char *exp, const char *res)
+{
+ const char *pos_exp, *opos_exp;
+ const char *pos_res, *opos_res;
+
+ opos_exp = pos_exp = exp;
+ opos_res = pos_res = res;
+
+ printf("Line differences:\n");
+ while (pos_exp < exp + len && pos_res < res + len) {
+ if (*pos_exp == '\n' && *pos_res == '\n') {
+ if (pos_exp - opos_exp != pos_res - opos_res ||
+ memcmp(opos_exp, opos_res,
+ pos_exp - opos_exp) != 0) {
+ printf("Expected:\t%.*s\n",
+ (int)(pos_exp - opos_exp),
+ opos_exp);
+ printf(" Result:\t%.*s\n",
+ (int)(pos_res - opos_res),
+ opos_res);
+ printf("\n");
+ }
+ opos_exp = ++pos_exp;
+ opos_res = ++pos_res;
+ } else if (*pos_exp == '\n') {
+ pos_res++;
+ } else if (*pos_res == '\n') {
+ pos_exp++;
+ } else {
+ pos_exp++;
+ pos_res++;
+ }
+ }
+}
+
void run_test(line_ctx *ctx, const char *exp, size_t explen)
{
css_select_ctx *select;
@@ -756,10 +791,13 @@ void run_test(line_ctx *ctx, const char *exp, size_t explen)
dump_computed_style(results->styles[ctx->pseudo_element], buf, &buflen);
if (8192 - buflen != explen || memcmp(buf, exp, explen) != 0) {
+ size_t len = 8192 - buflen < explen ? 8192 - buflen : explen;
printf("Expected (%u):\n%.*s\n",
(int) explen, (int) explen, exp);
printf("Result (%u):\n%.*s\n", (int) (8192 - buflen),
(int) (8192 - buflen), buf);
+
+ show_differences(len, exp, buf);
assert(0 && "Result doesn't match expected");
}
--
Cascading Style Sheets library
8 years, 6 months
netsurf: branch master updated. release/3.2-527-g3b10dbe
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/3b10dbe793c7413769e6e...
...commit http://git.netsurf-browser.org/netsurf.git/commit/3b10dbe793c7413769e6e59...
...tree http://git.netsurf-browser.org/netsurf.git/tree/3b10dbe793c7413769e6e5912...
The branch, master has been updated
via 3b10dbe793c7413769e6e5912e43161bb9762a06 (commit)
via 45f98ffd6e6230189a06a042b981592cdae613be (commit)
from 0166083584ba8c909ff3518661648334ad9f53cf (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=3b10dbe793c7413769e...
commit 3b10dbe793c7413769e6e5912e43161bb9762a06
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Document the core browser options and clarify Choices location for fb
diff --git a/Docs/Options b/Docs/Options
new file mode 100644
index 0000000..89b8814
--- /dev/null
+++ b/Docs/Options
@@ -0,0 +1,241 @@
+--------------------------------------------------------------------------------
+ Common NetSurf user options 4nd December 2014
+--------------------------------------------------------------------------------
+
+ This document outlines the common configuration options supported by the
+ NetSurf core.
+
+Overview
+========
+
+ The users configurations are generally stored in a "Choices" file
+ and are loaded at browser startup. Most user interfaces provide a
+ way to configure these parameters in a manner consistant with the
+ toolkit in use.
+
+ The user choices are stored as a simple key:value list.
+
+ Each entry has a type, one of: boolean, integer, unsigned integer,
+ hexadecimal colour value or string.
+
+General Options
+===============
+
++----------------------+--------+-----------+----------------------------------+
+| Option Key | Type | Default | Description |
++----------------------+--------+-----------+----------------------------------+
+| http_proxy | bool | false | An HTTP proxy should be used. |
+| | | | |
+| http_proxy | bool | false | An HTTP proxy should be used. |
+| | | | |
+| http_proxy_host | string | NULL | Hostname of proxy. |
+| | | | |
+| http_proxy_port | int | 8080 | Proxy port. |
+| | | | |
+| http_proxy_auth | int | 0 | Proxy authentication method. |
+| | | | |
+| http_proxy_auth_user | string | NULL | Proxy authentication user name |
+| | | | |
+| http_proxy_auth_pass | string | NULL | Proxy authentication password |
+| | | | |
+| http_proxy_noproxy | string | localhost | Proxy omission list |
+| | | | |
+| font_size | int | 128 | Default font size / 0.1pt. |
+| | | | |
+| font_min_size | int | 85 | Minimum font size. |
+| | | | |
+| font_sans | string | NULL | Default sans serif font |
+| | | | |
+| font_serif | string | NULL | Default serif font |
+| | | | |
+| font_mono | string | NULL | Default monospace font
+| | | | |
+| font_cursive | string | NULL | Default cursive font
+| | | | |
+| font_fantasy | string | NULL | Default fantasy font
+| | | | |
+| accept_language | string | NULL | Accept-Language header.
+| | | | |
+| accept_charset | string | NULL | Accept-Charset header.
+| | | | |
+| memory_cache_size | int | 12MiB | Preferred maximum size of memory |
+| | | | cache in bytes. |
+| | | | |
+| disc_cache_size | uint | 1GiB | Preferred expiry size of disc |
+| | | | cache in bytes. |
+| | | | |
+| disc_cache_age | int | 28 | Preferred expiry age of disc |
+| | | | cache in days. |
+| | | | |
+| block_advertisements | bool | false | Whether to block advertisements
+| | | | |
+| do_not_track | bool | false | Disable website tracking [1]
+| | | | |
+| minimum_gif_delay | int | 10 | Minimum GIF animation delay
+| | | | |
+| send_referer | bool | true | Whether to send the referer HTTP |
+| | | | header. |
+| | | | |
+| foreground_images | bool | true | Whether to fetch foreground images
+| | | | |
+| background_images | bool | true | Whether to fetch background images
+| | | | |
+| animate_images | bool | true | Whether to animate images
+| | | | |
+| enable_javascript | bool | false | Whether to execute javascript
+| | | | |
+| script_timeout | int | 10 | Maximum time to wait for a script|
+| | | | to run in seconds |
+| | | | |
+| expire_url | int | 28 | How many days to retain URL data |
+| | | | for. |
+| | | | |
+| font_default | int | 0 | Default font family
+| | | | |
+| ca_bundle | string | NULL | ca-bundle location
+| | | | |
+| ca_path | string | NULL | ca-path location
+| | | | |
+| cookie_file | string | NULL | Cookie file location
+| | | | |
+| cookie_jar | string | NULL | Cookie jar location
+| | | | |
+| homepage_url | string | NULL | Home page location
+| | | | |
+| search_url_bar | bool | false | search web from url bar
+| | | | |
+| search_provider | int | 0 | default web search provider
+| | | | |
+| url_suggestion | bool | true | URL completion in url bar
+| | | | |
+| window_x | int | 0 | default x position of new windows
+| | | | |
+| window_y | int | 0 | default y position of new windows
+| | | | |
+| window_width | int | 0 | default width of new windows
+| | | | |
+| window_height | int | 0 | default height of new windows
+| | | | |
+| window_screen_width | int | 0 | width of screen when above |
+| | | | options were saved |
+| | | | |
+| window_screen_height | int | 0 | height of screen when above |
+| | | | options were saved |
+| | | | |
+| toolbar_status_size | int | 6667 | default size of status bar vs. |
+| | | | h scroll bar |
+| | | | |
+| scale | int | 100 | default window scale
+| | | | |
+| incremental_reflow | bool | true | Whether to reflow web pages while|
+| | | | objects are fetching |
+| | | | |
+| min_reflow_period | uint | 25 | Minimum time (in cs) between HTML|
+| | | | reflows while objects are fetching
+| | | | |
+| core_select_menu | bool | false | Use core selection menu |
+| | | | |
++----------------------+--------+-----------+----------------------------------+
+
+[1] http://www.w3.org/Submission/2011/SUBM-web-tracking-protection-20110224/#...
+
+Fetcher options
+===============
+
++--------------------------+------+------+-------------------------------------+
+| Option Key | Type | Dflt | Description |
++--------------------------+------+------+-------------------------------------+
+| max_fetchers | int | 24 | Maximum simultaneous active fetchers|
+| | | | |
+| max_fetchers_per_host | int | 5 | Maximum simultaneous active fetchers|
+| | | | per host. (<=option_max_fetchers |
+| | | | else it makes no sense) [2] |
+| | | | |
+| max_cached_fetch_handles | int | 6 | Maximum number of inactive fetchers |
+| | | | cached. The total number of handles|
+| | | | netsurf will therefore have open is|
+| | | | this plus option_max_fetchers. |
+| | | | |
+| suppress_curl_debug | bool | true | Suppress debug output from cURL. |
+| | | | |
+| target_blank | bool | true | Whether to allow target="_blank" |
+| | | | |
+| button_2_tab | bool | true | Whether second mouse button opens in|
+| | | | new tab. |
+| | | | |
++--------------------------+------+------+-------------------------------------+
+
+[2] Note that rfc2616 section 8.1.4 says that there should be no more
+ than two keepalive connections per host. None of the main browsers
+ follow this as it slows page fetches down considerably.
+ See https://bugzilla.mozilla.org/show_bug.cgi?id=423377#c4
+
+
+PDF / Print options
+===================
+
++------------------------+------+-------+--------------------------------------+
+| Option Key | Type | Deflt | Description |
++------------------------+------+-------+--------------------------------------+
+| margin_top | int | 10 | top margin of exported page |
+| | | | |
+| margin_bottom | int | 10 | bottom margin of exported page |
+| | | | |
+| margin_left | int | 10 | left margin of exported page |
+| | | | |
+| margin_right | int | 10 | right margin of exported page |
+| | | | |
+| export_scale | int | 70 | scale of exported content |
+| | | | |
+| suppress_images | bool | false | suppressing images in printed content|
+| | | | |
+| remove_backgrounds | bool | false | turning off all backgrounds for |
+| | | | printed content |
+| | | | |
+| enable_loosening | bool | true | turning on content loosening for |
+| | | | printed content |
+| | | | |
+| enable_PDF_compression | bool | true | compression of PDF documents |
+| | | | |
+| enable_PDF_password | bool | false | setting a password and encoding PDF |
+| | | | documents |
++------------------------+------+-------+--------------------------------------+
+
+System colours
+==============
+
+These are the css system colours which the browser also uses to style
+generated output.
+
++--------------------------------+--------+------------+
+| Option Key | Type | Default |
++--------------------------------+--------+------------+
+| sys_colour_ActiveBorder | colour | 0x00d3d3d3 |
+| sys_colour_ActiveCaption | colour | 0x00f1f1f1 |
+| sys_colour_AppWorkspace | colour | 0x00f1f1f1 |
+| sys_colour_Background | colour | 0x006e6e6e |
+| sys_colour_ButtonFace | colour | 0x00f9f9f9 |
+| sys_colour_ButtonHighlight | colour | 0x00ffffff |
+| sys_colour_ButtonShadow | colour | 0x00aeaeae |
+| sys_colour_ButtonText | colour | 0x004c4c4c |
+| sys_colour_CaptionText | colour | 0x004c4c4c |
+| sys_colour_GrayText | colour | 0x00505050 |
+| sys_colour_Highlight | colour | 0x00c00800 |
+| sys_colour_HighlightText | colour | 0x00ffffff |
+| sys_colour_InactiveBorder | colour | 0x00f1f1f1 |
+| sys_colour_InactiveCaption | colour | 0x00e6e6e6 |
+| sys_colour_InactiveCaptionText | colour | 0x00a6a6a6 |
+| sys_colour_InfoBackground | colour | 0x008fdfef |
+| sys_colour_InfoText | colour | 0x00000000 |
+| sys_colour_Menu | colour | 0x00f1f1f1 |
+| sys_colour_MenuText | colour | 0x004e4e4e |
+| sys_colour_Scrollbar | colour | 0x00cccccc |
+| sys_colour_ThreeDDarkShadow | colour | 0x00aeaeae |
+| sys_colour_ThreeDFace | colour | 0x00f9f9f9 |
+| sys_colour_ThreeDHighlight | colour | 0x00ffffff |
+| sys_colour_ThreeDLightShadow | colour | 0x00ffffff |
+| sys_colour_ThreeDShadow | colour | 0x00d5d5d5 |
+| sys_colour_Window | colour | 0x00f1f1f1 |
+| sys_colour_WindowFrame | colour | 0x004e4e4e |
+| sys_colour_WindowText | colour | 0x00000000 |
++--------------------------------+--------+------------+
diff --git a/Docs/USING-Framebuffer b/Docs/USING-Framebuffer
index 560cda6..d09274d 100644
--- a/Docs/USING-Framebuffer
+++ b/Docs/USING-Framebuffer
@@ -71,6 +71,14 @@ Configuring
default surface to use. Refer to the BUILDING-Framebuffer document
for details.
+ As with any NetSurf frontend run-time configuration is read from a
+ "Choices" file. This file is a simple key:value list and is located
+ in "${HOME}/.netsurf/Choices".
+
+ The standard values supported by the NetSurf core are documented in
+ the Options document. In addition to these there are a number of
+ values to control specific aspects of the framebuffer version.
+
Toolkit Options
---------------
@@ -127,12 +135,6 @@ Configuring
Selects the surface height to pass to libnsfb instead of the
compiled in default.
- As with any NetSurf frontend run-time configuration is read from a
- "Choices-fb" file. This file is a simple key:value list. In addition
- to the standard values supported by the NetSurf core there are a
- number of values to control specific aspects of the framebuffer
- version.
-
The libnsfb surface parameters are controlled with:
fb_refresh - The refresh rate (for physical displays)
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=45f98ffd6e6230189a0...
commit 45f98ffd6e6230189a06a042b981592cdae613be
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
improve comments in low level cache and remove completed todo
diff --git a/content/llcache.c b/content/llcache.c
index 6a0c096..e5d188e 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -29,8 +29,6 @@
*
* \todo instrument and (auto)tune
*
- * \todo Improve writeout bandwidth limiting.
- *
*/
#include <stdlib.h>
@@ -1555,7 +1553,9 @@ llcache_object_retrieve_from_cache(nsurl *url,
if (error == NSERROR_OK) {
LLCACHE_LOG(("retrived object from persistant store"));
- /* set object from persistant store as newest */
+ /* set newest object from persistant store which
+ * will cause the normal object handling to be used.
+ */
newest = obj;
/* Add new object to cached object list */
@@ -1563,7 +1563,7 @@ llcache_object_retrieve_from_cache(nsurl *url,
}
/* else no object found and unretrivable from cache,
- * fall through to start fetch
+ * fall through with newest unset to start fetch
*/
}
-----------------------------------------------------------------------
Summary of changes:
Docs/Options | 241 ++++++++++++++++++++++++++++++++++++++++++++++++
Docs/USING-Framebuffer | 14 +--
content/llcache.c | 8 +-
3 files changed, 253 insertions(+), 10 deletions(-)
create mode 100644 Docs/Options
diff --git a/Docs/Options b/Docs/Options
new file mode 100644
index 0000000..89b8814
--- /dev/null
+++ b/Docs/Options
@@ -0,0 +1,241 @@
+--------------------------------------------------------------------------------
+ Common NetSurf user options 4nd December 2014
+--------------------------------------------------------------------------------
+
+ This document outlines the common configuration options supported by the
+ NetSurf core.
+
+Overview
+========
+
+ The users configurations are generally stored in a "Choices" file
+ and are loaded at browser startup. Most user interfaces provide a
+ way to configure these parameters in a manner consistant with the
+ toolkit in use.
+
+ The user choices are stored as a simple key:value list.
+
+ Each entry has a type, one of: boolean, integer, unsigned integer,
+ hexadecimal colour value or string.
+
+General Options
+===============
+
++----------------------+--------+-----------+----------------------------------+
+| Option Key | Type | Default | Description |
++----------------------+--------+-----------+----------------------------------+
+| http_proxy | bool | false | An HTTP proxy should be used. |
+| | | | |
+| http_proxy | bool | false | An HTTP proxy should be used. |
+| | | | |
+| http_proxy_host | string | NULL | Hostname of proxy. |
+| | | | |
+| http_proxy_port | int | 8080 | Proxy port. |
+| | | | |
+| http_proxy_auth | int | 0 | Proxy authentication method. |
+| | | | |
+| http_proxy_auth_user | string | NULL | Proxy authentication user name |
+| | | | |
+| http_proxy_auth_pass | string | NULL | Proxy authentication password |
+| | | | |
+| http_proxy_noproxy | string | localhost | Proxy omission list |
+| | | | |
+| font_size | int | 128 | Default font size / 0.1pt. |
+| | | | |
+| font_min_size | int | 85 | Minimum font size. |
+| | | | |
+| font_sans | string | NULL | Default sans serif font |
+| | | | |
+| font_serif | string | NULL | Default serif font |
+| | | | |
+| font_mono | string | NULL | Default monospace font
+| | | | |
+| font_cursive | string | NULL | Default cursive font
+| | | | |
+| font_fantasy | string | NULL | Default fantasy font
+| | | | |
+| accept_language | string | NULL | Accept-Language header.
+| | | | |
+| accept_charset | string | NULL | Accept-Charset header.
+| | | | |
+| memory_cache_size | int | 12MiB | Preferred maximum size of memory |
+| | | | cache in bytes. |
+| | | | |
+| disc_cache_size | uint | 1GiB | Preferred expiry size of disc |
+| | | | cache in bytes. |
+| | | | |
+| disc_cache_age | int | 28 | Preferred expiry age of disc |
+| | | | cache in days. |
+| | | | |
+| block_advertisements | bool | false | Whether to block advertisements
+| | | | |
+| do_not_track | bool | false | Disable website tracking [1]
+| | | | |
+| minimum_gif_delay | int | 10 | Minimum GIF animation delay
+| | | | |
+| send_referer | bool | true | Whether to send the referer HTTP |
+| | | | header. |
+| | | | |
+| foreground_images | bool | true | Whether to fetch foreground images
+| | | | |
+| background_images | bool | true | Whether to fetch background images
+| | | | |
+| animate_images | bool | true | Whether to animate images
+| | | | |
+| enable_javascript | bool | false | Whether to execute javascript
+| | | | |
+| script_timeout | int | 10 | Maximum time to wait for a script|
+| | | | to run in seconds |
+| | | | |
+| expire_url | int | 28 | How many days to retain URL data |
+| | | | for. |
+| | | | |
+| font_default | int | 0 | Default font family
+| | | | |
+| ca_bundle | string | NULL | ca-bundle location
+| | | | |
+| ca_path | string | NULL | ca-path location
+| | | | |
+| cookie_file | string | NULL | Cookie file location
+| | | | |
+| cookie_jar | string | NULL | Cookie jar location
+| | | | |
+| homepage_url | string | NULL | Home page location
+| | | | |
+| search_url_bar | bool | false | search web from url bar
+| | | | |
+| search_provider | int | 0 | default web search provider
+| | | | |
+| url_suggestion | bool | true | URL completion in url bar
+| | | | |
+| window_x | int | 0 | default x position of new windows
+| | | | |
+| window_y | int | 0 | default y position of new windows
+| | | | |
+| window_width | int | 0 | default width of new windows
+| | | | |
+| window_height | int | 0 | default height of new windows
+| | | | |
+| window_screen_width | int | 0 | width of screen when above |
+| | | | options were saved |
+| | | | |
+| window_screen_height | int | 0 | height of screen when above |
+| | | | options were saved |
+| | | | |
+| toolbar_status_size | int | 6667 | default size of status bar vs. |
+| | | | h scroll bar |
+| | | | |
+| scale | int | 100 | default window scale
+| | | | |
+| incremental_reflow | bool | true | Whether to reflow web pages while|
+| | | | objects are fetching |
+| | | | |
+| min_reflow_period | uint | 25 | Minimum time (in cs) between HTML|
+| | | | reflows while objects are fetching
+| | | | |
+| core_select_menu | bool | false | Use core selection menu |
+| | | | |
++----------------------+--------+-----------+----------------------------------+
+
+[1] http://www.w3.org/Submission/2011/SUBM-web-tracking-protection-20110224/#...
+
+Fetcher options
+===============
+
++--------------------------+------+------+-------------------------------------+
+| Option Key | Type | Dflt | Description |
++--------------------------+------+------+-------------------------------------+
+| max_fetchers | int | 24 | Maximum simultaneous active fetchers|
+| | | | |
+| max_fetchers_per_host | int | 5 | Maximum simultaneous active fetchers|
+| | | | per host. (<=option_max_fetchers |
+| | | | else it makes no sense) [2] |
+| | | | |
+| max_cached_fetch_handles | int | 6 | Maximum number of inactive fetchers |
+| | | | cached. The total number of handles|
+| | | | netsurf will therefore have open is|
+| | | | this plus option_max_fetchers. |
+| | | | |
+| suppress_curl_debug | bool | true | Suppress debug output from cURL. |
+| | | | |
+| target_blank | bool | true | Whether to allow target="_blank" |
+| | | | |
+| button_2_tab | bool | true | Whether second mouse button opens in|
+| | | | new tab. |
+| | | | |
++--------------------------+------+------+-------------------------------------+
+
+[2] Note that rfc2616 section 8.1.4 says that there should be no more
+ than two keepalive connections per host. None of the main browsers
+ follow this as it slows page fetches down considerably.
+ See https://bugzilla.mozilla.org/show_bug.cgi?id=423377#c4
+
+
+PDF / Print options
+===================
+
++------------------------+------+-------+--------------------------------------+
+| Option Key | Type | Deflt | Description |
++------------------------+------+-------+--------------------------------------+
+| margin_top | int | 10 | top margin of exported page |
+| | | | |
+| margin_bottom | int | 10 | bottom margin of exported page |
+| | | | |
+| margin_left | int | 10 | left margin of exported page |
+| | | | |
+| margin_right | int | 10 | right margin of exported page |
+| | | | |
+| export_scale | int | 70 | scale of exported content |
+| | | | |
+| suppress_images | bool | false | suppressing images in printed content|
+| | | | |
+| remove_backgrounds | bool | false | turning off all backgrounds for |
+| | | | printed content |
+| | | | |
+| enable_loosening | bool | true | turning on content loosening for |
+| | | | printed content |
+| | | | |
+| enable_PDF_compression | bool | true | compression of PDF documents |
+| | | | |
+| enable_PDF_password | bool | false | setting a password and encoding PDF |
+| | | | documents |
++------------------------+------+-------+--------------------------------------+
+
+System colours
+==============
+
+These are the css system colours which the browser also uses to style
+generated output.
+
++--------------------------------+--------+------------+
+| Option Key | Type | Default |
++--------------------------------+--------+------------+
+| sys_colour_ActiveBorder | colour | 0x00d3d3d3 |
+| sys_colour_ActiveCaption | colour | 0x00f1f1f1 |
+| sys_colour_AppWorkspace | colour | 0x00f1f1f1 |
+| sys_colour_Background | colour | 0x006e6e6e |
+| sys_colour_ButtonFace | colour | 0x00f9f9f9 |
+| sys_colour_ButtonHighlight | colour | 0x00ffffff |
+| sys_colour_ButtonShadow | colour | 0x00aeaeae |
+| sys_colour_ButtonText | colour | 0x004c4c4c |
+| sys_colour_CaptionText | colour | 0x004c4c4c |
+| sys_colour_GrayText | colour | 0x00505050 |
+| sys_colour_Highlight | colour | 0x00c00800 |
+| sys_colour_HighlightText | colour | 0x00ffffff |
+| sys_colour_InactiveBorder | colour | 0x00f1f1f1 |
+| sys_colour_InactiveCaption | colour | 0x00e6e6e6 |
+| sys_colour_InactiveCaptionText | colour | 0x00a6a6a6 |
+| sys_colour_InfoBackground | colour | 0x008fdfef |
+| sys_colour_InfoText | colour | 0x00000000 |
+| sys_colour_Menu | colour | 0x00f1f1f1 |
+| sys_colour_MenuText | colour | 0x004e4e4e |
+| sys_colour_Scrollbar | colour | 0x00cccccc |
+| sys_colour_ThreeDDarkShadow | colour | 0x00aeaeae |
+| sys_colour_ThreeDFace | colour | 0x00f9f9f9 |
+| sys_colour_ThreeDHighlight | colour | 0x00ffffff |
+| sys_colour_ThreeDLightShadow | colour | 0x00ffffff |
+| sys_colour_ThreeDShadow | colour | 0x00d5d5d5 |
+| sys_colour_Window | colour | 0x00f1f1f1 |
+| sys_colour_WindowFrame | colour | 0x004e4e4e |
+| sys_colour_WindowText | colour | 0x00000000 |
++--------------------------------+--------+------------+
diff --git a/Docs/USING-Framebuffer b/Docs/USING-Framebuffer
index 560cda6..d09274d 100644
--- a/Docs/USING-Framebuffer
+++ b/Docs/USING-Framebuffer
@@ -71,6 +71,14 @@ Configuring
default surface to use. Refer to the BUILDING-Framebuffer document
for details.
+ As with any NetSurf frontend run-time configuration is read from a
+ "Choices" file. This file is a simple key:value list and is located
+ in "${HOME}/.netsurf/Choices".
+
+ The standard values supported by the NetSurf core are documented in
+ the Options document. In addition to these there are a number of
+ values to control specific aspects of the framebuffer version.
+
Toolkit Options
---------------
@@ -127,12 +135,6 @@ Configuring
Selects the surface height to pass to libnsfb instead of the
compiled in default.
- As with any NetSurf frontend run-time configuration is read from a
- "Choices-fb" file. This file is a simple key:value list. In addition
- to the standard values supported by the NetSurf core there are a
- number of values to control specific aspects of the framebuffer
- version.
-
The libnsfb surface parameters are controlled with:
fb_refresh - The refresh rate (for physical displays)
diff --git a/content/llcache.c b/content/llcache.c
index 6a0c096..e5d188e 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -29,8 +29,6 @@
*
* \todo instrument and (auto)tune
*
- * \todo Improve writeout bandwidth limiting.
- *
*/
#include <stdlib.h>
@@ -1555,7 +1553,9 @@ llcache_object_retrieve_from_cache(nsurl *url,
if (error == NSERROR_OK) {
LLCACHE_LOG(("retrived object from persistant store"));
- /* set object from persistant store as newest */
+ /* set newest object from persistant store which
+ * will cause the normal object handling to be used.
+ */
newest = obj;
/* Add new object to cached object list */
@@ -1563,7 +1563,7 @@ llcache_object_retrieve_from_cache(nsurl *url,
}
/* else no object found and unretrivable from cache,
- * fall through to start fetch
+ * fall through with newest unset to start fetch
*/
}
--
NetSurf Browser
8 years, 6 months
netsurf: branch master updated. release/3.2-525-g0166083
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/0166083584ba8c909ff35...
...commit http://git.netsurf-browser.org/netsurf.git/commit/0166083584ba8c909ff3518...
...tree http://git.netsurf-browser.org/netsurf.git/tree/0166083584ba8c909ff351866...
The branch, master has been updated
via 0166083584ba8c909ff3518661648334ad9f53cf (commit)
from 19fed3976fd3c7070abe82481d353be5f90977da (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=0166083584ba8c909ff...
commit 0166083584ba8c909ff3518661648334ad9f53cf
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Get scale after memory allocated
diff --git a/amiga/gui.c b/amiga/gui.c
index 815d301..2fc00b3 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -3420,7 +3420,6 @@ gui_window_create(struct browser_window *bw,
if (nsoption_bool(kiosk_mode)) flags &= ~GW_CREATE_TAB;
if (nsoption_bool(resize_with_contents)) idcmp_sizeverify = 0;
- g->scale = browser_window_get_scale(bw);
/* Offset the new window by titlebar + 1 as per AmigaOS style guide.
* If we don't have a clone window we offset by all windows open. */
@@ -3450,6 +3449,7 @@ gui_window_create(struct browser_window *bw,
NewList(&g->dllist);
g->deferred_rects = NewObjList();
g->bw = bw;
+ g->scale = browser_window_get_scale(bw);
if((flags & GW_CREATE_TAB) && existing)
{
-----------------------------------------------------------------------
Summary of changes:
amiga/gui.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/amiga/gui.c b/amiga/gui.c
index 815d301..2fc00b3 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -3420,7 +3420,6 @@ gui_window_create(struct browser_window *bw,
if (nsoption_bool(kiosk_mode)) flags &= ~GW_CREATE_TAB;
if (nsoption_bool(resize_with_contents)) idcmp_sizeverify = 0;
- g->scale = browser_window_get_scale(bw);
/* Offset the new window by titlebar + 1 as per AmigaOS style guide.
* If we don't have a clone window we offset by all windows open. */
@@ -3450,6 +3449,7 @@ gui_window_create(struct browser_window *bw,
NewList(&g->dllist);
g->deferred_rects = NewObjList();
g->bw = bw;
+ g->scale = browser_window_get_scale(bw);
if((flags & GW_CREATE_TAB) && existing)
{
--
NetSurf Browser
8 years, 6 months
netsurf: branch master updated. release/3.2-524-g19fed39
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/19fed3976fd3c7070abe8...
...commit http://git.netsurf-browser.org/netsurf.git/commit/19fed3976fd3c7070abe824...
...tree http://git.netsurf-browser.org/netsurf.git/tree/19fed3976fd3c7070abe82481...
The branch, master has been updated
via 19fed3976fd3c7070abe82481d353be5f90977da (commit)
via f0b38f27d4fb6fe8b403f6780e81bb5e0c383858 (commit)
from 60877b6ff5d0b552197e8e07075934294563fe58 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=19fed3976fd3c7070ab...
commit 19fed3976fd3c7070abe82481d353be5f90977da
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Don't need browser window private header now.
diff --git a/amiga/gui.c b/amiga/gui.c
index 27f4d3d..815d301 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -98,7 +98,7 @@
#include "content/urldb.h"
#include "image/ico.h"
#include "desktop/browser_history.h"
-#include "desktop/browser_private.h"
+#include "desktop/browser.h"
#include "desktop/hotlist.h"
#include "desktop/mouse.h"
#include "desktop/netsurf.h"
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=f0b38f27d4fb6fe8b40...
commit f0b38f27d4fb6fe8b403f6780e81bb5e0c383858
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Use API to get at a browser window's content.
diff --git a/amiga/gui.c b/amiga/gui.c
index 423426a..27f4d3d 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -2244,11 +2244,11 @@ static void ami_handle_msg(void)
case 's':
ami_file_save_req(AMINS_SAVE_SOURCE, gwin,
- gwin->gw->bw->current_content);
+ browser_window_get_content(gwin->gw->bw));
break;
case 'p':
- ami_print_ui(gwin->gw->bw->current_content);
+ ami_print_ui(browser_window_get_content(gwin->gw->bw));
break;
case 'q':
@@ -2410,7 +2410,7 @@ static void ami_handle_msg(void)
struct bitmap *bm;
bm = urldb_get_thumbnail(browser_window_get_url(gwin->gw->bw));
- if(!bm) bm = content_get_bitmap(gwin->gw->bw->current_content);
+ if(!bm) bm = content_get_bitmap(browser_window_get_content(gwin->gw->bw));
gwin->dobj = amiga_icon_from_bitmap(bm);
amiga_icon_superimpose_favicon_internal(gwin->gw->favicon,
gwin->dobj);
@@ -2810,7 +2810,7 @@ void ami_switch_tab(struct gui_window_2 *gwin, bool redraw)
return;
}
- if(!gwin->gw->bw->current_content)
+ if(browser_window_has_content(gwin->gw->bw) == false)
{
RefreshSetGadgetAttrs((struct Gadget *)gwin->objects[GID_URL],
gwin->win, NULL, STRINGA_TextVal, "", TAG_DONE);
@@ -2824,7 +2824,7 @@ void ami_switch_tab(struct gui_window_2 *gwin, bool redraw)
ami_plot_release_pens(&gwin->shared_pens);
ami_update_buttons(gwin);
- ami_menu_update_disabled(gwin->gw, gwin->gw->bw->current_content);
+ ami_menu_update_disabled(gwin->gw, browser_window_get_content(gwin->gw->bw));
if(redraw)
{
@@ -4698,7 +4698,7 @@ static void gui_window_set_scroll(struct gui_window *g, int sx, int sy)
int width, height;
if(!g) return;
- if(!g->bw || !g->bw->current_content) return;
+ if(!g->bw || browser_window_has_content(g->bw) == false) return;
if(ami_gui_get_space_box((Object *)g->shared->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
warn_user("NoMemory", "");
@@ -4748,8 +4748,6 @@ static void gui_window_set_scroll(struct gui_window *g, int sx, int sy)
g->scrollx = sx;
g->scrolly = sy;
-
-// history_set_current_scroll(g->bw->history,g->scrollx,g->scrolly);
}
// g->shared->new_content = false;
}
@@ -4759,8 +4757,8 @@ static void gui_window_update_extent(struct gui_window *g)
struct IBox *bbox;
int cur_tab = 0;
- if(!g) return;
- if(!g->bw->current_content) return;
+ if(!g || !g->bw) return;
+ if(browser_window_has_content(g->bw) == false) return;
if(g->tab_node && (g->shared->tabs > 1)) GetAttr(CLICKTAB_Current,
g->shared->objects[GID_TABS], (ULONG *)&cur_tab);
@@ -4989,8 +4987,8 @@ static void gui_window_new_content(struct gui_window *g)
{
hlcache_handle *c;
- if(g && g->shared && g->bw && g->bw->current_content)
- c = g->bw->current_content;
+ if(g && g->shared && g->bw && browser_window_has_content(g->bw))
+ c = browser_window_get_content(g->bw);
else return;
ami_clearclipreg(&browserglob);
-----------------------------------------------------------------------
Summary of changes:
amiga/gui.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/amiga/gui.c b/amiga/gui.c
index 423426a..815d301 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -98,7 +98,7 @@
#include "content/urldb.h"
#include "image/ico.h"
#include "desktop/browser_history.h"
-#include "desktop/browser_private.h"
+#include "desktop/browser.h"
#include "desktop/hotlist.h"
#include "desktop/mouse.h"
#include "desktop/netsurf.h"
@@ -2244,11 +2244,11 @@ static void ami_handle_msg(void)
case 's':
ami_file_save_req(AMINS_SAVE_SOURCE, gwin,
- gwin->gw->bw->current_content);
+ browser_window_get_content(gwin->gw->bw));
break;
case 'p':
- ami_print_ui(gwin->gw->bw->current_content);
+ ami_print_ui(browser_window_get_content(gwin->gw->bw));
break;
case 'q':
@@ -2410,7 +2410,7 @@ static void ami_handle_msg(void)
struct bitmap *bm;
bm = urldb_get_thumbnail(browser_window_get_url(gwin->gw->bw));
- if(!bm) bm = content_get_bitmap(gwin->gw->bw->current_content);
+ if(!bm) bm = content_get_bitmap(browser_window_get_content(gwin->gw->bw));
gwin->dobj = amiga_icon_from_bitmap(bm);
amiga_icon_superimpose_favicon_internal(gwin->gw->favicon,
gwin->dobj);
@@ -2810,7 +2810,7 @@ void ami_switch_tab(struct gui_window_2 *gwin, bool redraw)
return;
}
- if(!gwin->gw->bw->current_content)
+ if(browser_window_has_content(gwin->gw->bw) == false)
{
RefreshSetGadgetAttrs((struct Gadget *)gwin->objects[GID_URL],
gwin->win, NULL, STRINGA_TextVal, "", TAG_DONE);
@@ -2824,7 +2824,7 @@ void ami_switch_tab(struct gui_window_2 *gwin, bool redraw)
ami_plot_release_pens(&gwin->shared_pens);
ami_update_buttons(gwin);
- ami_menu_update_disabled(gwin->gw, gwin->gw->bw->current_content);
+ ami_menu_update_disabled(gwin->gw, browser_window_get_content(gwin->gw->bw));
if(redraw)
{
@@ -4698,7 +4698,7 @@ static void gui_window_set_scroll(struct gui_window *g, int sx, int sy)
int width, height;
if(!g) return;
- if(!g->bw || !g->bw->current_content) return;
+ if(!g->bw || browser_window_has_content(g->bw) == false) return;
if(ami_gui_get_space_box((Object *)g->shared->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
warn_user("NoMemory", "");
@@ -4748,8 +4748,6 @@ static void gui_window_set_scroll(struct gui_window *g, int sx, int sy)
g->scrollx = sx;
g->scrolly = sy;
-
-// history_set_current_scroll(g->bw->history,g->scrollx,g->scrolly);
}
// g->shared->new_content = false;
}
@@ -4759,8 +4757,8 @@ static void gui_window_update_extent(struct gui_window *g)
struct IBox *bbox;
int cur_tab = 0;
- if(!g) return;
- if(!g->bw->current_content) return;
+ if(!g || !g->bw) return;
+ if(browser_window_has_content(g->bw) == false) return;
if(g->tab_node && (g->shared->tabs > 1)) GetAttr(CLICKTAB_Current,
g->shared->objects[GID_TABS], (ULONG *)&cur_tab);
@@ -4989,8 +4987,8 @@ static void gui_window_new_content(struct gui_window *g)
{
hlcache_handle *c;
- if(g && g->shared && g->bw && g->bw->current_content)
- c = g->bw->current_content;
+ if(g && g->shared && g->bw && browser_window_has_content(g->bw))
+ c = browser_window_get_content(g->bw);
else return;
ami_clearclipreg(&browserglob);
--
NetSurf Browser
8 years, 6 months
netsurf: branch master updated. release/3.2-522-g60877b6
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/60877b6ff5d0b552197e8...
...commit http://git.netsurf-browser.org/netsurf.git/commit/60877b6ff5d0b552197e8e0...
...tree http://git.netsurf-browser.org/netsurf.git/tree/60877b6ff5d0b552197e8e070...
The branch, master has been updated
via 60877b6ff5d0b552197e8e07075934294563fe58 (commit)
from 4af70cd1ac87b1fe02c3783950454c5733b9a0c7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=60877b6ff5d0b552197...
commit 60877b6ff5d0b552197e8e07075934294563fe58
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Fix missmatched bracket.
diff --git a/amiga/gui.c b/amiga/gui.c
index 1e3389d..423426a 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -4712,7 +4712,7 @@ static void gui_window_set_scroll(struct gui_window *g, int sx, int sy)
if(sx >= width - bbox->Width)
sx = width - bbox->Width;
- if(sy >= height - bbox->Height))
+ if(sy >= height - bbox->Height)
sy = height - bbox->Height;
if(width <= bbox->Width) sx = 0;
-----------------------------------------------------------------------
Summary of changes:
amiga/gui.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/amiga/gui.c b/amiga/gui.c
index 1e3389d..423426a 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -4712,7 +4712,7 @@ static void gui_window_set_scroll(struct gui_window *g, int sx, int sy)
if(sx >= width - bbox->Width)
sx = width - bbox->Width;
- if(sy >= height - bbox->Height))
+ if(sy >= height - bbox->Height)
sy = height - bbox->Height;
if(width <= bbox->Width) sx = 0;
--
NetSurf Browser
8 years, 6 months
netsurf: branch master updated. release/3.2-521-g4af70cd
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/4af70cd1ac87b1fe02c37...
...commit http://git.netsurf-browser.org/netsurf.git/commit/4af70cd1ac87b1fe02c3783...
...tree http://git.netsurf-browser.org/netsurf.git/tree/4af70cd1ac87b1fe02c378395...
The branch, master has been updated
via 4af70cd1ac87b1fe02c3783950454c5733b9a0c7 (commit)
via fad6318d59fca6f8457f099ef5a3c1b03ff8544f (commit)
from b7b1bfe54865fd3e1d52f96e6f424961771a7eef (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=4af70cd1ac87b1fe02c...
commit 4af70cd1ac87b1fe02c3783950454c5733b9a0c7
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Use browser_window_get_extents to simplify window content size handling.
diff --git a/amiga/gui.c b/amiga/gui.c
index 58c7e6e..1e3389d 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -1293,6 +1293,8 @@ static void ami_gui_scroll_internal(struct gui_window_2 *gwin, int xs, int ys)
if(browser_window_scroll_at_point(gwin->gw->bw, x, y,
xs, ys) == false)
{
+ int width, height;
+
gui_window_get_scroll(gwin->gw,
&gwin->gw->scrollx,
&gwin->gw->scrolly);
@@ -1302,6 +1304,8 @@ static void ami_gui_scroll_internal(struct gui_window_2 *gwin, int xs, int ys)
return;
}
+ browser_window_get_extents(gwin->gw->bw, false, &width, &height);
+
switch(xs)
{
case SCROLL_PAGE_UP:
@@ -1317,7 +1321,7 @@ static void ami_gui_scroll_internal(struct gui_window_2 *gwin, int xs, int ys)
break;
case SCROLL_BOTTOM:
- xs = content_get_width(gwin->gw->bw->current_content);
+ xs = width;
break;
default:
@@ -1340,7 +1344,7 @@ static void ami_gui_scroll_internal(struct gui_window_2 *gwin, int xs, int ys)
break;
case SCROLL_BOTTOM:
- ys = content_get_height(gwin->gw->bw->current_content);
+ ys = height;
break;
default:
@@ -4691,6 +4695,7 @@ static void gui_window_set_scroll(struct gui_window *g, int sx, int sy)
{
struct IBox *bbox;
int cur_tab = 0;
+ int width, height;
if(!g) return;
if(!g->bw || !g->bw->current_content) return;
@@ -4703,13 +4708,15 @@ static void gui_window_set_scroll(struct gui_window *g, int sx, int sy)
if(sx < 0) sx=0;
if(sy < 0) sy=0;
- if(sx >= content_get_width(g->bw->current_content) - bbox->Width)
- sx = content_get_width(g->bw->current_content) - bbox->Width;
- if(sy >= (content_get_height(g->bw->current_content) - bbox->Height))
- sy = content_get_height(g->bw->current_content) - bbox->Height;
+ browser_window_get_extents(g->bw, false, &width, &height);
+
+ if(sx >= width - bbox->Width)
+ sx = width - bbox->Width;
+ if(sy >= height - bbox->Height))
+ sy = height - bbox->Height;
- if(content_get_width(g->bw->current_content) <= bbox->Width) sx = 0;
- if(content_get_height(g->bw->current_content) <= bbox->Height) sy = 0;
+ if(width <= bbox->Width) sx = 0;
+ if(height <= bbox->Height) sy = 0;
ami_gui_free_space_box(bbox);
@@ -4760,23 +4767,26 @@ static void gui_window_update_extent(struct gui_window *g)
if((cur_tab == g->tab) || (g->shared->tabs <= 1))
{
+ int width, height;
if(ami_gui_get_space_box((Object *)g->shared->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
warn_user("NoMemory", "");
return;
}
if(g->shared->objects[GID_VSCROLL]) {
+ browser_window_get_extents(g->bw, true, &width, &height);
RefreshSetGadgetAttrs((struct Gadget *)(APTR)g->shared->objects[GID_VSCROLL],g->shared->win,NULL,
- SCROLLER_Total, (ULONG)(content_get_height(g->bw->current_content) * g->scale),
+ SCROLLER_Total, (ULONG)(height),
SCROLLER_Visible, bbox->Height,
TAG_DONE);
}
if(g->shared->objects[GID_HSCROLL])
{
+ browser_window_get_extents(g->bw, true, &width, &height);
RefreshSetGadgetAttrs((struct Gadget *)(APTR)g->shared->objects[GID_HSCROLL],
g->shared->win, NULL,
- SCROLLER_Total, (ULONG)(content_get_width(g->bw->current_content) * g->scale),
+ SCROLLER_Total, (ULONG)(width),
SCROLLER_Visible, bbox->Width,
TAG_DONE);
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=fad6318d59fca6f8457...
commit fad6318d59fca6f8457f099ef5a3c1b03ff8544f
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Use browser_window_get_url()
diff --git a/amiga/gui.c b/amiga/gui.c
index a7595ad..58c7e6e 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -2405,7 +2405,7 @@ static void ami_handle_msg(void)
{
struct bitmap *bm;
- bm = urldb_get_thumbnail(hlcache_handle_get_url(gwin->gw->bw->current_content));
+ bm = urldb_get_thumbnail(browser_window_get_url(gwin->gw->bw));
if(!bm) bm = content_get_bitmap(gwin->gw->bw->current_content);
gwin->dobj = amiga_icon_from_bitmap(bm);
amiga_icon_superimpose_favicon_internal(gwin->gw->favicon,
-----------------------------------------------------------------------
Summary of changes:
amiga/gui.c | 32 +++++++++++++++++++++-----------
1 file changed, 21 insertions(+), 11 deletions(-)
diff --git a/amiga/gui.c b/amiga/gui.c
index a7595ad..1e3389d 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -1293,6 +1293,8 @@ static void ami_gui_scroll_internal(struct gui_window_2 *gwin, int xs, int ys)
if(browser_window_scroll_at_point(gwin->gw->bw, x, y,
xs, ys) == false)
{
+ int width, height;
+
gui_window_get_scroll(gwin->gw,
&gwin->gw->scrollx,
&gwin->gw->scrolly);
@@ -1302,6 +1304,8 @@ static void ami_gui_scroll_internal(struct gui_window_2 *gwin, int xs, int ys)
return;
}
+ browser_window_get_extents(gwin->gw->bw, false, &width, &height);
+
switch(xs)
{
case SCROLL_PAGE_UP:
@@ -1317,7 +1321,7 @@ static void ami_gui_scroll_internal(struct gui_window_2 *gwin, int xs, int ys)
break;
case SCROLL_BOTTOM:
- xs = content_get_width(gwin->gw->bw->current_content);
+ xs = width;
break;
default:
@@ -1340,7 +1344,7 @@ static void ami_gui_scroll_internal(struct gui_window_2 *gwin, int xs, int ys)
break;
case SCROLL_BOTTOM:
- ys = content_get_height(gwin->gw->bw->current_content);
+ ys = height;
break;
default:
@@ -2405,7 +2409,7 @@ static void ami_handle_msg(void)
{
struct bitmap *bm;
- bm = urldb_get_thumbnail(hlcache_handle_get_url(gwin->gw->bw->current_content));
+ bm = urldb_get_thumbnail(browser_window_get_url(gwin->gw->bw));
if(!bm) bm = content_get_bitmap(gwin->gw->bw->current_content);
gwin->dobj = amiga_icon_from_bitmap(bm);
amiga_icon_superimpose_favicon_internal(gwin->gw->favicon,
@@ -4691,6 +4695,7 @@ static void gui_window_set_scroll(struct gui_window *g, int sx, int sy)
{
struct IBox *bbox;
int cur_tab = 0;
+ int width, height;
if(!g) return;
if(!g->bw || !g->bw->current_content) return;
@@ -4703,13 +4708,15 @@ static void gui_window_set_scroll(struct gui_window *g, int sx, int sy)
if(sx < 0) sx=0;
if(sy < 0) sy=0;
- if(sx >= content_get_width(g->bw->current_content) - bbox->Width)
- sx = content_get_width(g->bw->current_content) - bbox->Width;
- if(sy >= (content_get_height(g->bw->current_content) - bbox->Height))
- sy = content_get_height(g->bw->current_content) - bbox->Height;
+ browser_window_get_extents(g->bw, false, &width, &height);
+
+ if(sx >= width - bbox->Width)
+ sx = width - bbox->Width;
+ if(sy >= height - bbox->Height))
+ sy = height - bbox->Height;
- if(content_get_width(g->bw->current_content) <= bbox->Width) sx = 0;
- if(content_get_height(g->bw->current_content) <= bbox->Height) sy = 0;
+ if(width <= bbox->Width) sx = 0;
+ if(height <= bbox->Height) sy = 0;
ami_gui_free_space_box(bbox);
@@ -4760,23 +4767,26 @@ static void gui_window_update_extent(struct gui_window *g)
if((cur_tab == g->tab) || (g->shared->tabs <= 1))
{
+ int width, height;
if(ami_gui_get_space_box((Object *)g->shared->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
warn_user("NoMemory", "");
return;
}
if(g->shared->objects[GID_VSCROLL]) {
+ browser_window_get_extents(g->bw, true, &width, &height);
RefreshSetGadgetAttrs((struct Gadget *)(APTR)g->shared->objects[GID_VSCROLL],g->shared->win,NULL,
- SCROLLER_Total, (ULONG)(content_get_height(g->bw->current_content) * g->scale),
+ SCROLLER_Total, (ULONG)(height),
SCROLLER_Visible, bbox->Height,
TAG_DONE);
}
if(g->shared->objects[GID_HSCROLL])
{
+ browser_window_get_extents(g->bw, true, &width, &height);
RefreshSetGadgetAttrs((struct Gadget *)(APTR)g->shared->objects[GID_HSCROLL],
g->shared->win, NULL,
- SCROLLER_Total, (ULONG)(content_get_width(g->bw->current_content) * g->scale),
+ SCROLLER_Total, (ULONG)(width),
SCROLLER_Visible, bbox->Width,
TAG_DONE);
}
--
NetSurf Browser
8 years, 6 months