| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
There's a table we can index into for calc():
const uint32_t property_unit_mask[CSS_N_PROPERTIES]
And there are #defines for where the code is already
property-specific, avoiding the lookup.
|
| |
|
|
|
|
| |
This means that we can use a mask to check the unit class.
|
| |
|
|
|
|
| |
Fixes use of garbage value scan-build issue.
|
|
|
|
| |
Fixes scan-build use of garbage value.
|
|
|
|
|
|
| |
Fixes scan-build: Value stored to 'error' is never read.
Signed-off-by: Michael Drake <Michael Drake tlsa@netsurf-browser.org>
|
|
|
|
|
|
| |
Fixes scan-build: Value stored to 'error' is never read.
Signed-off-by: Michael Drake <Michael Drake tlsa@netsurf-browser.org>
|
|
|
|
|
|
| |
Fixes scan-build: Value stored to 'error' is never read.
Signed-off-by: Michael Drake <Michael Drake tlsa@netsurf-browser.org>
|
|
|
|
|
|
|
| |
Squashes scan-build error about dereference of parts if the
allocation fails.
Signed-off-by: Michael Drake <Michael Drake tlsa@netsurf-browser.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to cope with a situation where a block ends with a
selector which has no ruleset, add an end-block-content event
and in handling it, pop any intermediate states off the language
stack so that we're in block mode by the time the event is completed.
This fixes an assert situation caused by a ruleset such as:
@media screen { dodgy } .outer { top: 10px; }
Which has been encountered in the wild (likely a typo).
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
|
|
| |
This might help Coverity understand what's going on.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
We've found instances of well over 256 selectors for a rule in the wild.
`for N in $(seq 0 254); do echo ".selector-$N,"; done; echo ".selector-255 {}"`
|
|
|
|
| |
src/parse/mq.c:1125:15: error: 'query' may be used uninitialized in this function [-Werror=uninitialized]
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The <ratio> value type is a positive (not zero or negative) <integer>
followed by optional whitespace, followed by a solidus ('/'), followed
by optional whitespace, followed by a positive <integer>. <ratio>s can
be ordered or compared by transforming them into the number obtained
by dividing their first <integer> by their second <integer>.
-- https://www.w3.org/TR/mediaqueries-4/#aspect-ratio
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
They were a space saving feature, but they became largely
redundant with computed style sharing. They also made the
code complex and buggy in many places. E.g. the cascade,
inheritance / composition, and intial values all needed to
behave corretly when they, or their parent, had or didn't
have an uncommon block.
Also, only the uncommon block was really used.
Fixes:
https://bugs.netsurf-browser.org/mantis/view.php?id=2641
|
|
|
|
|
|
|
|
| |
Clients now provide viewport dimensions in pixels.
LibCSS can now convert the units from the stylesheet to pixels.
Client must also provide default font size and line height for
handling viewport and root element relative sizes.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently we just look at:
- width
- height
TODO:
- Unit conversion
- Use interned string comparison
|
| |
|
| |
|
|
|
|
|
|
|
| |
Previously the "<" was output as a CSS_TOKEN_CHAR, and the
"=" was in the next token.
CSS media queries adds "<=".
|
| |
|
|
|
|
|
| |
In mq_parse_range we already have a level 4 range.
We need to convert <mf-plain> in mq_parse_media_feature.
|
|
|
|
| |
First op/value are encoded as `value op name`.
|
| |
|
| |
|
|
|
|
| |
This will make the selection code's life easier.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The API changes are:
1. When building a selection context, stylesheets added with
`css_select_ctx_{append|insert}_sheet()` now have to have
media strings associcated with them. Previously they took
a simple bitfield for CSS media type.
2. When selecting for an element, the client needs to specify
the current media requirements. Previously it only had to
provide the bitfield for CSS media type.
3. Same for the css_select_font_faces API.
The selection handling has been updated to handle the new
API, however it is currently only looking at the media type
when performing selection.
Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
|
|
|
|
| |
Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
|
|
|
|
| |
Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
|
|
|
|
| |
Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
|
|
|
|
| |
Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
|
| |
|
|
|
|
| |
It's now exposed in the mq.h header too.
|
|
|
|
|
| |
This converts the experimental code to test the media query parsing into
a useful function.
|
| |
|
|
|
|
|
|
| |
There's not much point having every call site have to call two
functions every time they want to clean the token vector. Instead,
have a single function call to do both parts of the cleanup.
|
|
|
|
|
| |
This simply wraps the existing at-rule parser but is able to clean
up afterwards.
|
| |
|
| |
|