summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bytecode/bytecode.h2
-rw-r--r--src/charset/detect.c50
-rw-r--r--src/lex/lex.c208
-rw-r--r--src/lex/lex.h24
-rw-r--r--src/parse/font_face.c120
-rw-r--r--src/parse/important.c24
-rw-r--r--src/parse/language.c244
-rw-r--r--src/parse/language.h2
-rw-r--r--src/parse/parse.c206
-rw-r--r--src/parse/parse.h8
-rw-r--r--src/parse/properties/azimuth.c16
-rw-r--r--src/parse/properties/background.c44
-rw-r--r--src/parse/properties/background_position.c42
-rw-r--r--src/parse/properties/border.c6
-rw-r--r--src/parse/properties/border_color.c16
-rw-r--r--src/parse/properties/border_spacing.c22
-rw-r--r--src/parse/properties/border_style.c24
-rw-r--r--src/parse/properties/border_width.c16
-rw-r--r--src/parse/properties/clip.c26
-rw-r--r--src/parse/properties/content.c6
-rw-r--r--src/parse/properties/css_property_parser_gen.c26
-rw-r--r--src/parse/properties/cue.c8
-rw-r--r--src/parse/properties/cursor.c14
-rw-r--r--src/parse/properties/elevation.c4
-rw-r--r--src/parse/properties/font.c70
-rw-r--r--src/parse/properties/font_family.c8
-rw-r--r--src/parse/properties/font_weight.c12
-rw-r--r--src/parse/properties/list_style.c30
-rw-r--r--src/parse/properties/list_style_type.c8
-rw-r--r--src/parse/properties/margin.c16
-rw-r--r--src/parse/properties/opacity.c2
-rw-r--r--src/parse/properties/outline.c32
-rw-r--r--src/parse/properties/padding.c18
-rw-r--r--src/parse/properties/pause.c2
-rw-r--r--src/parse/properties/play_during.c18
-rw-r--r--src/parse/properties/properties.h222
-rw-r--r--src/parse/properties/quotes.c22
-rw-r--r--src/parse/properties/text_decoration.c4
-rw-r--r--src/parse/properties/utils.c58
-rw-r--r--src/parse/properties/utils.h8
-rw-r--r--src/parse/properties/voice_family.c6
-rw-r--r--src/parse/propstrings.h42
-rw-r--r--src/select/computed.c70
-rw-r--r--src/select/computed.h8
-rw-r--r--src/select/dispatch.h4
-rw-r--r--src/select/font_face.c46
-rw-r--r--src/select/font_face.h2
-rw-r--r--src/select/hash.c8
-rw-r--r--src/select/properties/azimuth.c4
-rw-r--r--src/select/properties/background_attachment.c6
-rw-r--r--src/select/properties/background_color.c6
-rw-r--r--src/select/properties/background_image.c6
-rw-r--r--src/select/properties/background_position.c12
-rw-r--r--src/select/properties/background_repeat.c6
-rw-r--r--src/select/properties/border_bottom_color.c6
-rw-r--r--src/select/properties/border_bottom_style.c4
-rw-r--r--src/select/properties/border_bottom_width.c4
-rw-r--r--src/select/properties/border_collapse.c6
-rw-r--r--src/select/properties/border_left_color.c8
-rw-r--r--src/select/properties/border_left_style.c4
-rw-r--r--src/select/properties/border_left_width.c4
-rw-r--r--src/select/properties/border_right_color.c8
-rw-r--r--src/select/properties/border_right_style.c4
-rw-r--r--src/select/properties/border_right_width.c4
-rw-r--r--src/select/properties/border_spacing.c10
-rw-r--r--src/select/properties/border_top_color.c4
-rw-r--r--src/select/properties/border_top_style.c4
-rw-r--r--src/select/properties/border_top_width.c8
-rw-r--r--src/select/properties/bottom.c6
-rw-r--r--src/select/properties/box_sizing.c2
-rw-r--r--src/select/properties/break_after.c2
-rw-r--r--src/select/properties/break_before.c2
-rw-r--r--src/select/properties/break_inside.c2
-rw-r--r--src/select/properties/caption_side.c6
-rw-r--r--src/select/properties/clear.c4
-rw-r--r--src/select/properties/clip.c10
-rw-r--r--src/select/properties/color.c8
-rw-r--r--src/select/properties/column_count.c4
-rw-r--r--src/select/properties/column_fill.c2
-rw-r--r--src/select/properties/column_gap.c2
-rw-r--r--src/select/properties/column_rule_color.c2
-rw-r--r--src/select/properties/column_rule_style.c2
-rw-r--r--src/select/properties/column_rule_width.c2
-rw-r--r--src/select/properties/content.c16
-rw-r--r--src/select/properties/counter_increment.c16
-rw-r--r--src/select/properties/counter_reset.c8
-rw-r--r--src/select/properties/cue_after.c2
-rw-r--r--src/select/properties/cue_before.c2
-rw-r--r--src/select/properties/cursor.c14
-rw-r--r--src/select/properties/direction.c2
-rw-r--r--src/select/properties/display.c2
-rw-r--r--src/select/properties/elevation.c4
-rw-r--r--src/select/properties/empty_cells.c2
-rw-r--r--src/select/properties/float.c2
-rw-r--r--src/select/properties/font_family.c22
-rw-r--r--src/select/properties/font_size.c8
-rw-r--r--src/select/properties/font_style.c4
-rw-r--r--src/select/properties/font_variant.c2
-rw-r--r--src/select/properties/font_weight.c2
-rw-r--r--src/select/properties/height.c2
-rw-r--r--src/select/properties/helpers.c28
-rw-r--r--src/select/properties/helpers.h12
-rw-r--r--src/select/properties/left.c2
-rw-r--r--src/select/properties/letter_spacing.c4
-rw-r--r--src/select/properties/line_height.c4
-rw-r--r--src/select/properties/list_style_image.c4
-rw-r--r--src/select/properties/list_style_position.c4
-rw-r--r--src/select/properties/list_style_type.c2
-rw-r--r--src/select/properties/margin_bottom.c2
-rw-r--r--src/select/properties/margin_left.c2
-rw-r--r--src/select/properties/margin_right.c2
-rw-r--r--src/select/properties/margin_top.c2
-rw-r--r--src/select/properties/max_height.c4
-rw-r--r--src/select/properties/max_width.c2
-rw-r--r--src/select/properties/min_height.c4
-rw-r--r--src/select/properties/min_width.c2
-rw-r--r--src/select/properties/opacity.c2
-rw-r--r--src/select/properties/orphans.c6
-rw-r--r--src/select/properties/outline_color.c2
-rw-r--r--src/select/properties/outline_style.c2
-rw-r--r--src/select/properties/outline_width.c2
-rw-r--r--src/select/properties/overflow_x.c2
-rw-r--r--src/select/properties/overflow_y.c2
-rw-r--r--src/select/properties/padding_bottom.c4
-rw-r--r--src/select/properties/padding_left.c2
-rw-r--r--src/select/properties/padding_right.c4
-rw-r--r--src/select/properties/padding_top.c2
-rw-r--r--src/select/properties/page_break_after.c2
-rw-r--r--src/select/properties/page_break_before.c10
-rw-r--r--src/select/properties/page_break_inside.c8
-rw-r--r--src/select/properties/pause_after.c2
-rw-r--r--src/select/properties/pause_before.c2
-rw-r--r--src/select/properties/pitch.c2
-rw-r--r--src/select/properties/pitch_range.c2
-rw-r--r--src/select/properties/play_during.c2
-rw-r--r--src/select/properties/position.c2
-rw-r--r--src/select/properties/quotes.c8
-rw-r--r--src/select/properties/richness.c2
-rw-r--r--src/select/properties/right.c2
-rw-r--r--src/select/properties/speak.c2
-rw-r--r--src/select/properties/speak_header.c2
-rw-r--r--src/select/properties/speak_numeral.c2
-rw-r--r--src/select/properties/speak_punctuation.c2
-rw-r--r--src/select/properties/speech_rate.c2
-rw-r--r--src/select/properties/stress.c2
-rw-r--r--src/select/properties/table_layout.c2
-rw-r--r--src/select/properties/text_align.c8
-rw-r--r--src/select/properties/text_decoration.c6
-rw-r--r--src/select/properties/text_indent.c4
-rw-r--r--src/select/properties/text_transform.c6
-rw-r--r--src/select/properties/top.c2
-rw-r--r--src/select/properties/unicode_bidi.c4
-rw-r--r--src/select/properties/vertical_align.c2
-rw-r--r--src/select/properties/visibility.c4
-rw-r--r--src/select/properties/voice_family.c4
-rw-r--r--src/select/properties/volume.c2
-rw-r--r--src/select/properties/white_space.c4
-rw-r--r--src/select/properties/widows.c6
-rw-r--r--src/select/properties/width.c2
-rw-r--r--src/select/properties/word_spacing.c4
-rw-r--r--src/select/properties/writing_mode.c6
-rw-r--r--src/select/properties/z_index.c2
-rw-r--r--src/select/select.c338
-rw-r--r--src/stylesheet.c114
-rw-r--r--src/stylesheet.h38
-rw-r--r--src/utils/parserutilserror.h2
-rw-r--r--src/utils/utils.c4
167 files changed, 1444 insertions, 1444 deletions
diff --git a/src/bytecode/bytecode.h b/src/bytecode/bytecode.h
index 4ac3dfb..656d7a5 100644
--- a/src/bytecode/bytecode.h
+++ b/src/bytecode/bytecode.h
@@ -14,7 +14,7 @@
#include <libcss/types.h>
#include <libcss/properties.h>
-typedef uint32_t css_code_t;
+typedef uint32_t css_code_t;
typedef enum css_properties_e opcode_t;
diff --git a/src/charset/detect.c b/src/charset/detect.c
index a6b2346..23c1bf9 100644
--- a/src/charset/detect.c
+++ b/src/charset/detect.c
@@ -13,13 +13,13 @@
#include "charset/detect.h"
#include "utils/utils.h"
-static parserutils_error css_charset_read_bom_or_charset(const uint8_t *data,
+static parserutils_error css_charset_read_bom_or_charset(const uint8_t *data,
size_t len, uint16_t *mibenum);
-static parserutils_error try_utf32_charset(const uint8_t *data,
+static parserutils_error try_utf32_charset(const uint8_t *data,
size_t len, uint16_t *result);
-static parserutils_error try_utf16_charset(const uint8_t *data,
+static parserutils_error try_utf16_charset(const uint8_t *data,
size_t len, uint16_t *result);
-static parserutils_error try_ascii_compatible_charset(const uint8_t *data,
+static parserutils_error try_ascii_compatible_charset(const uint8_t *data,
size_t len, uint16_t *result);
/**
@@ -60,7 +60,7 @@ parserutils_error css__charset_extract(const uint8_t *data, size_t len,
return PARSERUTILS_OK;
}
- /* If we've already got a charset from the linking mechanism or
+ /* If we've already got a charset from the linking mechanism or
* referring document, then we've nothing further to do */
if (*source != CSS_CHARSET_DEFAULT)
return PARSERUTILS_OK;
@@ -84,7 +84,7 @@ parserutils_error css__charset_extract(const uint8_t *data, size_t len,
* \param mibenum Pointer to location to receive MIB enum
* \return PARSERUTILS_OK on success, appropriate error otherwise
*/
-parserutils_error css_charset_read_bom_or_charset(const uint8_t *data,
+parserutils_error css_charset_read_bom_or_charset(const uint8_t *data,
size_t len, uint16_t *mibenum)
{
parserutils_error error;
@@ -99,30 +99,30 @@ parserutils_error css_charset_read_bom_or_charset(const uint8_t *data,
/* Look for BOM */
- if (data[0] == 0x00 && data[1] == 0x00 &&
+ if (data[0] == 0x00 && data[1] == 0x00 &&
data[2] == 0xFE && data[3] == 0xFF) {
- charset = parserutils_charset_mibenum_from_name("UTF-32BE",
+ charset = parserutils_charset_mibenum_from_name("UTF-32BE",
SLEN("UTF-32BE"));
} else if (data[0] == 0xFF && data[1] == 0xFE &&
data[2] == 0x00 && data[3] == 0x00) {
- charset = parserutils_charset_mibenum_from_name("UTF-32LE",
+ charset = parserutils_charset_mibenum_from_name("UTF-32LE",
SLEN("UTF-32LE"));
} else if (data[0] == 0xFE && data[1] == 0xFF) {
- charset = parserutils_charset_mibenum_from_name("UTF-16BE",
+ charset = parserutils_charset_mibenum_from_name("UTF-16BE",
SLEN("UTF-16BE"));
} else if (data[0] == 0xFF && data[1] == 0xFE) {
- charset = parserutils_charset_mibenum_from_name("UTF-16LE",
+ charset = parserutils_charset_mibenum_from_name("UTF-16LE",
SLEN("UTF-16LE"));
} else if (data[0] == 0xEF && data[1] == 0xBB && data[2] == 0xBF) {
- charset = parserutils_charset_mibenum_from_name("UTF-8",
+ charset = parserutils_charset_mibenum_from_name("UTF-8",
SLEN("UTF-8"));
}
/* BOM beats @charset.
- * UAs differ here, but none appear to match the spec.
- * The spec indicates that any @charset present in conjunction with a
- * BOM, should match the BOM. In reality, it appears UAs just take the
- * BOM as gospel and ignore any @charset rule. The w3c CSS validator
+ * UAs differ here, but none appear to match the spec.
+ * The spec indicates that any @charset present in conjunction with a
+ * BOM, should match the BOM. In reality, it appears UAs just take the
+ * BOM as gospel and ignore any @charset rule. The w3c CSS validator
* appears to do the same (at the least, it doesn't complain about a
* mismatch).
*/
@@ -150,7 +150,7 @@ parserutils_error css_charset_read_bom_or_charset(const uint8_t *data,
return PARSERUTILS_OK;
}
-static parserutils_error try_utf32_charset(const uint8_t *data,
+static parserutils_error try_utf32_charset(const uint8_t *data,
size_t len, uint16_t *result)
{
uint16_t charset = 0;
@@ -170,7 +170,7 @@ static parserutils_error try_utf32_charset(const uint8_t *data,
/* Look for "; at end of charset declaration */
for (end = start; end < data + len - 4; end += 4) {
- uint32_t c = end[0] | (end[1] << 8) |
+ uint32_t c = end[0] | (end[1] << 8) |
(end[2] << 16) | (end[3] << 24);
/* Bail if non-ASCII */
@@ -202,7 +202,7 @@ static parserutils_error try_utf32_charset(const uint8_t *data,
}
/* Ensure we have something that looks like UTF-32(LE)? */
- if ((ptr - buf == SLEN("UTF-32LE") &&
+ if ((ptr - buf == SLEN("UTF-32LE") &&
memcmp(buf, "UTF-32LE", ptr - buf) == 0) ||
(ptr - buf == SLEN("UTF-32") &&
memcmp(buf, "UTF-32", ptr - buf) == 0)) {
@@ -218,7 +218,7 @@ static parserutils_error try_utf32_charset(const uint8_t *data,
/* Look for "; at end of charset declaration */
for (end = start; end < data + len - 4; end += 4) {
- uint32_t c = end[3] | (end[2] << 8) |
+ uint32_t c = end[3] | (end[2] << 8) |
(end[1] << 16) | (end[0] << 24);
/* Bail if non-ASCII */
@@ -250,7 +250,7 @@ static parserutils_error try_utf32_charset(const uint8_t *data,
}
/* Ensure we have something that looks like UTF-32(BE)? */
- if ((ptr - buf == SLEN("UTF-32BE") &&
+ if ((ptr - buf == SLEN("UTF-32BE") &&
memcmp(buf, "UTF-32BE", ptr - buf) == 0) ||
(ptr - buf == SLEN("UTF-32") &&
memcmp(buf, "UTF-32", ptr - buf) == 0)) {
@@ -268,7 +268,7 @@ static parserutils_error try_utf32_charset(const uint8_t *data,
return PARSERUTILS_OK;
}
-static parserutils_error try_utf16_charset(const uint8_t *data,
+static parserutils_error try_utf16_charset(const uint8_t *data,
size_t len, uint16_t *result)
{
uint16_t charset = 0;
@@ -318,7 +318,7 @@ static parserutils_error try_utf16_charset(const uint8_t *data,
}
/* Ensure we have something that looks like UTF-16(LE)? */
- if ((ptr - buf == SLEN("UTF-16LE") &&
+ if ((ptr - buf == SLEN("UTF-16LE") &&
memcmp(buf, "UTF-16LE", ptr - buf) == 0) ||
(ptr - buf == SLEN("UTF-16") &&
memcmp(buf, "UTF-16", ptr - buf) == 0)) {
@@ -364,7 +364,7 @@ static parserutils_error try_utf16_charset(const uint8_t *data,
}
/* Ensure we have something that looks like UTF-16(BE)? */
- if ((ptr - buf == SLEN("UTF-16BE") &&
+ if ((ptr - buf == SLEN("UTF-16BE") &&
memcmp(buf, "UTF-16BE", ptr - buf) == 0) ||
(ptr - buf == SLEN("UTF-16") &&
memcmp(buf, "UTF-16", ptr - buf) == 0)) {
@@ -399,7 +399,7 @@ parserutils_error try_ascii_compatible_charset(const uint8_t *data, size_t len,
/* Look for "; at end of charset declaration */
for (end = start; end < data + len; end++) {
- if (*end == '"' && end < data + len - 1 &&
+ if (*end == '"' && end < data + len - 1 &&
*(end + 1) == ';')
break;
}
diff --git a/src/lex/lex.c b/src/lex/lex.c
index 0f956db..2be1145 100644
--- a/src/lex/lex.c
+++ b/src/lex/lex.c
@@ -6,7 +6,7 @@
*/
/** \file CSS lexer
- *
+ *
* See docs/Tokens for the production rules used by this lexer.
*
* See docs/Lexer for the inferred first characters for each token.
@@ -36,15 +36,15 @@
#include "utils/parserutilserror.h"
#include "utils/utils.h"
-/** \todo Optimisation -- we're currently revisiting a bunch of input
- * characters (Currently, we're calling parserutils_inputstream_peek
- * about 1.5x the number of characters in the input stream). Ideally,
- * we'll visit each character in the input exactly once. In reality,
- * the upper bound is twice, due to the need, in some cases, to read
- * one character beyond the end of a token's input to detect the end
- * of the token. Resumability adds a little overhead here, unless
- * we're somewhat more clever when it comes to having support for
- * restarting mid-escape sequence. Currently, we rewind back to the
+/** \todo Optimisation -- we're currently revisiting a bunch of input
+ * characters (Currently, we're calling parserutils_inputstream_peek
+ * about 1.5x the number of characters in the input stream). Ideally,
+ * we'll visit each character in the input exactly once. In reality,
+ * the upper bound is twice, due to the need, in some cases, to read
+ * one character beyond the end of a token's input to detect the end
+ * of the token. Resumability adds a little overhead here, unless
+ * we're somewhat more clever when it comes to having support for
+ * restarting mid-escape sequence. Currently, we rewind back to the
* start of the sequence and process the whole thing again.
*/
@@ -53,17 +53,17 @@ enum {
sATKEYWORD = 1,
sSTRING = 2,
sHASH = 3,
- sNUMBER = 4,
+ sNUMBER = 4,
sCDO = 5,
sCDC = 6,
sS = 7,
sCOMMENT = 8,
- sMATCH = 9,
+ sMATCH = 9,
sURI = 10,
sIDENT = 11,
sESCAPEDIDENT = 12,
sURL = 13,
- sUCR = 14
+ sUCR = 14
};
/**
@@ -73,16 +73,16 @@ struct css_lexer
{
parserutils_inputstream *input; /**< Inputstream containing CSS */
- size_t bytesReadForToken; /**< Total bytes read from the
+ size_t bytesReadForToken; /**< Total bytes read from the
* inputstream for the current token */
css_token token; /**< The current token */
- bool escapeSeen; /**< Whether an escape sequence has
+ bool escapeSeen; /**< Whether an escape sequence has
* been seen while processing the input
* for the current token */
- parserutils_buffer *unescapedTokenData; /**< Buffer containing
- * unescaped token data
+ parserutils_buffer *unescapedTokenData; /**< Buffer containing
+ * unescaped token data
* (used iff escapeSeen == true)
*/
@@ -91,13 +91,13 @@ struct css_lexer
struct {
uint8_t first; /**< First character read for token */
- size_t origBytes; /**< Storage of current number of
+ size_t origBytes; /**< Storage of current number of
* bytes read, for rewinding */
- bool lastWasStar; /**< Whether the previous character
+ bool lastWasStar; /**< Whether the previous character
* was an asterisk */
bool lastWasCR; /**< Whether the previous character
* was CR */
- size_t bytesForURL; /**< Input bytes read for "url(", for
+ size_t bytesForURL; /**< Input bytes read for "url(", for
* rewinding */
size_t dataLenForURL; /**< Output length for "url(", for
* rewinding */
@@ -121,7 +121,7 @@ do { \
(lexer)->currentCol += (len); \
} while(0) \
-static css_error appendToTokenData(css_lexer *lexer,
+static css_error appendToTokenData(css_lexer *lexer,
const uint8_t *data, size_t len);
static css_error emitToken(css_lexer *lexer, css_token_type type,
css_token **token);
@@ -287,7 +287,7 @@ css_error css__lexer_get_token(css_lexer *lexer, css_token **token)
return S(lexer, token);
case sCOMMENT:
error = Comment(lexer, token);
- if (!lexer->emit_comments && error == CSS_OK &&
+ if (!lexer->emit_comments && error == CSS_OK &&
(*token)->type == CSS_TOKEN_COMMENT)
goto start;
return error;
@@ -324,7 +324,7 @@ css_error css__lexer_get_token(css_lexer *lexer, css_token **token)
* \return CSS_OK on success, appropriate error otherwise
*
* This should not be called directly without good reason. Use the APPEND()
- * macro instead.
+ * macro instead.
*/
css_error appendToTokenData(css_lexer *lexer, const uint8_t *data, size_t len)
{
@@ -358,16 +358,16 @@ css_error emitToken(css_lexer *lexer, css_token_type type,
t->type = type;
- /* Calculate token data start pointer. We have to do this here as
+ /* Calculate token data start pointer. We have to do this here as
* the inputstream's buffer may have moved under us. */
if (lexer->escapeSeen) {
t->data.data = lexer->unescapedTokenData->data;
} else {
size_t clen;
const uint8_t *data;
- parserutils_error error;
+ parserutils_error error;
- error = parserutils_inputstream_peek(lexer->input, 0,
+ error = parserutils_inputstream_peek(lexer->input, 0,
&data, &clen);
#ifndef NDEBUG
@@ -439,7 +439,7 @@ css_error emitToken(css_lexer *lexer, css_token_type type,
}
/* Strip any trailing quote */
- if (t->data.len > 0 && (t->data.data[t->data.len - 1] == '"' ||
+ if (t->data.len > 0 && (t->data.data[t->data.len - 1] == '"' ||
t->data.data[t->data.len - 1] == '\'')) {
t->data.len -= 1;
}
@@ -487,14 +487,14 @@ css_error AtKeyword(css_lexer *lexer, css_token **token)
parserutils_error perror;
enum { Initial = 0, Escape = 1, NMChar = 2 };
- /* ATKEYWORD = '@' ident
- *
+ /* ATKEYWORD = '@' ident
+ *
* The '@' has been consumed.
*/
switch (lexer->substate) {
case Initial:
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -561,15 +561,15 @@ css_error CDCOrIdentOrFunctionOrNPD(css_lexer *lexer, css_token **token)
* PERCENTAGE = num '%'
* DIMENSION = num ident
*
- * The first dash has been consumed. Thus, we must consume the next
- * character in the stream. If it's a dash, then we're dealing with
- * CDC. If it's a digit or dot, then we're dealing with NPD.
+ * The first dash has been consumed. Thus, we must consume the next
+ * character in the stream. If it's a dash, then we're dealing with
+ * CDC. If it's a digit or dot, then we're dealing with NPD.
* Otherwise, we're dealing with IDENT/FUNCTION.
*/
switch (lexer->substate) {
case Initial:
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -617,7 +617,7 @@ css_error CDCOrIdentOrFunctionOrNPD(css_lexer *lexer, css_token **token)
lexer->substate = Gt;
/* Ok, so we're dealing with CDC. Expect a '>' */
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -677,14 +677,14 @@ css_error CDO(css_lexer *lexer, css_token **token)
enum { Initial = 0, Dash1 = 1, Dash2 = 2 };
/* CDO = "<!--"
- *
+ *
* The '<' has been consumed
*/
switch (lexer->substate) {
case Initial:
/* Expect '!' */
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -707,7 +707,7 @@ css_error CDO(css_lexer *lexer, css_token **token)
lexer->substate = Dash1;
/* Expect '-' */
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -736,7 +736,7 @@ css_error CDO(css_lexer *lexer, css_token **token)
lexer->substate = Dash2;
/* Expect '-' */
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -778,7 +778,7 @@ css_error Comment(css_lexer *lexer, css_token **token)
*/
switch (lexer->substate) {
case Initial:
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -792,7 +792,7 @@ css_error Comment(css_lexer *lexer, css_token **token)
return emitToken(lexer, CSS_TOKEN_CHAR, token);
APPEND(lexer, cptr, clen);
-
+
/* Fall through */
case InComment:
lexer->substate = InComment;
@@ -800,12 +800,12 @@ css_error Comment(css_lexer *lexer, css_token **token)
while (1) {
perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
- if (perror != PARSERUTILS_OK &&
+ if (perror != PARSERUTILS_OK &&
perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
if (perror == PARSERUTILS_EOF) {
- /* As per unterminated strings,
+ /* As per unterminated strings,
* we ignore unterminated comments. */
return emitToken(lexer, CSS_TOKEN_EOF, token);
}
@@ -863,10 +863,10 @@ css_error EscapedIdentOrFunction(css_lexer *lexer, css_token **token)
}
css_error Hash(css_lexer *lexer, css_token **token)
-{
+{
css_error error;
-
- /* HASH = '#' name = '#' nmchar+
+
+ /* HASH = '#' name = '#' nmchar+
*
* The '#' has been consumed.
*/
@@ -909,7 +909,7 @@ css_error IdentOrFunction(css_lexer *lexer, css_token **token)
case Bracket:
lexer->substate = Bracket;
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -996,14 +996,14 @@ css_error NumberOrPercentageOrDimension(css_lexer *lexer, css_token **token)
size_t clen;
css_error error;
parserutils_error perror;
- enum { Initial = 0, Dot = 1, MoreDigits = 2,
+ enum { Initial = 0, Dot = 1, MoreDigits = 2,
Suffix = 3, NMChars = 4, Escape = 5 };
/* NUMBER = num = [-+]? ([0-9]+ | [0-9]* '.' [0-9]+)
* PERCENTAGE = num '%'
* DIMENSION = num ident
*
- * The sign, or sign and first digit or dot,
+ * The sign, or sign and first digit or dot,
* or first digit, or '.' has been consumed.
*/
@@ -1017,7 +1017,7 @@ css_error NumberOrPercentageOrDimension(css_lexer *lexer, css_token **token)
case Dot:
lexer->substate = Dot;
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -1027,7 +1027,7 @@ css_error NumberOrPercentageOrDimension(css_lexer *lexer, css_token **token)
lexer->context.first == '+'))
return emitToken(lexer, CSS_TOKEN_CHAR, token);
else
- return emitToken(lexer, CSS_TOKEN_NUMBER,
+ return emitToken(lexer, CSS_TOKEN_NUMBER,
token);
}
@@ -1062,7 +1062,7 @@ css_error NumberOrPercentageOrDimension(css_lexer *lexer, css_token **token)
suffix:
lexer->substate = Suffix;
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -1072,7 +1072,7 @@ css_error NumberOrPercentageOrDimension(css_lexer *lexer, css_token **token)
lexer->context.first == '+'))
return emitToken(lexer, CSS_TOKEN_CHAR, token);
else
- return emitToken(lexer, CSS_TOKEN_NUMBER,
+ return emitToken(lexer, CSS_TOKEN_NUMBER,
token);
}
@@ -1119,7 +1119,7 @@ css_error NumberOrPercentageOrDimension(css_lexer *lexer, css_token **token)
lexer->bytesReadForToken -= 1;
/* This can only be a number */
- return emitToken(lexer,
+ return emitToken(lexer,
CSS_TOKEN_NUMBER, token);
}
@@ -1137,7 +1137,7 @@ css_error S(css_lexer *lexer, css_token **token)
css_error error;
/* S = wc*
- *
+ *
* The first whitespace character has been consumed.
*/
@@ -1209,7 +1209,7 @@ start:
lexer->substate = 0;
lexer->context.origBytes = lexer->bytesReadForToken;
return Hash(lexer, token);
- case '0': case '1': case '2': case '3': case '4':
+ case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
case '.': case '+':
lexer->state = sNUMBER;
@@ -1252,17 +1252,17 @@ start:
lexer->state = sURI;
lexer->substate = 0;
return URIOrUnicodeRangeOrIdentOrFunction(lexer, token);
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
+ case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+ case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
- case 's': case 't': /* 'u'*/ case 'v': case 'w': case 'x':
+ case 's': case 't': /* 'u'*/ case 'v': case 'w': case 'x':
case 'y': case 'z':
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
case 'S': case 'T': /* 'U'*/ case 'V': case 'W': case 'X':
case 'Y': case 'Z':
- case '_':
+ case '_':
lexer->state = sIDENT;
lexer->substate = 0;
return IdentOrFunction(lexer, token);
@@ -1289,13 +1289,13 @@ css_error String(css_lexer *lexer, css_token **token)
return error;
/* EOF will be reprocessed in Start() */
- return emitToken(lexer,
- error == CSS_INVALID ? CSS_TOKEN_INVALID_STRING
- : CSS_TOKEN_STRING,
+ return emitToken(lexer,
+ error == CSS_INVALID ? CSS_TOKEN_INVALID_STRING
+ : CSS_TOKEN_STRING,
token);
}
-css_error URIOrUnicodeRangeOrIdentOrFunction(css_lexer *lexer,
+css_error URIOrUnicodeRangeOrIdentOrFunction(css_lexer *lexer,
css_token **token)
{
const uint8_t *cptr;
@@ -1303,7 +1303,7 @@ css_error URIOrUnicodeRangeOrIdentOrFunction(css_lexer *lexer,
size_t clen;
parserutils_error perror;
- /* URI = "url(" w (string | urlchar*) w ')'
+ /* URI = "url(" w (string | urlchar*) w ')'
* UNICODE-RANGE = [Uu] '+' [0-9a-fA-F?]{1,6}(-[0-9a-fA-F]{1,6})?
* IDENT = ident = [-]? nmstart nmchar*
* FUNCTION = ident '(' = [-]? nmstart nmchar* '('
@@ -1311,7 +1311,7 @@ css_error URIOrUnicodeRangeOrIdentOrFunction(css_lexer *lexer,
* The 'u' (or 'U') has been consumed.
*/
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -1351,17 +1351,17 @@ css_error URI(css_lexer *lexer, css_token **token)
size_t clen;
css_error error;
parserutils_error perror;
- enum { Initial = 0, LParen = 1, W1 = 2, Quote = 3,
+ enum { Initial = 0, LParen = 1, W1 = 2, Quote = 3,
URL = 4, W2 = 5, RParen = 6, String = 7 };
- /* URI = "url(" w (string | urlchar*) w ')'
+ /* URI = "url(" w (string | urlchar*) w ')'
*
* 'u' and 'r' have been consumed.
*/
switch (lexer->substate) {
case Initial:
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -1385,7 +1385,7 @@ css_error URI(css_lexer *lexer, css_token **token)
case LParen:
lexer->substate = LParen;
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -1444,9 +1444,9 @@ css_error URI(css_lexer *lexer, css_token **token)
goto string;
}
- /* Potential minor optimisation: If string is more common,
- * then fall through to that state and branch for the URL
- * state. Need to investigate a reasonably large corpus of
+ /* Potential minor optimisation: If string is more common,
+ * then fall through to that state and branch for the URL
+ * state. Need to investigate a reasonably large corpus of
* real-world data to determine if this is worthwhile. */
/* Fall through */
@@ -1472,7 +1472,7 @@ css_error URI(css_lexer *lexer, css_token **token)
case RParen:
lexer->substate = RParen;
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -1529,7 +1529,7 @@ css_error UnicodeRange(css_lexer *lexer, css_token **token)
enum { Initial = 0, MoreDigits = 1 };
/* UNICODE-RANGE = [Uu] '+' [0-9a-fA-F?]{1,6}(-[0-9a-fA-F]{1,6})?
- *
+ *
* "U+" has been consumed.
*/
@@ -1539,7 +1539,7 @@ css_error UnicodeRange(css_lexer *lexer, css_token **token)
for (; lexer->context.hexCount < 6; lexer->context.hexCount++) {
perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
- if (perror != PARSERUTILS_OK &&
+ if (perror != PARSERUTILS_OK &&
perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -1549,10 +1549,10 @@ css_error UnicodeRange(css_lexer *lexer, css_token **token)
lexer->bytesReadForToken -= 1;
t->data.len -= 1;
/* u == IDENT */
- return emitToken(lexer,
+ return emitToken(lexer,
CSS_TOKEN_IDENT, token);
} else {
- return emitToken(lexer,
+ return emitToken(lexer,
CSS_TOKEN_UNICODE_RANGE, token);
}
}
@@ -1573,24 +1573,24 @@ css_error UnicodeRange(css_lexer *lexer, css_token **token)
t->data.len -= 1;
/* 'u' == IDENT */
return emitToken(lexer, CSS_TOKEN_IDENT, token);
- }
+ }
if (lexer->context.hexCount == 6) {
/* Consumed 6 valid characters. Look for '-' */
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
- if (perror != PARSERUTILS_OK &&
+ if (perror != PARSERUTILS_OK &&
perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
if (perror == PARSERUTILS_EOF)
- return emitToken(lexer,
+ return emitToken(lexer,
CSS_TOKEN_UNICODE_RANGE, token);
c = *cptr;
}
- /* If we've got a '-', then we may have a
+ /* If we've got a '-', then we may have a
* second range component */
if (c != '-') {
/* Reached the end of the range */
@@ -1608,7 +1608,7 @@ css_error UnicodeRange(css_lexer *lexer, css_token **token)
/* Consume up to 6 hex digits */
for (; lexer->context.hexCount < 6; lexer->context.hexCount++) {
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK &&
perror != PARSERUTILS_EOF)
@@ -1621,7 +1621,7 @@ css_error UnicodeRange(css_lexer *lexer, css_token **token)
t->data.len -= 1;
}
- return emitToken(lexer,
+ return emitToken(lexer,
CSS_TOKEN_UNICODE_RANGE, token);
}
@@ -1659,7 +1659,7 @@ css_error consumeDigits(css_lexer *lexer)
/* Consume all digits */
do {
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -1685,12 +1685,12 @@ css_error consumeEscape(css_lexer *lexer, bool nl)
css_error error;
parserutils_error perror;
- /* escape = unicode | '\' [^\n\r\f0-9a-fA-F]
- *
+ /* escape = unicode | '\' [^\n\r\f0-9a-fA-F]
+ *
* The '\' has been consumed.
*/
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -1723,7 +1723,7 @@ css_error consumeEscape(css_lexer *lexer, bool nl)
/* -1 to skip '\\' */
perror = parserutils_buffer_append(
- lexer->unescapedTokenData,
+ lexer->unescapedTokenData,
sdata, lexer->bytesReadForToken - 1);
if (perror != PARSERUTILS_OK)
return css_error_from_parserutils_error(perror);
@@ -1747,7 +1747,7 @@ css_error consumeEscape(css_lexer *lexer, bool nl)
/* If we're handling escaped newlines, convert CR(LF)? to LF */
if (nl && c == '\r') {
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken + clen, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -1799,7 +1799,7 @@ css_error consumeNMChars(css_lexer *lexer)
/* nmchar = [a-zA-Z] | '-' | '_' | nonascii | escape */
do {
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -1818,13 +1818,13 @@ css_error consumeNMChars(css_lexer *lexer)
error = consumeEscape(lexer, false);
if (error != CSS_OK) {
- /* Rewind '\\', so we do the
+ /* Rewind '\\', so we do the
* right thing next time */
lexer->bytesReadForToken -= clen;
/* Convert either EOF or INVALID into OK.
* This will cause the caller to believe that
- * all NMChars in the sequence have been
+ * all NMChars in the sequence have been
* processed (and thus proceed to the next
* state). Eventually, the '\\' will be output
* as a CHAR. */
@@ -1855,7 +1855,7 @@ css_error consumeString(css_lexer *lexer)
*/
do {
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -1913,7 +1913,7 @@ css_error consumeStringChars(css_lexer *lexer)
error = consumeEscape(lexer, true);
if (error != CSS_OK) {
- /* Rewind '\\', so we do the
+ /* Rewind '\\', so we do the
* right thing next time. */
lexer->bytesReadForToken -= clen;
@@ -1946,14 +1946,14 @@ css_error consumeUnicode(css_lexer *lexer, uint32_t ucs)
css_error error;
parserutils_error perror;
- /* unicode = '\' [0-9a-fA-F]{1,6} wc?
+ /* unicode = '\' [0-9a-fA-F]{1,6} wc?
*
* The '\' and the first digit have been consumed.
*/
/* Attempt to consume a further five hex digits */
for (count = 0; count < 5; count++) {
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF) {
/* Rewind what we've read */
@@ -2027,7 +2027,7 @@ css_error consumeUnicode(css_lexer *lexer, uint32_t ucs)
/* We can't use the APPEND() macro here as we want to rewind correctly
* on error. Additionally, lexer->bytesReadForToken has already been
* advanced */
- error = appendToTokenData(lexer, (const uint8_t *) utf8,
+ error = appendToTokenData(lexer, (const uint8_t *) utf8,
sizeof(utf8) - utf8len);
if (error != CSS_OK) {
/* Rewind what we've read */
@@ -2049,7 +2049,7 @@ css_error consumeUnicode(css_lexer *lexer, uint32_t ucs)
lexer->currentLine++;
} else {
/* +2 for '\' and first digit */
- lexer->currentCol += lexer->bytesReadForToken -
+ lexer->currentCol += lexer->bytesReadForToken -
bytesReadInit + 2;
}
@@ -2067,7 +2067,7 @@ css_error consumeURLChars(css_lexer *lexer)
/* urlchar = [\t!#-&(*-~] | nonascii | escape */
do {
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -2092,7 +2092,7 @@ css_error consumeURLChars(css_lexer *lexer)
/* Convert either EOF or INVALID into OK.
* This will cause the caller to believe that
- * all URLChars in the sequence have been
+ * all URLChars in the sequence have been
* processed (and thus proceed to the next
* state). Eventually, the '\\' will be output
* as a CHAR. */
@@ -2115,7 +2115,7 @@ css_error consumeWChars(css_lexer *lexer)
parserutils_error perror;
do {
- perror = parserutils_inputstream_peek(lexer->input,
+ perror = parserutils_inputstream_peek(lexer->input,
lexer->bytesReadForToken, &cptr, &clen);
if (perror != PARSERUTILS_OK && perror != PARSERUTILS_EOF)
return css_error_from_parserutils_error(perror);
@@ -2155,7 +2155,7 @@ css_error consumeWChars(css_lexer *lexer)
bool startNMChar(uint8_t c)
{
- return c == '_' || ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') ||
+ return c == '_' || ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') ||
('0' <= c && c <= '9') || c == '-' || c >= 0x80 || c == '\\';
}
diff --git a/src/lex/lex.h b/src/lex/lex.h
index 4a663ea..ac21444 100644
--- a/src/lex/lex.h
+++ b/src/lex/lex.h
@@ -35,18 +35,18 @@ typedef union css_lexer_optparams {
/**
* Token type
*/
-typedef enum css_token_type {
+typedef enum css_token_type {
CSS_TOKEN_IDENT, CSS_TOKEN_ATKEYWORD, CSS_TOKEN_HASH,
- CSS_TOKEN_FUNCTION, CSS_TOKEN_STRING, CSS_TOKEN_INVALID_STRING,
- CSS_TOKEN_URI, CSS_TOKEN_UNICODE_RANGE, CSS_TOKEN_CHAR,
+ CSS_TOKEN_FUNCTION, CSS_TOKEN_STRING, CSS_TOKEN_INVALID_STRING,
+ CSS_TOKEN_URI, CSS_TOKEN_UNICODE_RANGE, CSS_TOKEN_CHAR,
CSS_TOKEN_NUMBER, CSS_TOKEN_PERCENTAGE, CSS_TOKEN_DIMENSION,
/* Those tokens that want strings interned appear above */
CSS_TOKEN_LAST_INTERN,
- CSS_TOKEN_CDO, CSS_TOKEN_CDC, CSS_TOKEN_S, CSS_TOKEN_COMMENT,
- CSS_TOKEN_INCLUDES, CSS_TOKEN_DASHMATCH, CSS_TOKEN_PREFIXMATCH,
- CSS_TOKEN_SUFFIXMATCH, CSS_TOKEN_SUBSTRINGMATCH, CSS_TOKEN_EOF
+ CSS_TOKEN_CDO, CSS_TOKEN_CDC, CSS_TOKEN_S, CSS_TOKEN_COMMENT,
+ CSS_TOKEN_INCLUDES, CSS_TOKEN_DASHMATCH, CSS_TOKEN_PREFIXMATCH,
+ CSS_TOKEN_SUFFIXMATCH, CSS_TOKEN_SUBSTRINGMATCH, CSS_TOKEN_EOF
} css_token_type;
/**
@@ -55,13 +55,13 @@ typedef enum css_token_type {
typedef struct css_token {
css_token_type type;
- struct {
- uint8_t *data;
- size_t len;
- } data;
+ struct {
+ uint8_t *data;
+ size_t len;
+ } data;
lwc_string *idata;
-
+
uint32_t col;
uint32_t line;
} css_token;
@@ -69,7 +69,7 @@ typedef struct css_token {
css_error css__lexer_create(parserutils_inputstream *input, css_lexer **lexer);
css_error css__lexer_destroy(css_lexer *lexer);
-css_error css__lexer_setopt(css_lexer *lexer, css_lexer_opttype type,
+css_error css__lexer_setopt(css_lexer *lexer, css_lexer_opttype type,
css_lexer_optparams *params);
css_error css__lexer_get_token(css_lexer *lexer, css_token **token);
diff --git a/src/parse/font_face.c b/src/parse/font_face.c
index 8eab006..f17d50e 100644
--- a/src/parse/font_face.c
+++ b/src/parse/font_face.c
@@ -15,22 +15,22 @@
#include "parse/properties/utils.h"
#include "select/font_face.h"
-static bool font_rule_font_family_reserved(css_language *c,
+static bool font_rule_font_family_reserved(css_language *c,
const css_token *ident)
{
bool match;
return (lwc_string_caseless_isequal(ident->idata, c->strings[SERIF],
&match) == lwc_error_ok && match) ||
- (lwc_string_caseless_isequal(ident->idata,
- c->strings[SANS_SERIF], &match) == lwc_error_ok &&
+ (lwc_string_caseless_isequal(ident->idata,
+ c->strings[SANS_SERIF], &match) == lwc_error_ok &&
match) ||
(lwc_string_caseless_isequal(ident->idata, c->strings[CURSIVE],
&match) == lwc_error_ok && match) ||
(lwc_string_caseless_isequal(ident->idata, c->strings[FANTASY],
&match) == lwc_error_ok && match) ||
- (lwc_string_caseless_isequal(ident->idata,
- c->strings[MONOSPACE], &match) == lwc_error_ok &&
+ (lwc_string_caseless_isequal(ident->idata,
+ c->strings[MONOSPACE], &match) == lwc_error_ok &&
match) ||
(lwc_string_caseless_isequal(ident->idata, c->strings[INHERIT],
&match) == lwc_error_ok && match) ||
@@ -40,9 +40,9 @@ static bool font_rule_font_family_reserved(css_language *c,
&match) == lwc_error_ok && match);
}
-static css_error font_face_parse_font_family(css_language *c,
+static css_error font_face_parse_font_family(css_language *c,
const parserutils_vector *vector, int *ctx,
- css_font_face *font_face)
+ css_font_face *font_face)
{
css_error error;
lwc_string *string;
@@ -58,9 +58,9 @@ static css_error font_face_parse_font_family(css_language *c,
return CSS_OK;
}
-
-static css_error font_face_src_parse_format(css_language *c,
- const parserutils_vector *vector, int *ctx,
+
+static css_error font_face_src_parse_format(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_font_face_format *format)
{
bool match;
@@ -68,8 +68,8 @@ static css_error font_face_src_parse_format(css_language *c,
*format = CSS_FONT_FACE_FORMAT_UNSPECIFIED;
- /* 'format(' STRING [ ',' STRING ]* ')'
- *
+ /* 'format(' STRING [ ',' STRING ]* ')'
+ *
* 'format(' already consumed
*/
@@ -80,27 +80,27 @@ static css_error font_face_src_parse_format(css_language *c,
if (token == NULL || token->type != CSS_TOKEN_STRING)
return CSS_INVALID;
- if (lwc_string_isequal(token->idata,
- c->strings[WOFF], &match) == lwc_error_ok &&
+ if (lwc_string_isequal(token->idata,
+ c->strings[WOFF], &match) == lwc_error_ok &&
match) {
*format |= CSS_FONT_FACE_FORMAT_WOFF;
- } else if ((lwc_string_isequal(token->idata,
+ } else if ((lwc_string_isequal(token->idata,
c->strings[TRUETYPE], &match) == lwc_error_ok &&
match) ||
- (lwc_string_isequal(token->idata,
+ (lwc_string_isequal(token->idata,
c->strings[OPENTYPE], &match) == lwc_error_ok &&
match)) {
*format |= CSS_FONT_FACE_FORMAT_OPENTYPE;
- } else if (lwc_string_isequal(token->idata,
- c->strings[EMBEDDED_OPENTYPE],
+ } else if (lwc_string_isequal(token->idata,
+ c->strings[EMBEDDED_OPENTYPE],
&match) == lwc_error_ok && match) {
*format |= CSS_FONT_FACE_FORMAT_EMBEDDED_OPENTYPE;
- } else if (lwc_string_isequal(token->idata,
- c->strings[SVG], &match) == lwc_error_ok &&
+ } else if (lwc_string_isequal(token->idata,
+ c->strings[SVG], &match) == lwc_error_ok &&
match) {
*format |= CSS_FONT_FACE_FORMAT_SVG;
} else {
- /* The spec gives a list of possible strings, which
+ /* The spec gives a list of possible strings, which
* hints that unknown strings should be parse errors,
* but it also talks about "unknown font formats",
* so we treat any string we don't know not as a parse
@@ -119,8 +119,8 @@ static css_error font_face_src_parse_format(css_language *c,
return CSS_OK;
}
-static css_error font_face_src_parse_spec_or_name(css_language *c,
- const parserutils_vector *vector, int *ctx,
+static css_error font_face_src_parse_spec_or_name(css_language *c,
+ const parserutils_vector *vector, int *ctx,
lwc_string **location,
css_font_face_location_type *location_type,
css_font_face_format *format)
@@ -138,12 +138,12 @@ static css_error font_face_src_parse_spec_or_name(css_language *c,
consumeWhitespace(vector, ctx);
token = parserutils_vector_iterate(vector, ctx);
- if (token == NULL)
+ if (token == NULL)
return CSS_INVALID;
if (token->type == CSS_TOKEN_URI) {
error = c->sheet->resolve(c->sheet->resolve_pw,
- c->sheet->url, token->idata,
+ c->sheet->url, token->idata,
location);
if (error != CSS_OK)
return error;
@@ -154,10 +154,10 @@ static css_error font_face_src_parse_spec_or_name(css_language *c,
token = parserutils_vector_peek(vector, *ctx);
if (token != NULL && token->type == CSS_TOKEN_FUNCTION &&
- lwc_string_caseless_isequal(token->idata,
- c->strings[FORMAT], &match) == lwc_error_ok &&
+ lwc_string_caseless_isequal(token->idata,
+ c->strings[FORMAT], &match) == lwc_error_ok &&
match) {
- parserutils_vector_iterate(vector, ctx);
+ parserutils_vector_iterate(vector, ctx);
error = font_face_src_parse_format(c, vector, ctx,
format);
@@ -167,8 +167,8 @@ static css_error font_face_src_parse_spec_or_name(css_language *c,
}
}
} else if (token->type == CSS_TOKEN_FUNCTION &&
- lwc_string_caseless_isequal(token->idata,
- c->strings[LOCAL],
+ lwc_string_caseless_isequal(token->idata,
+ c->strings[LOCAL],
&match) == lwc_error_ok && match) {
consumeWhitespace(vector, ctx);
@@ -179,7 +179,7 @@ static css_error font_face_src_parse_spec_or_name(css_language *c,
consumeWhitespace(vector, ctx);
- token = parserutils_vector_iterate(vector, ctx);
+ token = parserutils_vector_iterate(vector, ctx);
if (token == NULL || tokenIsChar(token, ')') == false) {
lwc_string_unref(*location);
return CSS_INVALID;
@@ -193,8 +193,8 @@ static css_error font_face_src_parse_spec_or_name(css_language *c,
return CSS_OK;
}
-static css_error font_face_parse_src(css_language *c,
- const parserutils_vector *vector, int *ctx,
+static css_error font_face_parse_src(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_font_face *font_face)
{
int orig_ctx = *ctx;
@@ -213,11 +213,11 @@ static css_error font_face_parse_src(css_language *c,
/* Create one css_font_face_src for each consecutive location and
* [potentially] type pair in the comma-separated list
*/
- do {
+ do {
lwc_string *location;
css_font_face_location_type location_type =
CSS_FONT_FACE_LOCATION_TYPE_UNSPECIFIED;
- css_font_face_format format =
+ css_font_face_format format =
CSS_FONT_FACE_FORMAT_UNSPECIFIED;
error = font_face_src_parse_spec_or_name(c, vector, ctx,
@@ -225,10 +225,10 @@ static css_error font_face_parse_src(css_language *c,
if (error != CSS_OK)
goto cleanup;
- /* This will be inefficient if there are a lot of locations -
+ /* This will be inefficient if there are a lot of locations -
* probably not a problem in practice.
*/
- new_srcs = realloc(srcs,
+ new_srcs = realloc(srcs,
(n_srcs + 1) * sizeof(css_font_face_src));
if (new_srcs == NULL) {
error = CSS_NOMEM;
@@ -240,7 +240,7 @@ static css_error font_face_parse_src(css_language *c,
srcs[n_srcs].bits[0] = format << 2 | location_type;
++n_srcs;
-
+
consumeWhitespace(vector, ctx);
token = parserutils_vector_iterate(vector, ctx);
} while (token != NULL && tokenIsChar(token, ','));
@@ -250,7 +250,7 @@ static css_error font_face_parse_src(css_language *c,
cleanup:
if (error != CSS_OK) {
*ctx = orig_ctx;
- if (srcs != NULL)
+ if (srcs != NULL)
free(srcs);
}
@@ -273,16 +273,16 @@ static css_error font_face_parse_font_style(css_language *c,
if ((token == NULL) || ((token->type != CSS_TOKEN_IDENT))) {
*ctx = orig_ctx;
return CSS_INVALID;
- }
-
- if ((lwc_string_caseless_isequal(token->idata,
+ }
+
+ if ((lwc_string_caseless_isequal(token->idata,
c->strings[NORMAL], &match) == lwc_error_ok && match)) {
style = CSS_FONT_STYLE_NORMAL;
- } else if ((lwc_string_caseless_isequal(token->idata,
+ } else if ((lwc_string_caseless_isequal(token->idata,
c->strings[ITALIC], &match) == lwc_error_ok && match)) {
style = CSS_FONT_STYLE_ITALIC;
- } else if ((lwc_string_caseless_isequal(token->idata,
- c->strings[OBLIQUE], &match) == lwc_error_ok &&
+ } else if ((lwc_string_caseless_isequal(token->idata,
+ c->strings[OBLIQUE], &match) == lwc_error_ok &&
match)) {
style = CSS_FONT_STYLE_OBLIQUE;
} else {
@@ -294,12 +294,12 @@ static css_error font_face_parse_font_style(css_language *c,
} else {
*ctx = orig_ctx;
}
-
+
return error;
}
-static css_error font_face_parse_font_weight(css_language *c,
- const parserutils_vector *vector, int *ctx,
+static css_error font_face_parse_font_weight(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_font_face *font_face)
{
int orig_ctx = *ctx;
@@ -308,7 +308,7 @@ static css_error font_face_parse_font_weight(css_language *c,
enum css_font_weight_e weight = 0;
bool match;
- /* NUMBER (100, 200, 300, 400, 500, 600, 700, 800, 900) |
+ /* NUMBER (100, 200, 300, 400, 500, 600, 700, 800, 900) |
* IDENT (normal, bold) */
token = parserutils_vector_iterate(vector, ctx);
if (token == NULL || (token->type != CSS_TOKEN_IDENT &&
@@ -319,7 +319,7 @@ static css_error font_face_parse_font_weight(css_language *c,
if (token->type == CSS_TOKEN_NUMBER) {
size_t consumed = 0;
- css_fixed num = css__number_from_lwc_string(token->idata,
+ css_fixed num = css__number_from_lwc_string(token->idata,
true, &consumed);
/* Invalid if there are trailing characters */
if (consumed != lwc_string_length(token->idata)) {
@@ -339,10 +339,10 @@ static css_error font_face_parse_font_weight(css_language *c,
case 900: weight = CSS_FONT_WEIGHT_900; break;
default: error = CSS_INVALID;
}
- } else if ((lwc_string_caseless_isequal(token->idata,
+ } else if ((lwc_string_caseless_isequal(token->idata,
c->strings[NORMAL], &match) == lwc_error_ok && match)) {
weight = CSS_FONT_WEIGHT_NORMAL;
- } else if ((lwc_string_caseless_isequal(token->idata,
+ } else if ((lwc_string_caseless_isequal(token->idata,
c->strings[BOLD], &match) == lwc_error_ok && match)) {
weight = CSS_FONT_WEIGHT_BOLD;
} else {
@@ -350,7 +350,7 @@ static css_error font_face_parse_font_weight(css_language *c,
}
if (error == CSS_OK) {
- font_face->bits[0] = (font_face->bits[0] & 0xc3) |
+ font_face->bits[0] = (font_face->bits[0] & 0xc3) |
(weight << 2);
} else {
*ctx = orig_ctx;
@@ -372,7 +372,7 @@ static css_error font_face_parse_font_weight(css_language *c,
* CSS_INVALID on invalid syntax,
* CSS_NOMEM on memory exhaustion
*/
-css_error css__parse_font_descriptor(css_language *c,
+css_error css__parse_font_descriptor(css_language *c,
const css_token *descriptor, const parserutils_vector *vector,
int *ctx, css_rule_font_face *rule)
{
@@ -388,24 +388,24 @@ css_error css__parse_font_descriptor(css_language *c,
rule->font_face = font_face;
}
-
- if (lwc_string_caseless_isequal(descriptor->idata,
- c->strings[FONT_FAMILY], &match) == lwc_error_ok &&
+
+ if (lwc_string_caseless_isequal(descriptor->idata,
+ c->strings[FONT_FAMILY], &match) == lwc_error_ok &&
match) {
return font_face_parse_font_family(c, vector, ctx, font_face);
} else if (lwc_string_caseless_isequal(descriptor->idata,
c->strings[SRC], &match) == lwc_error_ok && match) {
return font_face_parse_src(c, vector, ctx, font_face);
} else if (lwc_string_caseless_isequal(descriptor->idata,
- c->strings[FONT_STYLE], &match) == lwc_error_ok &&
+ c->strings[FONT_STYLE], &match) == lwc_error_ok &&
match) {
return font_face_parse_font_style(c, vector, ctx, font_face);
} else if (lwc_string_caseless_isequal(descriptor->idata,
- c->strings[FONT_WEIGHT], &match) == lwc_error_ok &&
+ c->strings[FONT_WEIGHT], &match) == lwc_error_ok &&
match) {
return font_face_parse_font_weight(c, vector, ctx, font_face);
}
-
+
return CSS_INVALID;
}
diff --git a/src/parse/important.c b/src/parse/important.c
index 5589467..ca4d60c 100644
--- a/src/parse/important.c
+++ b/src/parse/important.c
@@ -100,9 +100,9 @@ void css__make_style_important(css_style *style)
case CSS_PROP_BORDER_LEFT_COLOR:
case CSS_PROP_BACKGROUND_COLOR:
case CSS_PROP_COLUMN_RULE_COLOR:
- assert(BACKGROUND_COLOR_SET ==
+ assert(BACKGROUND_COLOR_SET ==
(enum op_background_color)BORDER_COLOR_SET);
- assert(BACKGROUND_COLOR_SET ==
+ assert(BACKGROUND_COLOR_SET ==
(enum op_background_color)COLUMN_RULE_COLOR_SET);
if (value == BACKGROUND_COLOR_SET)
@@ -113,14 +113,14 @@ void css__make_style_important(css_style *style)
case CSS_PROP_CUE_AFTER:
case CSS_PROP_CUE_BEFORE:
case CSS_PROP_LIST_STYLE_IMAGE:
- assert(BACKGROUND_IMAGE_URI ==
+ assert(BACKGROUND_IMAGE_URI ==
(enum op_background_image)CUE_AFTER_URI);
- assert(BACKGROUND_IMAGE_URI ==
+ assert(BACKGROUND_IMAGE_URI ==
(enum op_background_image)CUE_BEFORE_URI);
assert(BACKGROUND_IMAGE_URI ==
(enum op_background_image)LIST_STYLE_IMAGE_URI);
- if (value == BACKGROUND_IMAGE_URI)
+ if (value == BACKGROUND_IMAGE_URI)
offset++; /* string table entry */
break;
@@ -143,7 +143,7 @@ void css__make_style_important(css_style *style)
case CSS_PROP_BORDER_LEFT_WIDTH:
case CSS_PROP_OUTLINE_WIDTH:
case CSS_PROP_COLUMN_RULE_WIDTH:
- assert(BORDER_WIDTH_SET ==
+ assert(BORDER_WIDTH_SET ==
(enum op_border_width)OUTLINE_WIDTH_SET);
assert(BORDER_WIDTH_SET ==
(enum op_border_width)COLUMN_RULE_WIDTH_SET);
@@ -173,7 +173,7 @@ void css__make_style_important(css_style *style)
assert(BOTTOM_SET == (enum op_bottom)COLUMN_WIDTH_SET);
assert(BOTTOM_SET == (enum op_bottom)COLUMN_GAP_SET);
- if (value == BOTTOM_SET)
+ if (value == BOTTOM_SET)
offset += 2; /* length + units */
break;
@@ -233,7 +233,7 @@ void css__make_style_important(css_style *style)
case CSS_PROP_COUNTER_INCREMENT:
case CSS_PROP_COUNTER_RESET:
- assert(COUNTER_INCREMENT_NONE ==
+ assert(COUNTER_INCREMENT_NONE ==
(enum op_counter_increment)COUNTER_RESET_NONE);
while (value != COUNTER_INCREMENT_NONE) {
@@ -273,13 +273,13 @@ void css__make_style_important(css_style *style)
break;
case CSS_PROP_FONT_SIZE:
- if (value == FONT_SIZE_DIMENSION)
+ if (value == FONT_SIZE_DIMENSION)
offset += 2; /* length + units */
break;
case CSS_PROP_LETTER_SPACING:
case CSS_PROP_WORD_SPACING:
- assert(LETTER_SPACING_SET ==
+ assert(LETTER_SPACING_SET ==
(enum op_letter_spacing)WORD_SPACING_SET);
if (value == LETTER_SPACING_SET)
@@ -300,7 +300,7 @@ void css__make_style_important(css_style *style)
case CSS_PROP_MAX_HEIGHT:
case CSS_PROP_MAX_WIDTH:
- assert(MAX_HEIGHT_SET ==
+ assert(MAX_HEIGHT_SET ==
(enum op_max_height)MAX_WIDTH_SET);
if (value == MAX_HEIGHT_SET)
@@ -370,7 +370,7 @@ void css__make_style_important(css_style *style)
break;
case CSS_PROP_SPEECH_RATE:
- if (value == SPEECH_RATE_SET)
+ if (value == SPEECH_RATE_SET)
offset++; /* rate */
break;
diff --git a/src/parse/language.c b/src/parse/language.c
index 11e2b2f..9af2547 100644
--- a/src/parse/language.c
+++ b/src/parse/language.c
@@ -29,43 +29,43 @@ typedef struct context_entry {
} context_entry;
/* Event handlers */
-static css_error language_handle_event(css_parser_event type,
+static css_error language_handle_event(css_parser_event type,
const parserutils_vector *tokens, void *pw);
-static css_error handleStartStylesheet(css_language *c,
+static css_error handleStartStylesheet(css_language *c,
const parserutils_vector *vector);
-static css_error handleEndStylesheet(css_language *c,
+static css_error handleEndStylesheet(css_language *c,
const parserutils_vector *vector);
-static css_error handleStartRuleset(css_language *c,
+static css_error handleStartRuleset(css_language *c,
const parserutils_vector *vector);
-static css_error handleEndRuleset(css_language *c,
+static css_error handleEndRuleset(css_language *c,
const parserutils_vector *vector);
-static css_error handleStartAtRule(css_language *c,
+static css_error handleStartAtRule(css_language *c,
const parserutils_vector *vector);
-static css_error handleEndAtRule(css_language *c,
+static css_error handleEndAtRule(css_language *c,
const parserutils_vector *vector);
-static css_error handleStartBlock(css_language *c,
+static css_error handleStartBlock(css_language *c,
const parserutils_vector *vector);
-static css_error handleEndBlock(css_language *c,
+static css_error handleEndBlock(css_language *c,
const parserutils_vector *vector);
-static css_error handleBlockContent(css_language *c,
+static css_error handleBlockContent(css_language *c,
const parserutils_vector *vector);
-static css_error handleDeclaration(css_language *c,
+static css_error handleDeclaration(css_language *c,
const parserutils_vector *vector);
/* At-rule parsing */
static css_error parseMediaList(css_language *c,
const parserutils_vector *vector, int *ctx,
uint64_t *media);
-static css_error addNamespace(css_language *c,
+static css_error addNamespace(css_language *c,
lwc_string *prefix, lwc_string *uri);
-static css_error lookupNamespace(css_language *c,
+static css_error lookupNamespace(css_language *c,
lwc_string *prefix, lwc_string **uri);
/* Selector list parsing */
static css_error parseClass(css_language *c,
const parserutils_vector *vector, int *ctx,
css_selector_detail *specific);
-static css_error parseAttrib(css_language *c,
+static css_error parseAttrib(css_language *c,
const parserutils_vector *vector, int *ctx,
css_selector_detail *specific);
static css_error parseNth(css_language *c,
@@ -83,19 +83,19 @@ static css_error parseAppendSpecific(css_language *c,
static css_error parseSelectorSpecifics(css_language *c,
const parserutils_vector *vector, int *ctx,
css_selector **parent);
-static css_error parseTypeSelector(css_language *c,
- const parserutils_vector *vector, int *ctx,
+static css_error parseTypeSelector(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_qname *qname);
-static css_error parseSimpleSelector(css_language *c,
- const parserutils_vector *vector, int *ctx,
+static css_error parseSimpleSelector(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_selector **result);
-static css_error parseCombinator(css_language *c,
- const parserutils_vector *vector, int *ctx,
+static css_error parseCombinator(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_combinator *result);
-static css_error parseSelector(css_language *c,
- const parserutils_vector *vector, int *ctx,
+static css_error parseSelector(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_selector **result);
-static css_error parseSelectorList(css_language *c,
+static css_error parseSelectorList(css_language *c,
const parserutils_vector *vector, css_rule *rule);
/* Declaration parsing */
@@ -128,7 +128,7 @@ css_error css__language_create(css_stylesheet *sheet, css_parser *parser,
if (c == NULL)
return CSS_NOMEM;
- perror = parserutils_stack_create(sizeof(context_entry),
+ perror = parserutils_stack_create(sizeof(context_entry),
STACK_CHUNK, &c->context);
if (perror != PARSERUTILS_OK) {
free(c);
@@ -165,7 +165,7 @@ css_error css__language_create(css_stylesheet *sheet, css_parser *parser,
css_error css__language_destroy(css_language *language)
{
uint32_t i;
-
+
if (language == NULL)
return CSS_BADPARM;
@@ -182,7 +182,7 @@ css_error css__language_destroy(css_language *language)
}
parserutils_stack_destroy(language->context);
-
+
free(language);
return CSS_OK;
@@ -194,10 +194,10 @@ css_error css__language_destroy(css_language *language)
* \param type The event type
* \param tokens Vector of tokens read since last event, or NULL
* \param pw Pointer to handler context
- * \return CSS_OK on success, CSS_INVALID to indicate parse error,
+ * \return CSS_OK on success, CSS_INVALID to indicate parse error,
* appropriate error otherwise.
*/
-css_error language_handle_event(css_parser_event type,
+css_error language_handle_event(css_parser_event type,
const parserutils_vector *tokens, void *pw)
{
css_language *language = (css_language *) pw;
@@ -232,7 +232,7 @@ css_error language_handle_event(css_parser_event type,
* Parser stages *
******************************************************************************/
-css_error handleStartStylesheet(css_language *c,
+css_error handleStartStylesheet(css_language *c,
const parserutils_vector *vector)
{
parserutils_error perror;
@@ -315,7 +315,7 @@ css_error handleStartRuleset(css_language *c, const parserutils_vector *vector)
return error;
}
- /* Flag that we've had a valid rule, so @import/@namespace/@charset
+ /* Flag that we've had a valid rule, so @import/@namespace/@charset
* have no effect. */
c->state = HAD_RULE;
@@ -364,11 +364,11 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector)
consumeWhitespace(vector, &ctx);
- /* We now have an ATKEYWORD and the context for the start of any0, if
+ /* We now have an ATKEYWORD and the context for the start of any0, if
* there is one */
assert(atkeyword != NULL && atkeyword->type == CSS_TOKEN_ATKEYWORD);
- if (lwc_string_caseless_isequal(atkeyword->idata, c->strings[CHARSET],
+ if (lwc_string_caseless_isequal(atkeyword->idata, c->strings[CHARSET],
&match) == lwc_error_ok && match) {
if (c->state == CHARSET_PERMITTED) {
const css_token *charset;
@@ -378,7 +378,7 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector)
return CSS_INVALID;
charset = parserutils_vector_iterate(vector, &ctx);
- if (charset == NULL ||
+ if (charset == NULL ||
charset->type != CSS_TOKEN_STRING)
return CSS_INVALID;
@@ -386,7 +386,7 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector)
if (token != NULL)
return CSS_INVALID;
- error = css__stylesheet_rule_create(c->sheet,
+ error = css__stylesheet_rule_create(c->sheet,
CSS_RULE_CHARSET, &rule);
if (error != CSS_OK)
return error;
@@ -404,25 +404,25 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector)
return error;
}
- /* Rule is now owned by the sheet,
+ /* Rule is now owned by the sheet,
* so no need to destroy it */
c->state = IMPORT_PERMITTED;
} else {
return CSS_INVALID;
}
- } else if (lwc_string_caseless_isequal(atkeyword->idata,
- c->strings[LIBCSS_IMPORT], &match) == lwc_error_ok &&
+ } else if (lwc_string_caseless_isequal(atkeyword->idata,
+ c->strings[LIBCSS_IMPORT], &match) == lwc_error_ok &&
match) {
if (c->state <= IMPORT_PERMITTED) {
lwc_string *url;
uint64_t media = 0;
- /* any0 = (STRING | URI) ws
+ /* any0 = (STRING | URI) ws
* (IDENT ws (',' ws IDENT ws)* )? */
- const css_token *uri =
+ const css_token *uri =
parserutils_vector_iterate(vector, &ctx);
- if (uri == NULL || (uri->type != CSS_TOKEN_STRING &&
+ if (uri == NULL || (uri->type != CSS_TOKEN_STRING &&
uri->type != CSS_TOKEN_URI))
return CSS_INVALID;
@@ -434,7 +434,7 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector)
return error;
/* Create rule */
- error = css__stylesheet_rule_create(c->sheet,
+ error = css__stylesheet_rule_create(c->sheet,
CSS_RULE_IMPORT, &rule);
if (error != CSS_OK)
return error;
@@ -463,7 +463,7 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector)
c->sheet, url, media);
if (error != CSS_OK) {
lwc_string_unref(url);
- css__stylesheet_rule_destroy(c->sheet,
+ css__stylesheet_rule_destroy(c->sheet,
rule);
return error;
}
@@ -479,15 +479,15 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector)
return error;
}
- /* Rule is now owned by the sheet,
+ /* Rule is now owned by the sheet,
* so no need to destroy it */
c->state = IMPORT_PERMITTED;
} else {
return CSS_INVALID;
}
- } else if (lwc_string_caseless_isequal(atkeyword->idata,
- c->strings[NAMESPACE], &match) == lwc_error_ok &&
+ } else if (lwc_string_caseless_isequal(atkeyword->idata,
+ c->strings[NAMESPACE], &match) == lwc_error_ok &&
match) {
if (c->state <= NAMESPACE_PERMITTED) {
lwc_string *prefix = NULL;
@@ -503,7 +503,7 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector)
consumeWhitespace(vector, &ctx);
- token = parserutils_vector_iterate(vector,
+ token = parserutils_vector_iterate(vector,
&ctx);
}
@@ -525,7 +525,7 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector)
} else {
return CSS_INVALID;
}
- } else if (lwc_string_caseless_isequal(atkeyword->idata, c->strings[MEDIA],
+ } else if (lwc_string_caseless_isequal(atkeyword->idata, c->strings[MEDIA],
&match) == lwc_error_ok && match) {
uint64_t media = 0;
@@ -535,7 +535,7 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector)
if (error != CSS_OK)
return error;
- error = css__stylesheet_rule_create(c->sheet,
+ error = css__stylesheet_rule_create(c->sheet,
CSS_RULE_MEDIA, &rule);
if (error != CSS_OK)
return error;
@@ -552,18 +552,18 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector)
return error;
}
- /* Rule is now owned by the sheet,
+ /* Rule is now owned by the sheet,
* so no need to destroy it */
c->state = HAD_RULE;
- } else if (lwc_string_caseless_isequal(atkeyword->idata,
- c->strings[FONT_FACE], &match) == lwc_error_ok &&
+ } else if (lwc_string_caseless_isequal(atkeyword->idata,
+ c->strings[FONT_FACE], &match) == lwc_error_ok &&
match) {
error = css__stylesheet_rule_create(c->sheet,
CSS_RULE_FONT_FACE, &rule);
if (error != CSS_OK)
return error;
-
+
consumeWhitespace(vector, &ctx);
error = css__stylesheet_add_rule(c->sheet, rule, NULL);
@@ -572,11 +572,11 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector)
return error;
}
- /* Rule is now owned by the sheet,
+ /* Rule is now owned by the sheet,
* so no need to destroy it */
c->state = HAD_RULE;
- } else if (lwc_string_caseless_isequal(atkeyword->idata, c->strings[PAGE],
+ } else if (lwc_string_caseless_isequal(atkeyword->idata, c->strings[PAGE],
&match) == lwc_error_ok && match) {
const css_token *token;
@@ -614,7 +614,7 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector)
return error;
}
- /* Rule is now owned by the sheet,
+ /* Rule is now owned by the sheet,
* so no need to destroy it */
c->state = HAD_RULE;
@@ -661,7 +661,7 @@ css_error handleStartBlock(css_language *c, const parserutils_vector *vector)
UNUSED(vector);
- /* If the current item on the stack isn't a block,
+ /* If the current item on the stack isn't a block,
* then clone its data field. This ensures that the relevant rule
* is available when parsing the block contents. */
cur = parserutils_stack_get_current(c->context);
@@ -693,7 +693,7 @@ css_error handleEndBlock(css_language *c, const parserutils_vector *vector)
return css_error_from_parserutils_error(perror);
}
- /* If the block we just popped off the stack was associated with a
+ /* If the block we just popped off the stack was associated with a
* non-block stack entry, and that entry is not a top-level statement,
* then report the end of that entry, too. */
if (rule != NULL && rule->ptype != CSS_RULE_PARENT_STYLESHEET) {
@@ -718,9 +718,9 @@ css_error handleBlockContent(css_language *c, const parserutils_vector *vector)
return CSS_INVALID;
rule = entry->data;
- if (rule == NULL || (rule->type != CSS_RULE_SELECTOR &&
+ if (rule == NULL || (rule->type != CSS_RULE_SELECTOR &&
rule->type != CSS_RULE_PAGE &&
- rule->type != CSS_RULE_MEDIA &&
+ rule->type != CSS_RULE_MEDIA &&
rule->type != CSS_RULE_FONT_FACE))
return CSS_INVALID;
@@ -754,16 +754,16 @@ css_error handleDeclaration(css_language *c, const parserutils_vector *vector)
return CSS_INVALID;
rule = entry->data;
- if (rule == NULL || (rule->type != CSS_RULE_SELECTOR &&
- rule->type != CSS_RULE_PAGE &&
+ if (rule == NULL || (rule->type != CSS_RULE_SELECTOR &&
+ rule->type != CSS_RULE_PAGE &&
rule->type != CSS_RULE_FONT_FACE))
return CSS_INVALID;
/* Strip any leading whitespace (can happen if in nested block) */
consumeWhitespace(vector, &ctx);
- /* IDENT ws ':' ws value
- *
+ /* IDENT ws ':' ws value
+ *
* In CSS 2.1, value is any1, so '{' or ATKEYWORD => parse error
*/
ident = parserutils_vector_iterate(vector, &ctx);
@@ -809,47 +809,47 @@ css_error parseMediaList(css_language *c,
if (token->type != CSS_TOKEN_IDENT)
return CSS_INVALID;
- if (lwc_string_caseless_isequal(token->idata, c->strings[AURAL],
+ if (lwc_string_caseless_isequal(token->idata, c->strings[AURAL],
&match) == lwc_error_ok && match) {
ret |= CSS_MEDIA_AURAL;
} else if (lwc_string_caseless_isequal(
- token->idata, c->strings[BRAILLE],
+ token->idata, c->strings[BRAILLE],
&match) == lwc_error_ok && match) {
ret |= CSS_MEDIA_BRAILLE;
} else if (lwc_string_caseless_isequal(
- token->idata, c->strings[EMBOSSED],
+ token->idata, c->strings[EMBOSSED],
&match) == lwc_error_ok && match) {
ret |= CSS_MEDIA_EMBOSSED;
} else if (lwc_string_caseless_isequal(
- token->idata, c->strings[HANDHELD],
+ token->idata, c->strings[HANDHELD],
&match) == lwc_error_ok && match) {
ret |= CSS_MEDIA_HANDHELD;
} else if (lwc_string_caseless_isequal(
- token->idata, c->strings[PRINT],
+ token->idata, c->strings[PRINT],
&match) == lwc_error_ok && match) {
ret |= CSS_MEDIA_PRINT;
} else if (lwc_string_caseless_isequal(
- token->idata, c->strings[PROJECTION],
+ token->idata, c->strings[PROJECTION],
&match) == lwc_error_ok && match) {
ret |= CSS_MEDIA_PROJECTION;
} else if (lwc_string_caseless_isequal(
- token->idata, c->strings[SCREEN],
+ token->idata, c->strings[SCREEN],
&match) == lwc_error_ok && match) {
ret |= CSS_MEDIA_SCREEN;
} else if (lwc_string_caseless_isequal(
- token->idata, c->strings[SPEECH],
+ token->idata, c->strings[SPEECH],
&match) == lwc_error_ok && match) {
ret |= CSS_MEDIA_SPEECH;
} else if (lwc_string_caseless_isequal(
- token->idata, c->strings[TTY],
+ token->idata, c->strings[TTY],
&match) == lwc_error_ok && match) {
ret |= CSS_MEDIA_TTY;
} else if (lwc_string_caseless_isequal(
- token->idata, c->strings[TV],
+ token->idata, c->strings[TV],
&match) == lwc_error_ok && match) {
ret |= CSS_MEDIA_TV;
} else if (lwc_string_caseless_isequal(
- token->idata, c->strings[ALL],
+ token->idata, c->strings[ALL],
&match) == lwc_error_ok && match) {
ret |= CSS_MEDIA_ALL;
} else
@@ -864,7 +864,7 @@ css_error parseMediaList(css_language *c,
consumeWhitespace(vector, ctx);
}
- /* If, after parsing the media list, we still have no media,
+ /* If, after parsing the media list, we still have no media,
* then it must be ALL. */
if (ret == 0)
ret = CSS_MEDIA_ALL;
@@ -908,8 +908,8 @@ css_error addNamespace(css_language *c, lwc_string *prefix, lwc_string *uri)
if (idx == c->num_namespaces) {
/* Not found, create a new mapping */
- css_namespace *ns = realloc(c->namespaces,
- sizeof(css_namespace) *
+ css_namespace *ns = realloc(c->namespaces,
+ sizeof(css_namespace) *
(c->num_namespaces + 1));
if (ns == NULL)
@@ -972,7 +972,7 @@ css_error lookupNamespace(css_language *c, lwc_string *prefix, lwc_string **uri)
* Selector list parsing functions *
******************************************************************************/
-css_error parseClass(css_language *c, const parserutils_vector *vector,
+css_error parseClass(css_language *c, const parserutils_vector *vector,
int *ctx, css_selector_detail *specific)
{
css_qname qname;
@@ -998,12 +998,12 @@ css_error parseClass(css_language *c, const parserutils_vector *vector,
lwc__intern_caseless_string(qname.name) != lwc_error_ok)
return CSS_NOMEM;
- return css__stylesheet_selector_detail_init(c->sheet,
+ return css__stylesheet_selector_detail_init(c->sheet,
CSS_SELECTOR_CLASS, &qname, detail_value,
CSS_SELECTOR_DETAIL_VALUE_STRING, false, specific);
}
-css_error parseAttrib(css_language *c, const parserutils_vector *vector,
+css_error parseAttrib(css_language *c, const parserutils_vector *vector,
int *ctx, css_selector_detail *specific)
{
css_qname qname;
@@ -1014,12 +1014,12 @@ css_error parseAttrib(css_language *c, const parserutils_vector *vector,
lwc_string *prefix = NULL;
/* attrib -> '[' ws namespace_prefix? IDENT ws [
- * [ '=' |
- * INCLUDES |
- * DASHMATCH |
+ * [ '=' |
+ * INCLUDES |
+ * DASHMATCH |
* PREFIXMATCH |
- * SUFFIXMATCH |
- * SUBSTRINGMATCH
+ * SUFFIXMATCH |
+ * SUBSTRINGMATCH
* ] ws
* [ IDENT | STRING ] ws ]? ']'
* namespace_prefix -> [ IDENT | '*' ]? '|'
@@ -1100,8 +1100,8 @@ css_error parseAttrib(css_language *c, const parserutils_vector *vector,
detail_value.string = value != NULL ? value->idata : NULL;
- return css__stylesheet_selector_detail_init(c->sheet, type,
- &qname, detail_value,
+ return css__stylesheet_selector_detail_init(c->sheet, type,
+ &qname, detail_value,
CSS_SELECTOR_DETAIL_VALUE_STRING, false, specific);
}
@@ -1178,7 +1178,7 @@ css_error parseNth(css_language *c,
data += 1;
len -= 1;
} else {
- if (data[0] != '-' ||
+ if (data[0] != '-' ||
(data[1] != 'n' && data[1] != 'N'))
return CSS_INVALID;
@@ -1204,7 +1204,7 @@ css_error parseNth(css_language *c,
/* -n-b */
b = css__number_from_string(
- (const uint8_t *) data + 1,
+ (const uint8_t *) data + 1,
len - 1,
true,
&consumed);
@@ -1216,7 +1216,7 @@ css_error parseNth(css_language *c,
}
} else {
/* 2n */
- a = css__number_from_lwc_string(token->idata,
+ a = css__number_from_lwc_string(token->idata,
true, &consumed);
if (consumed == 0 || (data[consumed] != 'n' &&
data[consumed] != 'N'))
@@ -1306,7 +1306,7 @@ css_error parseNth(css_language *c,
return CSS_OK;
}
-css_error parsePseudo(css_language *c, const parserutils_vector *vector,
+css_error parsePseudo(css_language *c, const parserutils_vector *vector,
int *ctx, bool in_not, css_selector_detail *specific)
{
static const struct
@@ -1347,7 +1347,7 @@ css_error parsePseudo(css_language *c, const parserutils_vector *vector,
{ AFTER, CSS_SELECTOR_PSEUDO_ELEMENT }
};
css_selector_detail_value detail_value;
- css_selector_detail_value_type value_type =
+ css_selector_detail_value_type value_type =
CSS_SELECTOR_DETAIL_VALUE_STRING;
css_qname qname;
const css_token *token;
@@ -1375,7 +1375,7 @@ css_error parsePseudo(css_language *c, const parserutils_vector *vector,
}
/* Expect IDENT or FUNCTION */
- if (token == NULL || (token->type != CSS_TOKEN_IDENT &&
+ if (token == NULL || (token->type != CSS_TOKEN_IDENT &&
token->type != CSS_TOKEN_FUNCTION))
return CSS_INVALID;
@@ -1384,7 +1384,7 @@ css_error parsePseudo(css_language *c, const parserutils_vector *vector,
/* Search lut for selector type */
for (lut_idx = 0; lut_idx < N_ELEMENTS(pseudo_lut); lut_idx++) {
- if ((lwc_string_caseless_isequal(qname.name,
+ if ((lwc_string_caseless_isequal(qname.name,
c->strings[pseudo_lut[lut_idx].index],
&match) == lwc_error_ok) && match) {
type = pseudo_lut[lut_idx].type;
@@ -1401,7 +1401,7 @@ css_error parsePseudo(css_language *c, const parserutils_vector *vector,
return CSS_INVALID;
/* :not() and pseudo elements are not permitted in :not() */
- if (in_not && (type == CSS_SELECTOR_PSEUDO_ELEMENT ||
+ if (in_not && (type == CSS_SELECTOR_PSEUDO_ELEMENT ||
pseudo_lut[lut_idx].index == NOT))
return CSS_INVALID;
@@ -1420,9 +1420,9 @@ css_error parsePseudo(css_language *c, const parserutils_vector *vector,
value_type = CSS_SELECTOR_DETAIL_VALUE_STRING;
consumeWhitespace(vector, ctx);
- } else if (fun_type == NTH_CHILD ||
- fun_type == NTH_LAST_CHILD ||
- fun_type == NTH_OF_TYPE ||
+ } else if (fun_type == NTH_CHILD ||
+ fun_type == NTH_LAST_CHILD ||
+ fun_type == NTH_OF_TYPE ||
fun_type == NTH_LAST_OF_TYPE) {
/* an + b */
error = parseNth(c, vector, ctx, &detail_value);
@@ -1436,11 +1436,11 @@ css_error parsePseudo(css_language *c, const parserutils_vector *vector,
if (token == NULL)
return CSS_INVALID;
- if (token->type == CSS_TOKEN_IDENT ||
+ if (token->type == CSS_TOKEN_IDENT ||
tokenIsChar(token, '*') ||
tokenIsChar(token, '|')) {
/* Have type selector */
- error = parseTypeSelector(c, vector, ctx,
+ error = parseTypeSelector(c, vector, ctx,
&qname);
if (error != CSS_OK)
return error;
@@ -1460,7 +1460,7 @@ css_error parsePseudo(css_language *c, const parserutils_vector *vector,
/* specific */
css_selector_detail det;
- error = parseSpecific(c, vector, ctx, true,
+ error = parseSpecific(c, vector, ctx, true,
&det);
if (error != CSS_OK)
return error;
@@ -1481,8 +1481,8 @@ css_error parsePseudo(css_language *c, const parserutils_vector *vector,
return CSS_INVALID;
}
- return css__stylesheet_selector_detail_init(c->sheet,
- type, &qname, detail_value, value_type,
+ return css__stylesheet_selector_detail_init(c->sheet,
+ type, &qname, detail_value, value_type,
negate, specific);
}
@@ -1516,7 +1516,7 @@ css_error parseSpecific(css_language *c,
error = css__stylesheet_selector_detail_init(c->sheet,
CSS_SELECTOR_ID, &qname, detail_value,
- CSS_SELECTOR_DETAIL_VALUE_STRING, false,
+ CSS_SELECTOR_DETAIL_VALUE_STRING, false,
specific);
if (error != CSS_OK)
return error;
@@ -1541,7 +1541,7 @@ css_error parseSpecific(css_language *c,
return CSS_OK;
}
-css_error parseAppendSpecific(css_language *c,
+css_error parseAppendSpecific(css_language *c,
const parserutils_vector *vector, int *ctx,
css_selector **parent)
{
@@ -1552,7 +1552,7 @@ css_error parseAppendSpecific(css_language *c,
if (error != CSS_OK)
return error;
- return css__stylesheet_selector_append_specific(c->sheet, parent,
+ return css__stylesheet_selector_append_specific(c->sheet, parent,
&specific);
}
@@ -1565,7 +1565,7 @@ css_error parseSelectorSpecifics(css_language *c,
/* specifics -> specific* */
while ((token = parserutils_vector_peek(vector, *ctx)) != NULL &&
- token->type != CSS_TOKEN_S &&
+ token->type != CSS_TOKEN_S &&
tokenIsChar(token, '+') == false &&
tokenIsChar(token, '>') == false &&
tokenIsChar(token, '~') == false &&
@@ -1639,8 +1639,8 @@ css_error parseTypeSelector(css_language *c, const parserutils_vector *vector,
return CSS_OK;
}
-css_error parseSimpleSelector(css_language *c,
- const parserutils_vector *vector, int *ctx,
+css_error parseSimpleSelector(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_selector **result)
{
int orig_ctx = *ctx;
@@ -1746,7 +1746,7 @@ css_error parseCombinator(css_language *c, const parserutils_vector *vector,
return CSS_OK;
}
-css_error parseSelector(css_language *c, const parserutils_vector *vector,
+css_error parseSelector(css_language *c, const parserutils_vector *vector,
int *ctx, css_selector **result)
{
css_error error;
@@ -1754,10 +1754,10 @@ css_error parseSelector(css_language *c, const parserutils_vector *vector,
css_selector *selector = NULL;
/* selector -> simple_selector [ combinator simple_selector ]* ws
- *
+ *
* Note, however, that, as combinator can be wholly whitespace,
- * there's an ambiguity as to whether "ws" has been reached. We
- * resolve this by attempting to extract a combinator, then
+ * there's an ambiguity as to whether "ws" has been reached. We
+ * resolve this by attempting to extract a combinator, then
* recovering when we detect that we've reached the end of the
* selector.
*/
@@ -1778,13 +1778,13 @@ css_error parseSelector(css_language *c, const parserutils_vector *vector,
/* In the case of "html , body { ... }", the whitespace after
* "html" and "body" will be considered an ancestor combinator.
- * This clearly is not the case, however. Therefore, as a
- * special case, if we've got an ancestor combinator and there
+ * This clearly is not the case, however. Therefore, as a
+ * special case, if we've got an ancestor combinator and there
* are no further tokens, or if the next token is a comma,
* we ignore the supposed combinator and continue. */
- if (comb == CSS_COMBINATOR_ANCESTOR &&
- ((token = parserutils_vector_peek(vector,
- *ctx)) == NULL ||
+ if (comb == CSS_COMBINATOR_ANCESTOR &&
+ ((token = parserutils_vector_peek(vector,
+ *ctx)) == NULL ||
tokenIsChar(token, ',')))
continue;
@@ -1847,7 +1847,7 @@ css_error parseSelectorList(css_language *c, const parserutils_vector *vector,
error = parseSelector(c, vector, &ctx, &selector);
if (error != CSS_OK) {
if (selector != NULL) {
- css__stylesheet_selector_destroy(c->sheet,
+ css__stylesheet_selector_destroy(c->sheet,
selector);
}
return error;
@@ -1855,7 +1855,7 @@ css_error parseSelectorList(css_language *c, const parserutils_vector *vector,
assert(selector != NULL);
- error = css__stylesheet_rule_add_selector(c->sheet, rule,
+ error = css__stylesheet_rule_add_selector(c->sheet, rule,
selector);
if (error != CSS_OK) {
css__stylesheet_selector_destroy(c->sheet, selector);
@@ -1870,7 +1870,7 @@ css_error parseSelectorList(css_language *c, const parserutils_vector *vector,
* Property parsing functions *
******************************************************************************/
-css_error parseProperty(css_language *c, const css_token *property,
+css_error parseProperty(css_language *c, const css_token *property,
const parserutils_vector *vector, int *ctx, css_rule *rule)
{
css_error error;
@@ -1898,7 +1898,7 @@ css_error parseProperty(css_language *c, const css_token *property,
/* allocate style */
error = css__stylesheet_style_create(c->sheet, &style);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
assert (style != NULL);
diff --git a/src/parse/language.h b/src/parse/language.h
index f7c8536..2ab4987 100644
--- a/src/parse/language.h
+++ b/src/parse/language.h
@@ -84,7 +84,7 @@ static inline bool tokenIsChar(const css_token *token, uint8_t c)
{
bool result = false;
- if (token != NULL && token->type == CSS_TOKEN_CHAR &&
+ if (token != NULL && token->type == CSS_TOKEN_CHAR &&
lwc_string_length(token->idata) == 1) {
char d = lwc_string_data(token->idata)[0];
diff --git a/src/parse/parse.c b/src/parse/parse.c
index b65b0f5..68492d4 100644
--- a/src/parse/parse.c
+++ b/src/parse/parse.c
@@ -107,8 +107,8 @@ struct css_parser
void *event_pw; /**< Client data for event handler */
};
-static css_error css__parser_create_internal(const char *charset,
- css_charset_source cs_source, parser_state initial,
+static css_error css__parser_create_internal(const char *charset,
+ css_charset_source cs_source, parser_state initial,
css_parser **parser);
static css_error transition(css_parser *parser, parser_state to,
@@ -280,7 +280,7 @@ css_error css__parser_setopt(css_parser *parser, css_parser_opttype type,
* \param len Length of chunk
* \return CSS_OK on success, appropriate error otherwise
*/
-css_error css__parser_parse_chunk(css_parser *parser, const uint8_t *data,
+css_error css__parser_parse_chunk(css_parser *parser, const uint8_t *data,
size_t len)
{
parserutils_error perror;
@@ -344,7 +344,7 @@ css_error css__parser_completed(css_parser *parser)
* \param source Pointer to location to receive charset source
* \return Pointer to charset name (constant; do not free)
*/
-const char *css__parser_read_charset(css_parser *parser,
+const char *css__parser_read_charset(css_parser *parser,
css_charset_source *source)
{
const char *charset;
@@ -386,8 +386,8 @@ bool css__parser_quirks_permitted(css_parser *parser)
* CSS_BADPARM on bad parameters,
* CSS_NOMEM on memory exhaustion
*/
-css_error css__parser_create_internal(const char *charset,
- css_charset_source cs_source, parser_state initial,
+css_error css__parser_create_internal(const char *charset,
+ css_charset_source cs_source, parser_state initial,
css_parser **parser)
{
css_parser *p;
@@ -415,7 +415,7 @@ css_error css__parser_create_internal(const char *charset,
return error;
}
- perror = parserutils_stack_create(sizeof(parser_state),
+ perror = parserutils_stack_create(sizeof(parser_state),
STACK_CHUNK, &p->states);
if (perror != PARSERUTILS_OK) {
css__lexer_destroy(p->lexer);
@@ -424,7 +424,7 @@ css_error css__parser_create_internal(const char *charset,
return css_error_from_parserutils_error(perror);
}
- perror = parserutils_vector_create(sizeof(css_token),
+ perror = parserutils_vector_create(sizeof(css_token),
STACK_CHUNK, &p->tokens);
if (perror != PARSERUTILS_OK) {
parserutils_stack_destroy(p->states);
@@ -434,7 +434,7 @@ css_error css__parser_create_internal(const char *charset,
return css_error_from_parserutils_error(perror);
}
- perror = parserutils_stack_create(sizeof(char),
+ perror = parserutils_stack_create(sizeof(char),
STACK_CHUNK, &p->open_items);
if (perror != PARSERUTILS_OK) {
parserutils_vector_destroy(p->tokens);
@@ -481,7 +481,7 @@ css_error css__parser_create_internal(const char *charset,
* \param subsequent The state to return to
* \return CSS_OK on success, appropriate error otherwise
*/
-css_error transition(css_parser *parser, parser_state to,
+css_error transition(css_parser *parser, parser_state to,
parser_state subsequent)
{
parser_state *state = parserutils_stack_get_current(parser->states);
@@ -556,7 +556,7 @@ css_error done(css_parser *parser)
/**
* Assert that the expected token is next in the input
- *
+ *
* \param parser The parser instance
* \param type The expected token type
* \return CSS_OK on success, appropriate error otherwise
@@ -638,7 +638,7 @@ css_error getToken(css_parser *parser, const css_token **token)
}
/* Append token to vector */
- perror = parserutils_vector_append(parser->tokens,
+ perror = parserutils_vector_append(parser->tokens,
(css_token *) (*token));
if (perror != PARSERUTILS_OK)
return css_error_from_parserutils_error(perror);
@@ -661,7 +661,7 @@ css_error pushBack(css_parser *parser, const css_token *token)
/* The pushback buffer depth is 1 token. Assert this. */
assert(parser->pushback == NULL);
-
+
perror = parserutils_vector_remove_last(parser->tokens);
if (perror != PARSERUTILS_OK)
return css_error_from_parserutils_error(perror);
@@ -713,7 +713,7 @@ css_error parseStart(css_parser *parser)
printf("Begin stylesheet\n");
#endif
if (parser->event != NULL) {
- parser->event(CSS_PARSER_START_STYLESHEET, NULL,
+ parser->event(CSS_PARSER_START_STYLESHEET, NULL,
parser->event_pw);
}
@@ -742,10 +742,10 @@ css_error parseStart(css_parser *parser)
printf("End stylesheet\n");
#endif
if (parser->event != NULL) {
- parser->event(CSS_PARSER_END_STYLESHEET, NULL,
+ parser->event(CSS_PARSER_END_STYLESHEET, NULL,
parser->event_pw);
}
-
+
unref_interned_strings_in_tokens(parser);
parserutils_vector_clear(parser->tokens);
@@ -843,7 +843,7 @@ css_error parseRuleset(css_parser *parser)
const css_token *token;
css_error error;
- /* ruleset -> selector '{' ws ruleset-end
+ /* ruleset -> selector '{' ws ruleset-end
* -> '{' ws ruleset-end
*/
@@ -856,20 +856,20 @@ css_error parseRuleset(css_parser *parser)
if (error != CSS_OK)
return error;
- /* The grammar's ambiguous here -- selectors may start with a
- * brace. We're going to assume that that won't happen,
+ /* The grammar's ambiguous here -- selectors may start with a
+ * brace. We're going to assume that that won't happen,
* however. */
- if (token->type == CSS_TOKEN_CHAR &&
- lwc_string_length(token->idata) == 1 &&
+ if (token->type == CSS_TOKEN_CHAR &&
+ lwc_string_length(token->idata) == 1 &&
lwc_string_data(token->idata)[0] == '{') {
#if !defined(NDEBUG) && defined(DEBUG_EVENTS)
printf("Begin ruleset\n");
#endif
if (parser->event != NULL) {
- if (parser->event(CSS_PARSER_START_RULESET,
- NULL, parser->event_pw) ==
+ if (parser->event(CSS_PARSER_START_RULESET,
+ NULL, parser->event_pw) ==
CSS_INVALID) {
- parser_state to =
+ parser_state to =
{ sMalformedSelector, Initial };
return transitionNoRet(parser, to);
@@ -895,7 +895,7 @@ css_error parseRuleset(css_parser *parser)
parserutils_vector_dump(parser->tokens, __func__, tprinter);
#endif
if (parser->parseError == false && parser->event != NULL) {
- if (parser->event(CSS_PARSER_START_RULESET,
+ if (parser->event(CSS_PARSER_START_RULESET,
parser->tokens, parser->event_pw) ==
CSS_INVALID)
parser->parseError = true;
@@ -919,14 +919,14 @@ css_error parseRuleset(css_parser *parser)
return done(parser);
}
- if (token->type != CSS_TOKEN_CHAR ||
+ if (token->type != CSS_TOKEN_CHAR ||
lwc_string_length(token->idata) != 1 ||
lwc_string_data(token->idata)[0] != '{') {
- /* This should never happen, as FOLLOW(selector)
+ /* This should never happen, as FOLLOW(selector)
* contains only '{' */
assert(0 && "Expected {");
}
-
+
state->substate = WS;
/* Fall through */
case WS:
@@ -948,7 +948,7 @@ css_error parseRulesetEnd(css_parser *parser)
const css_token *token;
css_error error;
- /* ruleset-end -> declaration decl-list '}' ws
+ /* ruleset-end -> declaration decl-list '}' ws
* -> decl-list '}' ws
*/
@@ -969,7 +969,7 @@ css_error parseRulesetEnd(css_parser *parser)
* attempt to parse a declaration. This will catch any invalid
* input at this point and read to the start of the next
* declaration. FIRST(decl-list) = (';', '}') */
- if (token->type != CSS_TOKEN_CHAR ||
+ if (token->type != CSS_TOKEN_CHAR ||
lwc_string_length(token->idata) != 1 ||
(lwc_string_data(token->idata)[0] != '}' &&
lwc_string_data(token->idata)[0] != ';')) {
@@ -1001,7 +1001,7 @@ css_error parseRulesetEnd(css_parser *parser)
return done(parser);
}
- if (token->type != CSS_TOKEN_CHAR ||
+ if (token->type != CSS_TOKEN_CHAR ||
lwc_string_length(token->idata) != 1 ||
lwc_string_data(token->idata)[0] != '}') {
/* This should never happen, as FOLLOW(decl-list)
@@ -1077,9 +1077,9 @@ css_error parseAtRule(css_parser *parser)
if (error != CSS_OK)
return error;
- /* Grammar ambiguity: any0 can be followed by '{',';',')',']'.
+ /* Grammar ambiguity: any0 can be followed by '{',';',')',']'.
* at-rule can only be followed by '{' and ';'. */
- if (token->type == CSS_TOKEN_CHAR &&
+ if (token->type == CSS_TOKEN_CHAR &&
lwc_string_length(token->idata) == 1) {
if (lwc_string_data(token->idata)[0] == ')' ||
lwc_string_data(
@@ -1119,7 +1119,7 @@ css_error parseAtRuleEnd(css_parser *parser)
parserutils_vector_dump(parser->tokens, __func__, tprinter);
#endif
if (parser->event != NULL) {
- if (parser->event(CSS_PARSER_START_ATRULE,
+ if (parser->event(CSS_PARSER_START_ATRULE,
parser->tokens, parser->event_pw) ==
CSS_INVALID) {
parser_state to = { sMalformedAtRule, Initial };
@@ -1140,12 +1140,12 @@ css_error parseAtRuleEnd(css_parser *parser)
return done(parser);
}
- if (token->type != CSS_TOKEN_CHAR ||
+ if (token->type != CSS_TOKEN_CHAR ||
lwc_string_length(token->idata) != 1) {
/* Should never happen FOLLOW(at-rule) == '{', ';'*/
assert(0 && "Expected { or ;");
}
-
+
if (lwc_string_data(token->idata)[0] == '{') {
parser_state to = { sBlock, Initial };
parser_state subsequent = { sAtRuleEnd, AfterBlock };
@@ -1205,7 +1205,7 @@ css_error parseBlock(css_parser *parser)
parser->event_pw);
}
- if (token->type != CSS_TOKEN_CHAR ||
+ if (token->type != CSS_TOKEN_CHAR ||
lwc_string_length(token->idata) != 1 ||
lwc_string_data(token->idata)[0] != '{') {
/* This should never happen, as FIRST(block) == '{' */
@@ -1244,10 +1244,10 @@ css_error parseBlock(css_parser *parser)
return done(parser);
}
- if (token->type != CSS_TOKEN_CHAR ||
+ if (token->type != CSS_TOKEN_CHAR ||
lwc_string_length(token->idata) != 1 ||
lwc_string_data(token->idata)[0] != '}') {
- /* This should never happen, as
+ /* This should never happen, as
* FOLLOW(block-content) == '}' */
assert(0 && "Expected }");
}
@@ -1282,7 +1282,7 @@ css_error parseBlockContent(css_parser *parser)
const css_token *token;
css_error error;
- /* block-content -> any block-content
+ /* block-content -> any block-content
* -> block block-content
* -> ATKEYWORD ws block-content
* -> ';' ws block-content
@@ -1299,12 +1299,12 @@ css_error parseBlockContent(css_parser *parser)
if (token->type == CSS_TOKEN_ATKEYWORD) {
state->substate = WS;
} else if (token->type == CSS_TOKEN_CHAR) {
- if (lwc_string_length(token->idata) == 1 &&
+ if (lwc_string_length(token->idata) == 1 &&
lwc_string_data(
token->idata)[0] == '{') {
/* Grammar ambiguity. Assume block */
parser_state to = { sBlock, Initial };
- parser_state subsequent =
+ parser_state subsequent =
{ sBlockContent, Initial };
error = pushBack(parser, token);
@@ -1318,7 +1318,7 @@ css_error parseBlockContent(css_parser *parser)
if (parser->event != NULL) {
parser->event(
CSS_PARSER_BLOCK_CONTENT,
- parser->tokens,
+ parser->tokens,
parser->event_pw);
}
@@ -1327,7 +1327,7 @@ css_error parseBlockContent(css_parser *parser)
parserutils_vector_clear(
parser->tokens);
- return transition(parser, to,
+ return transition(parser, to,
subsequent);
} else if (lwc_string_length(
token->idata) == 1 &&
@@ -1345,7 +1345,7 @@ css_error parseBlockContent(css_parser *parser)
if (parser->event != NULL) {
parser->event(
CSS_PARSER_BLOCK_CONTENT,
- parser->tokens,
+ parser->tokens,
parser->event_pw);
}
@@ -1409,7 +1409,7 @@ css_error parseBlockContent(css_parser *parser)
if (state->substate == Initial) {
parser_state to = { sAny, Initial };
- parser_state subsequent =
+ parser_state subsequent =
{ sBlockContent, Initial };
error = pushBack(parser, token);
@@ -1498,7 +1498,7 @@ css_error parseDeclaration(css_parser *parser)
return done(parser);
}
- if (token->type != CSS_TOKEN_CHAR ||
+ if (token->type != CSS_TOKEN_CHAR ||
lwc_string_length(token->idata) != 1 ||
lwc_string_data(token->idata)[0] != ':') {
/* parse error -- expected : */
@@ -1572,9 +1572,9 @@ css_error parseDeclList(css_parser *parser)
return done(parser);
}
- if (token->type != CSS_TOKEN_CHAR ||
+ if (token->type != CSS_TOKEN_CHAR ||
lwc_string_length(token->idata) != 1 ||
- (lwc_string_data(token->idata)[0] != '}' &&
+ (lwc_string_data(token->idata)[0] != '}' &&
lwc_string_data(token->idata)[0] != ';')) {
/* Should never happen */
assert(0 && "Expected ; or }");
@@ -1611,7 +1611,7 @@ css_error parseDeclListEnd(css_parser *parser)
const css_token *token;
css_error error;
- /* decl-list-end -> declaration decl-list
+ /* decl-list-end -> declaration decl-list
* -> decl-list
*/
@@ -1621,12 +1621,12 @@ css_error parseDeclListEnd(css_parser *parser)
if (error != CSS_OK)
return error;
- if (token->type != CSS_TOKEN_CHAR ||
- lwc_string_length(token->idata) != 1 ||
+ if (token->type != CSS_TOKEN_CHAR ||
+ lwc_string_length(token->idata) != 1 ||
(lwc_string_data(token->idata)[0] != ';' &&
lwc_string_data(token->idata)[0] != '}')) {
parser_state to = { sDeclaration, Initial };
- parser_state subsequent =
+ parser_state subsequent =
{ sDeclListEnd, AfterDeclaration };
error = pushBack(parser, token);
@@ -1717,7 +1717,7 @@ css_error parseValue1(css_parser *parser)
return error;
/* Grammar ambiguity -- assume ';' or '}' mark end */
- if (token->type == CSS_TOKEN_CHAR &&
+ if (token->type == CSS_TOKEN_CHAR &&
lwc_string_length(token->idata) == 1 &&
(lwc_string_data(token->idata)[0] == ';' ||
lwc_string_data(token->idata)[0] == '}')) {
@@ -1746,7 +1746,7 @@ css_error parseValue0(css_parser *parser)
css_error error;
/* value0 -> value value0
- * ->
+ * ->
*/
while (1) {
@@ -1768,7 +1768,7 @@ css_error parseValue0(css_parser *parser)
return done(parser);
/* Grammar ambiguity -- assume ';' or '}' mark end */
- if (token->type == CSS_TOKEN_CHAR &&
+ if (token->type == CSS_TOKEN_CHAR &&
lwc_string_length(
token->idata) == 1 &&
(lwc_string_data(
@@ -1813,8 +1813,8 @@ css_error parseValue(css_parser *parser)
if (token->type == CSS_TOKEN_ATKEYWORD) {
state->substate = WS;
- } else if (token->type == CSS_TOKEN_CHAR &&
- lwc_string_length(token->idata) == 1 &&
+ } else if (token->type == CSS_TOKEN_CHAR &&
+ lwc_string_length(token->idata) == 1 &&
lwc_string_data(token->idata)[0] == '{') {
/* Grammar ambiguity. Assume block. */
parser_state to = { sBlock, Initial };
@@ -1854,7 +1854,7 @@ css_error parseAny0(css_parser *parser)
css_error error;
/* any0 -> any any0
- * ->
+ * ->
*/
while (1) {
@@ -1875,9 +1875,9 @@ css_error parseAny0(css_parser *parser)
if (token->type == CSS_TOKEN_EOF)
return done(parser);
- /* Grammar ambiguity:
+ /* Grammar ambiguity:
* assume '{', ';', ')', ']' mark end */
- if (token->type == CSS_TOKEN_CHAR &&
+ if (token->type == CSS_TOKEN_CHAR &&
lwc_string_length(
token->idata) == 1 &&
(lwc_string_data(
@@ -1945,9 +1945,9 @@ css_error parseAny1(css_parser *parser)
if (error != CSS_OK)
return error;
- /* Grammar ambiguity: any0 can be followed by
+ /* Grammar ambiguity: any0 can be followed by
* '{', ';', ')', ']'. any1 can only be followed by '{'. */
- if (token->type == CSS_TOKEN_CHAR &&
+ if (token->type == CSS_TOKEN_CHAR &&
lwc_string_length(token->idata) == 1) {
if (lwc_string_data(token->idata)[0] == ';' ||
lwc_string_data(
@@ -2003,20 +2003,20 @@ css_error parseAny(css_parser *parser)
if (error != CSS_OK)
return error;
- if (token->type != CSS_TOKEN_IDENT &&
- token->type != CSS_TOKEN_NUMBER &&
- token->type != CSS_TOKEN_PERCENTAGE &&
- token->type != CSS_TOKEN_DIMENSION &&
- token->type != CSS_TOKEN_STRING &&
- token->type != CSS_TOKEN_CHAR &&
- token->type != CSS_TOKEN_URI &&
- token->type != CSS_TOKEN_HASH &&
- token->type != CSS_TOKEN_UNICODE_RANGE &&
- token->type != CSS_TOKEN_INCLUDES &&
- token->type != CSS_TOKEN_DASHMATCH &&
- token->type != CSS_TOKEN_PREFIXMATCH &&
- token->type != CSS_TOKEN_SUFFIXMATCH &&
- token->type != CSS_TOKEN_SUBSTRINGMATCH &&
+ if (token->type != CSS_TOKEN_IDENT &&
+ token->type != CSS_TOKEN_NUMBER &&
+ token->type != CSS_TOKEN_PERCENTAGE &&
+ token->type != CSS_TOKEN_DIMENSION &&
+ token->type != CSS_TOKEN_STRING &&
+ token->type != CSS_TOKEN_CHAR &&
+ token->type != CSS_TOKEN_URI &&
+ token->type != CSS_TOKEN_HASH &&
+ token->type != CSS_TOKEN_UNICODE_RANGE &&
+ token->type != CSS_TOKEN_INCLUDES &&
+ token->type != CSS_TOKEN_DASHMATCH &&
+ token->type != CSS_TOKEN_PREFIXMATCH &&
+ token->type != CSS_TOKEN_SUFFIXMATCH &&
+ token->type != CSS_TOKEN_SUBSTRINGMATCH &&
token->type != CSS_TOKEN_FUNCTION) {
/* parse error */
parser->parseError = true;
@@ -2027,14 +2027,14 @@ css_error parseAny(css_parser *parser)
if (token->type == CSS_TOKEN_FUNCTION) {
parser->match_char = ')';
state->substate = WS;
- } else if (token->type == CSS_TOKEN_CHAR &&
- lwc_string_length(token->idata) == 1 &&
- (lwc_string_data(token->idata)[0] == '(' ||
+ } else if (token->type == CSS_TOKEN_CHAR &&
+ lwc_string_length(token->idata) == 1 &&
+ (lwc_string_data(token->idata)[0] == '(' ||
lwc_string_data(token->idata)[0] == '[')) {
parser->match_char = lwc_string_data(
token->idata)[0] == '(' ? ')' : ']';
state->substate = WS;
- }
+ }
state->substate = WS2;
/* Fall through */
@@ -2064,9 +2064,9 @@ css_error parseAny(css_parser *parser)
return error;
/* Match correct close bracket (grammar ambiguity) */
- if (token->type == CSS_TOKEN_CHAR &&
+ if (token->type == CSS_TOKEN_CHAR &&
lwc_string_length(token->idata) == 1 &&
- lwc_string_data(token->idata)[0] ==
+ lwc_string_data(token->idata)[0] ==
parser->match_char) {
state->substate = WS2;
goto ws2;
@@ -2086,14 +2086,14 @@ css_error parseMalformedDeclaration(css_parser *parser)
const css_token *token = NULL;
css_error error;
- /* Malformed declaration: read everything up to the next ; or }
+ /* Malformed declaration: read everything up to the next ; or }
* We must ensure that pairs of {}, (), [], are balanced */
switch (state->substate) {
case Initial:
{
/* Clear stack of open items */
- while (parserutils_stack_pop(parser->open_items, NULL) ==
+ while (parserutils_stack_pop(parser->open_items, NULL) ==
PARSERUTILS_OK)
;
@@ -2156,13 +2156,13 @@ css_error parseMalformedDeclaration(css_parser *parser)
break;
}
- /* Either pop off the stack, if we've matched the
+ /* Either pop off the stack, if we've matched the
* current item, or push the start token on */
if (match != NULL && *match == want) {
parserutils_stack_pop(
parser->open_items, NULL);
} else if (want == 0) {
- parserutils_stack_push(parser->open_items,
+ parserutils_stack_push(parser->open_items,
&data[0]);
}
}
@@ -2193,7 +2193,7 @@ css_error parseMalformedSelector(css_parser *parser)
switch (state->substate) {
case Initial:
/* Clear the stack of open items */
- while (parserutils_stack_pop(parser->open_items, NULL) ==
+ while (parserutils_stack_pop(parser->open_items, NULL) ==
PARSERUTILS_OK)
;
@@ -2243,21 +2243,21 @@ css_error parseMalformedSelector(css_parser *parser)
break;
}
- /* Either pop off the stack, if we've matched the
+ /* Either pop off the stack, if we've matched the
* current item, or push the start token on */
if (match != NULL && *match == want) {
parserutils_stack_pop(
parser->open_items, NULL);
} else if (want == 0) {
- parserutils_stack_push(parser->open_items,
+ parserutils_stack_push(parser->open_items,
&data[0]);
}
/* If we encountered a '}', there was data on the stack
* before, and the stack's now empty, then we've popped
- * a '{' off the stack. That means we've found the end
+ * a '{' off the stack. That means we've found the end
* of the block, so we're done here. */
- if (want == '{' && match != NULL &&
+ if (want == '{' && match != NULL &&
parserutils_stack_get_current(
parser->open_items) == NULL)
break;
@@ -2291,7 +2291,7 @@ css_error parseMalformedAtRule(css_parser *parser)
case Initial:
{
/* Clear stack of open items */
- while (parserutils_stack_pop(parser->open_items, NULL) ==
+ while (parserutils_stack_pop(parser->open_items, NULL) ==
PARSERUTILS_OK)
;
@@ -2352,21 +2352,21 @@ css_error parseMalformedAtRule(css_parser *parser)
break;
}
- /* Either pop off the stack, if we've matched the
+ /* Either pop off the stack, if we've matched the
* current item, or push the start token on */
if (match != NULL && *match == want) {
parserutils_stack_pop(
parser->open_items, NULL);
} else if (want == 0) {
- parserutils_stack_push(parser->open_items,
+ parserutils_stack_push(parser->open_items,
&data[0]);
}
/* If we encountered a '}', there was data on the stack
* before, and the stack's now empty, then we've popped
- * a '{' off the stack. That means we've found the end
+ * a '{' off the stack. That means we've found the end
* of the block, so we're done here. */
- if (want == '{' && match != NULL &&
+ if (want == '{' && match != NULL &&
parserutils_stack_get_current(
parser->open_items) == NULL)
break;
@@ -2395,7 +2395,7 @@ css_error parseInlineStyle(css_parser *parser)
switch (state->substate) {
case Initial:
- /* Emit fake events such that the language parser knows
+ /* Emit fake events such that the language parser knows
* no different from a normal parse. */
if (parser->event != NULL) {
@@ -2430,7 +2430,7 @@ css_error parseInlineStyle(css_parser *parser)
/* Emit remaining fake events to end the parse */
if (parser->event != NULL) {
/* 1) end ruleset */
- parser->event(CSS_PARSER_END_RULESET, NULL,
+ parser->event(CSS_PARSER_END_RULESET, NULL,
parser->event_pw);
/* 2) end stylesheet */
@@ -2497,7 +2497,7 @@ css_error parseISBody(css_parser *parser)
const css_token *token;
css_error error;
- /* is-body -> declaration decl-list '}' ws
+ /* is-body -> declaration decl-list '}' ws
* -> decl-list '}' ws
*
* Note that this looks suspiciously similar to ruleset-end.
@@ -2518,7 +2518,7 @@ css_error parseISBody(css_parser *parser)
* attempt to parse a declaration. This will catch any invalid
* input at this point and read to the start of the next
* declaration. FIRST(decl-list) = (';', '}') */
- if (token->type != CSS_TOKEN_CHAR ||
+ if (token->type != CSS_TOKEN_CHAR ||
lwc_string_length(token->idata) != 1 ||
(lwc_string_data(token->idata)[0] != '}' &&
lwc_string_data(token->idata)[0] != ';')) {
@@ -2550,7 +2550,7 @@ css_error parseISBody(css_parser *parser)
return done(parser);
}
- if (token->type != CSS_TOKEN_CHAR ||
+ if (token->type != CSS_TOKEN_CHAR ||
lwc_string_length(token->idata) != 1 ||
lwc_string_data(token->idata)[0] != '}') {
/* This should never happen, as FOLLOW(decl-list)
@@ -2580,7 +2580,7 @@ void unref_interned_strings_in_tokens(css_parser *parser)
{
int32_t ctx = 0;
const css_token *tok;
-
+
while ((tok = parserutils_vector_iterate(
parser->tokens, &ctx)) != NULL) {
if (tok->idata != NULL) {
diff --git a/src/parse/parse.h b/src/parse/parse.h
index 6b95acb..833aa51 100644
--- a/src/parse/parse.h
+++ b/src/parse/parse.h
@@ -34,7 +34,7 @@ typedef enum css_parser_event {
CSS_PARSER_DECLARATION
} css_parser_event;
-typedef css_error (*css_parser_event_handler)(css_parser_event type,
+typedef css_error (*css_parser_event_handler)(css_parser_event type,
const parserutils_vector *tokens, void *pw);
/**
@@ -59,18 +59,18 @@ typedef union css_parser_optparams {
css_error css__parser_create(const char *charset, css_charset_source cs_source,
css_parser **parser);
-css_error css__parser_create_for_inline_style(const char *charset,
+css_error css__parser_create_for_inline_style(const char *charset,
css_charset_source cs_source, css_parser **parser);
css_error css__parser_destroy(css_parser *parser);
css_error css__parser_setopt(css_parser *parser, css_parser_opttype type,
css_parser_optparams *params);
-css_error css__parser_parse_chunk(css_parser *parser, const uint8_t *data,
+css_error css__parser_parse_chunk(css_parser *parser, const uint8_t *data,
size_t len);
css_error css__parser_completed(css_parser *parser);
-const char *css__parser_read_charset(css_parser *parser,
+const char *css__parser_read_charset(css_parser *parser,
css_charset_source *source);
bool css__parser_quirks_permitted(css_parser *parser);
diff --git a/src/parse/properties/azimuth.c b/src/parse/properties/azimuth.c
index 7df7298..f54189b 100644
--- a/src/parse/properties/azimuth.c
+++ b/src/parse/properties/azimuth.c
@@ -27,8 +27,8 @@
* Post condition: \a *ctx is updated with the next token to process
* If the input is invalid, then \a *ctx remains unchanged.
*/
-css_error css__parse_azimuth(css_language *c,
- const parserutils_vector *vector, int *ctx,
+css_error css__parse_azimuth(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_style *result)
{
int orig_ctx = *ctx;
@@ -40,10 +40,10 @@ css_error css__parse_azimuth(css_language *c,
uint32_t unit = 0;
bool match;
- /* angle | [ IDENT(left-side, far-left, left, center-left, center,
- * center-right, right, far-right, right-side) ||
- * IDENT(behind)
- * ]
+ /* angle | [ IDENT(left-side, far-left, left, center-left, center,
+ * center-right, right, far-right, right-side) ||
+ * IDENT(behind)
+ * ]
* | IDENT(leftwards, rightwards, inherit)
*/
token = parserutils_vector_peek(vector, *ctx);
@@ -71,7 +71,7 @@ css_error css__parse_azimuth(css_language *c,
parserutils_vector_iterate(vector, ctx);
/* Now, we may have one of the other keywords or behind,
- * potentially followed by behind or other keyword,
+ * potentially followed by behind or other keyword,
* respectively */
if ((lwc_string_caseless_isequal(
token->idata, c->strings[LEFT_SIDE],
@@ -184,7 +184,7 @@ css_error css__parse_azimuth(css_language *c,
value |= AZIMUTH_CENTER;
}
} else {
- error = css__parse_unit_specifier(c, vector, ctx, UNIT_DEG,
+ error = css__parse_unit_specifier(c, vector, ctx, UNIT_DEG,
&length, &unit);
if (error != CSS_OK) {
*ctx = orig_ctx;
diff --git a/src/parse/properties/background.c b/src/parse/properties/background.c
index cae069c..01b995e 100644
--- a/src/parse/properties/background.c
+++ b/src/parse/properties/background.c
@@ -49,36 +49,36 @@ css_error css__parse_background(css_language *c,
/* Firstly, handle inherit */
token = parserutils_vector_peek(vector, *ctx);
- if (token == NULL)
+ if (token == NULL)
return CSS_INVALID;
-
+
if (is_css_inherit(c, token)) {
error = css_stylesheet_style_inherit(result, CSS_PROP_BACKGROUND_ATTACHMENT);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_BACKGROUND_COLOR);
- if (error != CSS_OK)
- return error;
+ if (error != CSS_OK)
+ return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_BACKGROUND_IMAGE);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_BACKGROUND_POSITION);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_BACKGROUND_REPEAT);
- if (error == CSS_OK)
+ if (error == CSS_OK)
parserutils_vector_iterate(vector, ctx);
return error;
- }
+ }
/* allocate styles */
error = css__stylesheet_style_create(c->sheet, &attachment_style);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css__stylesheet_style_create(c->sheet, &color_style);
@@ -124,24 +124,24 @@ css_error css__parse_background(css_language *c,
/* Try each property parser in turn, but only if we
* haven't already got a value for this property.
*/
- if ((attachment) &&
- (error = css__parse_background_attachment(c, vector, ctx,
+ if ((attachment) &&
+ (error = css__parse_background_attachment(c, vector, ctx,
attachment_style)) == CSS_OK) {
attachment = false;
- } else if ((color) &&
+ } else if ((color) &&
(error = css__parse_background_color(c, vector, ctx,
color_style)) == CSS_OK) {
color = false;
- } else if ((image) &&
+ } else if ((image) &&
(error = css__parse_background_image(c, vector, ctx,
image_style)) == CSS_OK) {
image = false;
} else if ((position) &&
- (error = css__parse_background_position(c, vector, ctx,
+ (error = css__parse_background_position(c, vector, ctx,
position_style)) == CSS_OK) {
position = false;
} else if ((repeat) &&
- (error = css__parse_background_repeat(c, vector, ctx,
+ (error = css__parse_background_repeat(c, vector, ctx,
repeat_style)) == CSS_OK) {
repeat = false;
}
@@ -157,23 +157,23 @@ css_error css__parse_background(css_language *c,
} while (*ctx != prev_ctx && token != NULL);
if (attachment) {
- error = css__stylesheet_style_appendOPV(attachment_style,
- CSS_PROP_BACKGROUND_ATTACHMENT, 0,
+ error = css__stylesheet_style_appendOPV(attachment_style,
+ CSS_PROP_BACKGROUND_ATTACHMENT, 0,
BACKGROUND_ATTACHMENT_SCROLL);
if (error != CSS_OK)
goto css__parse_background_cleanup;
}
if (color) {
- error = css__stylesheet_style_appendOPV(color_style,
- CSS_PROP_BACKGROUND_COLOR, 0,
+ error = css__stylesheet_style_appendOPV(color_style,
+ CSS_PROP_BACKGROUND_COLOR, 0,
BACKGROUND_COLOR_TRANSPARENT);
if (error != CSS_OK)
goto css__parse_background_cleanup;
}
if (image) {
- error = css__stylesheet_style_appendOPV(image_style,
+ error = css__stylesheet_style_appendOPV(image_style,
CSS_PROP_BACKGROUND_IMAGE,
0, BACKGROUND_IMAGE_NONE);
if (error != CSS_OK)
@@ -190,7 +190,7 @@ css_error css__parse_background(css_language *c,
}
if (repeat) {
- error = css__stylesheet_style_appendOPV(repeat_style,
+ error = css__stylesheet_style_appendOPV(repeat_style,
CSS_PROP_BACKGROUND_REPEAT,
0, BACKGROUND_REPEAT_REPEAT);
if (error != CSS_OK)
diff --git a/src/parse/properties/background_position.c b/src/parse/properties/background_position.c
index d4b31dc..6932c05 100644
--- a/src/parse/properties/background_position.c
+++ b/src/parse/properties/background_position.c
@@ -27,8 +27,8 @@
* Post condition: \a *ctx is updated with the next token to process
* If the input is invalid, then \a *ctx remains unchanged.
*/
-css_error css__parse_background_position(css_language *c,
- const parserutils_vector *vector, int *ctx,
+css_error css__parse_background_position(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_style *result)
{
int orig_ctx = *ctx;
@@ -65,35 +65,35 @@ css_error css__parse_background_position(css_language *c,
if (token->type == CSS_TOKEN_IDENT) {
if ((lwc_string_caseless_isequal(
token->idata, c->strings[LEFT],
- &match) == lwc_error_ok &&
+ &match) == lwc_error_ok &&
match)) {
- value[i] =
+ value[i] =
BACKGROUND_POSITION_HORZ_LEFT;
} else if ((lwc_string_caseless_isequal(
token->idata, c->strings[RIGHT],
- &match) == lwc_error_ok &&
+ &match) == lwc_error_ok &&
match)) {
- value[i] =
+ value[i] =
BACKGROUND_POSITION_HORZ_RIGHT;
} else if ((lwc_string_caseless_isequal(
token->idata, c->strings[TOP],
- &match) == lwc_error_ok &&
+ &match) == lwc_error_ok &&
match)) {
value[i] = BACKGROUND_POSITION_VERT_TOP;
} else if ((lwc_string_caseless_isequal(
- token->idata,
+ token->idata,
c->strings[BOTTOM],
- &match) == lwc_error_ok &&
+ &match) == lwc_error_ok &&
match)) {
- value[i] =
+ value[i] =
BACKGROUND_POSITION_VERT_BOTTOM;
} else if ((lwc_string_caseless_isequal(
- token->idata,
+ token->idata,
c->strings[CENTER],
- &match) == lwc_error_ok &&
+ &match) == lwc_error_ok &&
match)) {
/* We'll fix this up later */
- value[i] =
+ value[i] =
BACKGROUND_POSITION_VERT_CENTER;
} else if (i == 1) {
/* Second pass, so ignore this one */
@@ -108,15 +108,15 @@ css_error css__parse_background_position(css_language *c,
} else if (token->type == CSS_TOKEN_DIMENSION ||
token->type == CSS_TOKEN_NUMBER ||
token->type == CSS_TOKEN_PERCENTAGE) {
- error = css__parse_unit_specifier(c, vector, ctx,
+ error = css__parse_unit_specifier(c, vector, ctx,
UNIT_PX, &length[i], &unit[i]);
if (error != CSS_OK) {
*ctx = orig_ctx;
return error;
}
- if (unit[i] & UNIT_ANGLE ||
- unit[i] & UNIT_TIME ||
+ if (unit[i] & UNIT_ANGLE ||
+ unit[i] & UNIT_TIME ||
unit[i] & UNIT_FREQ) {
*ctx = orig_ctx;
return CSS_INVALID;
@@ -163,7 +163,7 @@ css_error css__parse_background_position(css_language *c,
value[1] != BACKGROUND_POSITION_VERT_SET) {
/* Two keywords. Verify the axes differ */
if (((value[0] & 0xf) != 0 && (value[1] & 0xf) != 0) ||
- ((value[0] & 0xf0) != 0 &&
+ ((value[0] & 0xf0) != 0 &&
(value[1] & 0xf0) != 0)) {
*ctx = orig_ctx;
return CSS_INVALID;
@@ -175,7 +175,7 @@ css_error css__parse_background_position(css_language *c,
/* Verify the axes differ */
if (((value[0] & 0xf) != 0 && (value[1] & 0xf) != 0) ||
- ((value[0] & 0xf0) != 0 &&
+ ((value[0] & 0xf0) != 0 &&
(value[1] & 0xf0) != 0)) {
*ctx = orig_ctx;
return CSS_INVALID;
@@ -183,9 +183,9 @@ css_error css__parse_background_position(css_language *c,
}
}
- error = css__stylesheet_style_appendOPV(result,
- CSS_PROP_BACKGROUND_POSITION,
- flags,
+ error = css__stylesheet_style_appendOPV(result,
+ CSS_PROP_BACKGROUND_POSITION,
+ flags,
value[0] | value[1]);
if (error != CSS_OK) {
*ctx = orig_ctx;
diff --git a/src/parse/properties/border.c b/src/parse/properties/border.c
index 98ad08b..26cdbcd 100644
--- a/src/parse/properties/border.c
+++ b/src/parse/properties/border.c
@@ -56,9 +56,9 @@ css_error css__parse_border(css_language *c,
*ctx = orig_ctx;
error = css__parse_border_side(c, vector, ctx, result, BORDER_SIDE_LEFT);
- if (error != CSS_OK)
+ if (error != CSS_OK)
*ctx = orig_ctx;
-
+
return error;
-
+
}
diff --git a/src/parse/properties/border_color.c b/src/parse/properties/border_color.c
index 7495ffc..28d30b7 100644
--- a/src/parse/properties/border_color.c
+++ b/src/parse/properties/border_color.c
@@ -41,28 +41,28 @@ css_error css__parse_border_color(css_language *c,
/* Firstly, handle inherit */
token = parserutils_vector_peek(vector, *ctx);
- if (token == NULL)
+ if (token == NULL)
return CSS_INVALID;
-
+
if (is_css_inherit(c, token)) {
error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_TOP_COLOR);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_RIGHT_COLOR);
- if (error != CSS_OK)
- return error;
+ if (error != CSS_OK)
+ return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_BOTTOM_COLOR);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_LEFT_COLOR);
- if (error == CSS_OK)
+ if (error == CSS_OK)
parserutils_vector_iterate(vector, ctx);
return error;
- }
+ }
/* Attempt to parse up to 4 colours */
do {
diff --git a/src/parse/properties/border_spacing.c b/src/parse/properties/border_spacing.c
index e9949fd..2322a5a 100644
--- a/src/parse/properties/border_spacing.c
+++ b/src/parse/properties/border_spacing.c
@@ -27,8 +27,8 @@
* Post condition: \a *ctx is updated with the next token to process
* If the input is invalid, then \a *ctx remains unchanged.
*/
-css_error css__parse_border_spacing(css_language *c,
- const parserutils_vector *vector, int *ctx,
+css_error css__parse_border_spacing(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_style *result)
{
int orig_ctx = *ctx;
@@ -65,7 +65,7 @@ css_error css__parse_border_spacing(css_language *c,
return error;
}
- if (unit[0] & UNIT_ANGLE || unit[0] & UNIT_TIME ||
+ if (unit[0] & UNIT_ANGLE || unit[0] & UNIT_TIME ||
unit[0] & UNIT_FREQ || unit[0] & UNIT_PCT) {
*ctx = orig_ctx;
return CSS_INVALID;
@@ -78,16 +78,16 @@ css_error css__parse_border_spacing(css_language *c,
token = parserutils_vector_peek(vector, *ctx);
if (token != NULL) {
/* Attempt second length, ignoring errors.
- * The core !important parser will ensure
+ * The core !important parser will ensure
* any remaining junk is thrown out.
* Ctx will be preserved on error, as usual
*/
error = css__parse_unit_specifier(c, vector, ctx, UNIT_PX,
&length[1], &unit[1]);
if (error == CSS_OK) {
- if (unit[1] & UNIT_ANGLE ||
+ if (unit[1] & UNIT_ANGLE ||
unit[1] & UNIT_TIME ||
- unit[1] & UNIT_FREQ ||
+ unit[1] & UNIT_FREQ ||
unit[1] & UNIT_PCT) {
*ctx = orig_ctx;
return CSS_INVALID;
@@ -119,11 +119,11 @@ css_error css__parse_border_spacing(css_language *c,
return error;
}
- error = css__stylesheet_style_vappend(result,
- 4,
- length[0],
- unit[0],
- length[1],
+ error = css__stylesheet_style_vappend(result,
+ 4,
+ length[0],
+ unit[0],
+ length[1],
unit[1]);
}
diff --git a/src/parse/properties/border_style.c b/src/parse/properties/border_style.c
index d4a4d12..a0d264d 100644
--- a/src/parse/properties/border_style.c
+++ b/src/parse/properties/border_style.c
@@ -41,28 +41,28 @@ css_error css__parse_border_style(css_language *c,
/* Firstly, handle inherit */
token = parserutils_vector_peek(vector, *ctx);
- if (token == NULL)
+ if (token == NULL)
return CSS_INVALID;
-
+
if (is_css_inherit(c, token)) {
error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_TOP_STYLE);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_RIGHT_STYLE);
- if (error != CSS_OK)
- return error;
+ if (error != CSS_OK)
+ return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_BOTTOM_STYLE);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_LEFT_STYLE);
- if (error == CSS_OK)
+ if (error == CSS_OK)
parserutils_vector_iterate(vector, ctx);
return error;
- }
+ }
/* Attempt to parse up to 4 styles */
do {
@@ -73,7 +73,7 @@ css_error css__parse_border_style(css_language *c,
return CSS_INVALID;
}
- if (token->type != CSS_TOKEN_IDENT)
+ if (token->type != CSS_TOKEN_IDENT)
break;
if ((lwc_string_caseless_isequal(token->idata, c->strings[NONE], &match) == lwc_error_ok && match)) {
@@ -101,9 +101,9 @@ css_error css__parse_border_style(css_language *c,
}
side_count++;
-
+
parserutils_vector_iterate(vector, ctx);
-
+
consumeWhitespace(vector, ctx);
token = parserutils_vector_peek(vector, *ctx);
@@ -113,7 +113,7 @@ css_error css__parse_border_style(css_language *c,
#define SIDE_APPEND(OP,NUM) \
error = css__stylesheet_style_appendOPV(result, (OP), 0, side_val[(NUM)]); \
if (error != CSS_OK) \
- break
+ break
switch (side_count) {
case 1:
diff --git a/src/parse/properties/border_width.c b/src/parse/properties/border_width.c
index 8b86bc4..bc911c9 100644
--- a/src/parse/properties/border_width.c
+++ b/src/parse/properties/border_width.c
@@ -43,28 +43,28 @@ css_error css__parse_border_width(css_language *c,
/* Firstly, handle inherit */
token = parserutils_vector_peek(vector, *ctx);
- if (token == NULL)
+ if (token == NULL)
return CSS_INVALID;
-
+
if (is_css_inherit(c, token)) {
error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_TOP_WIDTH);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_RIGHT_WIDTH);
- if (error != CSS_OK)
- return error;
+ if (error != CSS_OK)
+ return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_BOTTOM_WIDTH);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_LEFT_WIDTH);
- if (error == CSS_OK)
+ if (error == CSS_OK)
parserutils_vector_iterate(vector, ctx);
return error;
- }
+ }
/* Attempt to parse up to 4 widths */
do {
diff --git a/src/parse/properties/clip.c b/src/parse/properties/clip.c
index 3d200f5..7862d4a 100644
--- a/src/parse/properties/clip.c
+++ b/src/parse/properties/clip.c
@@ -27,8 +27,8 @@
* Post condition: \a *ctx is updated with the next token to process
* If the input is invalid, then \a *ctx remains unchanged.
*/
-css_error css__parse_clip(css_language *c,
- const parserutils_vector *vector, int *ctx,
+css_error css__parse_clip(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_style *result)
{
int orig_ctx = *ctx;
@@ -39,7 +39,7 @@ css_error css__parse_clip(css_language *c,
uint32_t unit[4] = { 0 };
bool match;
- /* FUNCTION(rect) [ [ IDENT(auto) | length ] CHAR(,)? ]{3}
+ /* FUNCTION(rect) [ [ IDENT(auto) | length ] CHAR(,)? ]{3}
* [ IDENT(auto) | length ] CHAR{)} |
* IDENT(auto, inherit) */
token = parserutils_vector_iterate(vector, ctx);
@@ -81,11 +81,11 @@ css_error css__parse_clip(css_language *c,
}
if (token->type == CSS_TOKEN_IDENT) {
- /* Slightly magical way of generating the auto
+ /* Slightly magical way of generating the auto
* values. These are bits 3-6 of the value. */
if ((lwc_string_caseless_isequal(
token->idata, c->strings[AUTO],
- &match) == lwc_error_ok &&
+ &match) == lwc_error_ok &&
match))
value |= 1 << (i + 3);
else {
@@ -95,16 +95,16 @@ css_error css__parse_clip(css_language *c,
parserutils_vector_iterate(vector, ctx);
} else {
- error = css__parse_unit_specifier(c, vector, ctx,
- UNIT_PX,
- &length[num_lengths],
+ error = css__parse_unit_specifier(c, vector, ctx,
+ UNIT_PX,
+ &length[num_lengths],
&unit[num_lengths]);
if (error != CSS_OK) {
*ctx = orig_ctx;
return error;
}
- if (unit[num_lengths] & UNIT_ANGLE ||
+ if (unit[num_lengths] & UNIT_ANGLE ||
unit[num_lengths] & UNIT_TIME ||
unit[num_lengths] & UNIT_FREQ ||
unit[num_lengths] & UNIT_PCT) {
@@ -150,11 +150,11 @@ css_error css__parse_clip(css_language *c,
}
for (i = 0; i < num_lengths; i++) {
- error = css__stylesheet_style_vappend(result,
- 2,
- length[i],
+ error = css__stylesheet_style_vappend(result,
+ 2,
+ length[i],
unit[i]);
- if (error != CSS_OK)
+ if (error != CSS_OK)
break;
}
diff --git a/src/parse/properties/content.c b/src/parse/properties/content.c
index 860d0f1..10f221f 100644
--- a/src/parse/properties/content.c
+++ b/src/parse/properties/content.c
@@ -127,15 +127,15 @@ css_error css__parse_content(css_language *c,
error = c->sheet->resolve(c->sheet->resolve_pw,
c->sheet->url,
- token->idata,
+ token->idata,
&uri);
if (error != CSS_OK) {
*ctx = orig_ctx;
return error;
}
- error = css__stylesheet_string_add(c->sheet,
- uri,
+ error = css__stylesheet_string_add(c->sheet,
+ uri,
&uri_snumber);
if (error != CSS_OK) {
*ctx = orig_ctx;
diff --git a/src/parse/properties/css_property_parser_gen.c b/src/parse/properties/css_property_parser_gen.c
index a430c9b..0e6ce72 100644
--- a/src/parse/properties/css_property_parser_gen.c
+++ b/src/parse/properties/css_property_parser_gen.c
@@ -109,8 +109,8 @@ void output_header(FILE *outputf, const char *descriptor, struct keyval *parser_
" const parserutils_vector *vector, int *ctx,\n"
" css_style *result%s)\n"
"{\n",
- descriptor,
- parser_id->key,
+ descriptor,
+ parser_id->key,
is_generic ? " * \\param op Bytecode OpCode for CSS property to encode\n" : "",
parser_id->key,
is_generic ? ", enum css_properties_e op" : "");
@@ -249,7 +249,7 @@ void output_number(FILE *outputf, struct keyval *parseid, struct keyval_list *kv
"\t\tif (%s) {\n"
"\t\t\t*ctx = orig_ctx;\n"
"\t\t\treturn CSS_INVALID;\n"
- "\t\t}\n\n",
+ "\t\t}\n\n",
ulkv->val);
}
@@ -264,7 +264,7 @@ void output_number(FILE *outputf, struct keyval *parseid, struct keyval_list *kv
"\t\terror = css__stylesheet_style_append(result, num);\n"
"\t} else ",
parseid->val,
- ckv->val);
+ ckv->val);
}
void output_color(FILE *outputf, struct keyval *parseid, struct keyval_list *kvlist)
@@ -317,21 +317,21 @@ void output_length_unit(FILE *outputf, struct keyval *parseid, struct keyval_lis
"\t\tif ((%s) == false) {\n"
"\t\t\t*ctx = orig_ctx;\n"
"\t\t\treturn CSS_INVALID;\n"
- "\t\t}\n\n",
+ "\t\t}\n\n",
ulkv->val);
} else if (strcmp(ulkv->key, "DISALLOW") == 0) {
fprintf(outputf,
"\t\tif (%s) {\n"
"\t\t\t*ctx = orig_ctx;\n"
"\t\t\treturn CSS_INVALID;\n"
- "\t\t}\n\n",
+ "\t\t}\n\n",
ulkv->val);
} else if (strcmp(ulkv->key, "RANGE") == 0) {
fprintf(outputf,
"\t\tif (length %s) {\n"
"\t\t\t*ctx = orig_ctx;\n"
"\t\t\treturn CSS_INVALID;\n"
- "\t\t}\n\n",
+ "\t\t}\n\n",
ulkv->val);
}
@@ -350,9 +350,9 @@ void output_length_unit(FILE *outputf, struct keyval *parseid, struct keyval_lis
ckv->val);
}
-void
-output_ident_list(FILE *outputf,
- struct keyval *parseid,
+void
+output_ident_list(FILE *outputf,
+ struct keyval *parseid,
struct keyval_list *kvlist)
{
struct keyval *ckv = kvlist->item[0]; /* list type : opv value */
@@ -387,7 +387,7 @@ output_ident_list(FILE *outputf,
"\t\t\t\t*ctx = orig_ctx;\n"
"\t\t\t\treturn error;\n"
"\t\t\t}\n\n"
- "\t\t\terror = css__stylesheet_style_append(result, snumber);\n"
+ "\t\t\terror = css__stylesheet_style_append(result, snumber);\n"
"\t\t\tif (error != CSS_OK) {\n"
"\t\t\t\t*ctx = orig_ctx;\n"
"\t\t\t\treturn error;\n"
@@ -553,13 +553,13 @@ int main(int argc, char **argv)
curlist = &IDENT_LIST;
} else if (rkv->val[0] == ')') {
curlist = &base;
- }
+ }
} else if (strcmp(rkv->key, "LENGTH_UNIT") == 0) {
if (rkv->val[0] == '(') {
curlist = &LENGTH_UNIT;
} else if (rkv->val[0] == ')') {
curlist = &base;
- }
+ }
only_ident = false;
do_token_check = false;
} else if (strcmp(rkv->key, "COLOR") == 0) {
diff --git a/src/parse/properties/cue.c b/src/parse/properties/cue.c
index ea94adb..eef10d1 100644
--- a/src/parse/properties/cue.c
+++ b/src/parse/properties/cue.c
@@ -27,8 +27,8 @@
* Post condition: \a *ctx is updated with the next token to process
* If the input is invalid, then \a *ctx remains unchanged.
*/
-css_error css__parse_cue(css_language *c,
- const parserutils_vector *vector, int *ctx,
+css_error css__parse_cue(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_style *result)
{
int orig_ctx = *ctx;
@@ -47,7 +47,7 @@ css_error css__parse_cue(css_language *c,
error = css__parse_cue_before(c, vector, ctx, result);
if (error == CSS_OK) {
/* first token parsed */
-
+
consumeWhitespace(vector, ctx);
token = parserutils_vector_peek(vector, *ctx);
@@ -62,7 +62,7 @@ css_error css__parse_cue(css_language *c,
error = CSS_INVALID;
} else {
error = css__parse_cue_after(c, vector, ctx, result);
- if (error == CSS_OK) {
+ if (error == CSS_OK) {
/* second token parsed */
if (is_css_inherit(c, first_token)) {
/* valid second token after inherit */
diff --git a/src/parse/properties/cursor.c b/src/parse/properties/cursor.c
index 6b9eadf..ad3ac47 100644
--- a/src/parse/properties/cursor.c
+++ b/src/parse/properties/cursor.c
@@ -26,8 +26,8 @@
* Post condition: \a *ctx is updated with the next token to process
* If the input is invalid, then \a *ctx remains unchanged.
*/
-css_error css__parse_cursor(css_language *c,
- const parserutils_vector *vector, int *ctx,
+css_error css__parse_cursor(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_style *result)
{
int orig_ctx = *ctx;
@@ -37,11 +37,11 @@ css_error css__parse_cursor(css_language *c,
/* [ (URI ',')* IDENT(auto, crosshair, default, pointer, move, e-resize,
* ne-resize, nw-resize, n-resize, se-resize, sw-resize,
- * s-resize, w-resize, text, wait, help, progress) ]
- * | IDENT(inherit)
+ * s-resize, w-resize, text, wait, help, progress) ]
+ * | IDENT(inherit)
*/
token = parserutils_vector_iterate(vector, ctx);
- if ((token == NULL) ||
+ if ((token == NULL) ||
(token->type != CSS_TOKEN_IDENT &&
token->type != CSS_TOKEN_URI)) {
*ctx = orig_ctx;
@@ -75,8 +75,8 @@ css_error css__parse_cursor(css_language *c,
return error;
}
- error = css__stylesheet_string_add(c->sheet,
- uri,
+ error = css__stylesheet_string_add(c->sheet,
+ uri,
&uri_snumber);
if (error != CSS_OK) {
*ctx = orig_ctx;
diff --git a/src/parse/properties/elevation.c b/src/parse/properties/elevation.c
index 0b5fdc4..fea35a3 100644
--- a/src/parse/properties/elevation.c
+++ b/src/parse/properties/elevation.c
@@ -27,8 +27,8 @@
* Post condition: \a *ctx is updated with the next token to process
* If the input is invalid, then \a *ctx remains unchanged.
*/
-css_error css__parse_elevation(css_language *c,
- const parserutils_vector *vector, int *ctx,
+css_error css__parse_elevation(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_style *result)
{
int orig_ctx = *ctx;
diff --git a/src/parse/properties/font.c b/src/parse/properties/font.c
index 2cdb488..9903f75 100644
--- a/src/parse/properties/font.c
+++ b/src/parse/properties/font.c
@@ -15,7 +15,7 @@
static css_error parse_system_font(css_language *c,
- css_style *result, css_system_font *system_font)
+ css_style *result, css_system_font *system_font)
{
css_error error;
bool match;
@@ -38,7 +38,7 @@ static css_error parse_system_font(css_language *c,
error = CSS_BADPARM;
break;
}
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
/* variant */
@@ -55,8 +55,8 @@ static css_error parse_system_font(css_language *c,
error = CSS_BADPARM;
break;
}
- if (error != CSS_OK)
- return error;
+ if (error != CSS_OK)
+ return error;
/* weight */
switch(system_font->weight) {
@@ -116,29 +116,29 @@ static css_error parse_system_font(css_language *c,
error = CSS_BADPARM;
break;
}
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
/* size */
error = css__stylesheet_style_appendOPV(result, CSS_PROP_FONT_SIZE, 0, FONT_SIZE_DIMENSION);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css__stylesheet_style_vappend(result, 2, system_font->size.size, system_font->size.unit);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
/* line height */
error = css__stylesheet_style_appendOPV(result, CSS_PROP_LINE_HEIGHT, 0, LINE_HEIGHT_DIMENSION);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css__stylesheet_style_vappend(result, 2, system_font->line_height.size, system_font->line_height.unit);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
/* font family */
- if ((lwc_string_caseless_isequal(system_font->family, c->strings[SERIF], &match) == lwc_error_ok && match))
+ if ((lwc_string_caseless_isequal(system_font->family, c->strings[SERIF], &match) == lwc_error_ok && match))
error = css__stylesheet_style_appendOPV(result, CSS_PROP_FONT_FAMILY, 0, FONT_FAMILY_SERIF);
else if ((lwc_string_caseless_isequal(system_font->family, c->strings[SANS_SERIF], &match) == lwc_error_ok && match))
error = css__stylesheet_style_appendOPV(result, CSS_PROP_FONT_FAMILY, 0, FONT_FAMILY_SANS_SERIF);
@@ -207,47 +207,47 @@ css_error css__parse_font(css_language *c,
/* Firstly, handle inherit */
token = parserutils_vector_peek(vector, *ctx);
- if (token == NULL)
+ if (token == NULL)
return CSS_INVALID;
-
+
if (is_css_inherit(c, token)) {
error = css_stylesheet_style_inherit(result, CSS_PROP_FONT_STYLE);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_FONT_VARIANT);
- if (error != CSS_OK)
- return error;
+ if (error != CSS_OK)
+ return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_FONT_WEIGHT);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_FONT_SIZE);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_LINE_HEIGHT);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_FONT_FAMILY);
- if (error == CSS_OK)
+ if (error == CSS_OK)
parserutils_vector_iterate(vector, ctx);
return error;
- }
+ }
/* Perhaps an unknown font name; ask the client */
- if ((token->type == CSS_TOKEN_IDENT) &&
+ if ((token->type == CSS_TOKEN_IDENT) &&
(c->sheet->font != NULL) &&
- (c->sheet->font(c->sheet->font_pw,
- token->idata,
+ (c->sheet->font(c->sheet->font_pw,
+ token->idata,
&system_font) == CSS_OK)) {
-
+
error = parse_system_font(c, result, &system_font);
- if (error == CSS_OK)
+ if (error == CSS_OK)
parserutils_vector_iterate(vector, ctx);
return error;
@@ -256,7 +256,7 @@ css_error css__parse_font(css_language *c,
/* allocate styles */
error = css__stylesheet_style_create(c->sheet, &style_style);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css__stylesheet_style_create(c->sheet, &variant_style);
@@ -312,15 +312,15 @@ css_error css__parse_font(css_language *c,
goto css__parse_font_cleanup;
}
- if ((style) &&
+ if ((style) &&
(error = css__parse_font_style(c, vector,
ctx, style_style)) == CSS_OK) {
style = false;
- } else if ((variant) &&
+ } else if ((variant) &&
(error = css__parse_font_variant(c, vector, ctx,
variant_style)) == CSS_OK) {
variant = false;
- } else if ((weight) &&
+ } else if ((weight) &&
(error = css__parse_font_weight(c, vector, ctx,
weight_style)) == CSS_OK) {
weight = false;
@@ -389,23 +389,23 @@ css_error css__parse_font(css_language *c,
/* defaults */
if (style) {
- error = css__stylesheet_style_appendOPV(style_style,
- CSS_PROP_FONT_STYLE, 0,
+ error = css__stylesheet_style_appendOPV(style_style,
+ CSS_PROP_FONT_STYLE, 0,
FONT_STYLE_NORMAL);
if (error != CSS_OK)
goto css__parse_font_cleanup;
}
if (variant) {
- error = css__stylesheet_style_appendOPV(variant_style,
- CSS_PROP_FONT_VARIANT, 0,
+ error = css__stylesheet_style_appendOPV(variant_style,
+ CSS_PROP_FONT_VARIANT, 0,
FONT_VARIANT_NORMAL);
if (error != CSS_OK)
goto css__parse_font_cleanup;
}
if (weight) {
- error = css__stylesheet_style_appendOPV(weight_style,
+ error = css__stylesheet_style_appendOPV(weight_style,
CSS_PROP_FONT_WEIGHT,
0, FONT_WEIGHT_NORMAL);
if (error != CSS_OK)
@@ -413,7 +413,7 @@ css_error css__parse_font(css_language *c,
}
if (line_height) {
- error = css__stylesheet_style_appendOPV(line_height_style,
+ error = css__stylesheet_style_appendOPV(line_height_style,
CSS_PROP_LINE_HEIGHT,
0, LINE_HEIGHT_NORMAL);
if (error != CSS_OK)
diff --git a/src/parse/properties/font_family.c b/src/parse/properties/font_family.c
index 60c069d..23c080b 100644
--- a/src/parse/properties/font_family.c
+++ b/src/parse/properties/font_family.c
@@ -98,8 +98,8 @@ static css_code_t font_family_value(css_language *c, const css_token *token, boo
* Post condition: \a *ctx is updated with the next token to process
* If the input is invalid, then \a *ctx remains unchanged.
*/
-css_error css__parse_font_family(css_language *c,
- const parserutils_vector *vector, int *ctx,
+css_error css__parse_font_family(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_style *result)
{
int orig_ctx = *ctx;
@@ -108,11 +108,11 @@ css_error css__parse_font_family(css_language *c,
bool match;
/* [ IDENT+ | STRING ] [ ',' [ IDENT+ | STRING ] ]* | IDENT(inherit)
- *
+ *
* In the case of IDENT+, any whitespace between tokens is collapsed to
* a single space
*
- * \todo Mozilla makes the comma optional.
+ * \todo Mozilla makes the comma optional.
* Perhaps this is a quirk we should inherit?
*/
diff --git a/src/parse/properties/font_weight.c b/src/parse/properties/font_weight.c
index 4853106..8e57e5f 100644
--- a/src/parse/properties/font_weight.c
+++ b/src/parse/properties/font_weight.c
@@ -27,8 +27,8 @@
* Post condition: \a *ctx is updated with the next token to process
* If the input is invalid, then \a *ctx remains unchanged.
*/
-css_error css__parse_font_weight(css_language *c,
- const parserutils_vector *vector, int *ctx,
+css_error css__parse_font_weight(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_style *result)
{
int orig_ctx = *ctx;
@@ -38,7 +38,7 @@ css_error css__parse_font_weight(css_language *c,
uint16_t value = 0;
bool match;
- /* NUMBER (100, 200, 300, 400, 500, 600, 700, 800, 900) |
+ /* NUMBER (100, 200, 300, 400, 500, 600, 700, 800, 900) |
* IDENT (normal, bold, bolder, lighter, inherit) */
token = parserutils_vector_iterate(vector, ctx);
if (token == NULL || (token->type != CSS_TOKEN_IDENT &&
@@ -53,7 +53,7 @@ css_error css__parse_font_weight(css_language *c,
flags |= FLAG_INHERIT;
} else if (token->type == CSS_TOKEN_NUMBER) {
size_t consumed = 0;
- css_fixed num = css__number_from_lwc_string(token->idata,
+ css_fixed num = css__number_from_lwc_string(token->idata,
true, &consumed);
/* Invalid if there are trailing characters */
if (consumed != lwc_string_length(token->idata)) {
@@ -98,9 +98,9 @@ css_error css__parse_font_weight(css_language *c,
CSS_PROP_FONT_WEIGHT,
flags,
value);
- if (error != CSS_OK)
+ if (error != CSS_OK)
*ctx = orig_ctx;
-
+
return error;
}
diff --git a/src/parse/properties/list_style.c b/src/parse/properties/list_style.c
index 4ef4ce8..f12fa2e 100644
--- a/src/parse/properties/list_style.c
+++ b/src/parse/properties/list_style.c
@@ -44,29 +44,29 @@ css_error css__parse_list_style(css_language *c,
/* Firstly, handle inherit */
token = parserutils_vector_peek(vector, *ctx);
- if (token == NULL)
+ if (token == NULL)
return CSS_INVALID;
-
+
if (is_css_inherit(c, token)) {
error = css_stylesheet_style_inherit(result, CSS_PROP_LIST_STYLE_IMAGE);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_LIST_STYLE_POSITION);
- if (error != CSS_OK)
- return error;
+ if (error != CSS_OK)
+ return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_LIST_STYLE_TYPE);
- if (error == CSS_OK)
+ if (error == CSS_OK)
parserutils_vector_iterate(vector, ctx);
return error;
- }
+ }
/* allocate styles */
error = css__stylesheet_style_create(c->sheet, &image_style);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css__stylesheet_style_create(c->sheet, &position_style);
@@ -94,15 +94,15 @@ css_error css__parse_list_style(css_language *c,
goto css__parse_list_style_cleanup;
}
- if ((type) &&
+ if ((type) &&
(error = css__parse_list_style_type(c, vector,
ctx, type_style)) == CSS_OK) {
type = false;
- } else if ((position) &&
- (error = css__parse_list_style_position(c, vector,
+ } else if ((position) &&
+ (error = css__parse_list_style_position(c, vector,
ctx, position_style)) == CSS_OK) {
position = false;
- } else if ((image) &&
+ } else if ((image) &&
(error = css__parse_list_style_image(c, vector, ctx,
image_style)) == CSS_OK) {
image = false;
@@ -121,19 +121,19 @@ css_error css__parse_list_style(css_language *c,
/* defaults */
if (image) {
- error = css__stylesheet_style_appendOPV(image_style,
+ error = css__stylesheet_style_appendOPV(image_style,
CSS_PROP_LIST_STYLE_IMAGE,
0, LIST_STYLE_IMAGE_NONE);
}
if (position) {
- error = css__stylesheet_style_appendOPV(position_style,
+ error = css__stylesheet_style_appendOPV(position_style,
CSS_PROP_LIST_STYLE_POSITION,
0, LIST_STYLE_POSITION_OUTSIDE);
}
if (type) {
- error = css__stylesheet_style_appendOPV(type_style,
+ error = css__stylesheet_style_appendOPV(type_style,
CSS_PROP_LIST_STYLE_TYPE,
0, LIST_STYLE_TYPE_DISC);
}
diff --git a/src/parse/properties/list_style_type.c b/src/parse/properties/list_style_type.c
index b73bcb7..ccaa133 100644
--- a/src/parse/properties/list_style_type.c
+++ b/src/parse/properties/list_style_type.c
@@ -27,8 +27,8 @@
* Post condition: \a *ctx is updated with the next token to process
* If the input is invalid, then \a *ctx remains unchanged.
*/
-css_error css__parse_list_style_type(css_language *c,
- const parserutils_vector *vector, int *ctx,
+css_error css__parse_list_style_type(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_style *result)
{
int orig_ctx = *ctx;
@@ -63,8 +63,8 @@ css_error css__parse_list_style_type(css_language *c,
error = css__stylesheet_style_appendOPV(result, CSS_PROP_LIST_STYLE_TYPE, flags, value);
- if (error != CSS_OK)
+ if (error != CSS_OK)
*ctx = orig_ctx;
-
+
return error;
}
diff --git a/src/parse/properties/margin.c b/src/parse/properties/margin.c
index 896e300..7817d50 100644
--- a/src/parse/properties/margin.c
+++ b/src/parse/properties/margin.c
@@ -43,28 +43,28 @@ css_error css__parse_margin(css_language *c,
/* Firstly, handle inherit */
token = parserutils_vector_peek(vector, *ctx);
- if (token == NULL)
+ if (token == NULL)
return CSS_INVALID;
-
+
if (is_css_inherit(c, token)) {
error = css_stylesheet_style_inherit(result, CSS_PROP_MARGIN_TOP);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_MARGIN_RIGHT);
- if (error != CSS_OK)
- return error;
+ if (error != CSS_OK)
+ return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_MARGIN_BOTTOM);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_MARGIN_LEFT);
- if (error == CSS_OK)
+ if (error == CSS_OK)
parserutils_vector_iterate(vector, ctx);
return error;
- }
+ }
/* Attempt to parse up to 4 widths */
do {
diff --git a/src/parse/properties/opacity.c b/src/parse/properties/opacity.c
index edad9f8..e8b7c3e 100644
--- a/src/parse/properties/opacity.c
+++ b/src/parse/properties/opacity.c
@@ -73,7 +73,7 @@ css_error css__parse_opacity(css_language *c,
if (error != CSS_OK)
*ctx = orig_ctx;
-
+
return error;
}
diff --git a/src/parse/properties/outline.c b/src/parse/properties/outline.c
index eb4f525..d9d9ec2 100644
--- a/src/parse/properties/outline.c
+++ b/src/parse/properties/outline.c
@@ -44,29 +44,29 @@ css_error css__parse_outline(css_language *c,
/* Firstly, handle inherit */
token = parserutils_vector_peek(vector, *ctx);
- if (token == NULL)
+ if (token == NULL)
return CSS_INVALID;
-
+
if (is_css_inherit(c, token)) {
error = css_stylesheet_style_inherit(result, CSS_PROP_OUTLINE_COLOR);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_OUTLINE_STYLE);
- if (error != CSS_OK)
- return error;
+ if (error != CSS_OK)
+ return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_OUTLINE_WIDTH);
- if (error == CSS_OK)
+ if (error == CSS_OK)
parserutils_vector_iterate(vector, ctx);
return error;
- }
+ }
/* allocate styles */
error = css__stylesheet_style_create(c->sheet, &color_style);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css__stylesheet_style_create(c->sheet, &style_style);
@@ -94,19 +94,19 @@ css_error css__parse_outline(css_language *c,
goto css__parse_outline_cleanup;
}
- if ((color) &&
+ if ((color) &&
(error = css__parse_outline_color(c, vector, ctx,
color_style)) == CSS_OK) {
color = false;
- } else if ((style) &&
- (error = css__parse_outline_style(c, vector,
+ } else if ((style) &&
+ (error = css__parse_outline_style(c, vector,
ctx, style_style)) == CSS_OK) {
style = false;
- } else if ((width) &&
+ } else if ((width) &&
(error = css__parse_outline_width(c, vector,
ctx, width_style)) == CSS_OK) {
width = false;
- }
+ }
if (error == CSS_OK) {
consumeWhitespace(vector, ctx);
@@ -121,19 +121,19 @@ css_error css__parse_outline(css_language *c,
/* defaults */
if (color) {
- error = css__stylesheet_style_appendOPV(color_style,
+ error = css__stylesheet_style_appendOPV(color_style,
CSS_PROP_OUTLINE_COLOR,
0, OUTLINE_COLOR_INVERT);
}
if (style) {
- error = css__stylesheet_style_appendOPV(style_style,
+ error = css__stylesheet_style_appendOPV(style_style,
CSS_PROP_OUTLINE_STYLE,
0, OUTLINE_STYLE_NONE);
}
if (width) {
- error = css__stylesheet_style_appendOPV(width_style,
+ error = css__stylesheet_style_appendOPV(width_style,
CSS_PROP_OUTLINE_WIDTH,
0, OUTLINE_WIDTH_MEDIUM);
}
diff --git a/src/parse/properties/padding.c b/src/parse/properties/padding.c
index 7a5b88b..7f5b9f6 100644
--- a/src/parse/properties/padding.c
+++ b/src/parse/properties/padding.c
@@ -41,28 +41,28 @@ css_error css__parse_padding(css_language *c,
/* Firstly, handle inherit */
token = parserutils_vector_peek(vector, *ctx);
- if (token == NULL)
+ if (token == NULL)
return CSS_INVALID;
-
+
if (is_css_inherit(c, token)) {
error = css_stylesheet_style_inherit(result, CSS_PROP_PADDING_TOP);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_PADDING_RIGHT);
- if (error != CSS_OK)
- return error;
+ if (error != CSS_OK)
+ return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_PADDING_BOTTOM);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_PADDING_LEFT);
- if (error == CSS_OK)
+ if (error == CSS_OK)
parserutils_vector_iterate(vector, ctx);
return error;
- }
+ }
/* Attempt to parse up to 4 widths */
do {
@@ -81,7 +81,7 @@ css_error css__parse_padding(css_language *c,
*ctx = orig_ctx;
return CSS_INVALID;
}
-
+
if (side_length[side_count] < 0) {
*ctx = orig_ctx;
return CSS_INVALID;
diff --git a/src/parse/properties/pause.c b/src/parse/properties/pause.c
index fcb4644..e45a8f4 100644
--- a/src/parse/properties/pause.c
+++ b/src/parse/properties/pause.c
@@ -62,7 +62,7 @@ css_error css__parse_pause(css_language *c,
error = CSS_INVALID;
} else {
error = css__parse_pause_after(c, vector, ctx, result);
- if (error == CSS_OK) {
+ if (error == CSS_OK) {
/* second token parsed */
if (is_css_inherit(c, first_token)) {
/* valid second token after inherit */
diff --git a/src/parse/properties/play_during.c b/src/parse/properties/play_during.c
index 1e5ad63..109ae64 100644
--- a/src/parse/properties/play_during.c
+++ b/src/parse/properties/play_during.c
@@ -27,8 +27,8 @@
* Post condition: \a *ctx is updated with the next token to process
* If the input is invalid, then \a *ctx remains unchanged.
*/
-css_error css__parse_play_during(css_language *c,
- const parserutils_vector *vector, int *ctx,
+css_error css__parse_play_during(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_style *result)
{
int orig_ctx = *ctx;
@@ -42,7 +42,7 @@ css_error css__parse_play_during(css_language *c,
/* URI [ IDENT(mix) || IDENT(repeat) ]? | IDENT(auto,none,inherit) */
token = parserutils_vector_iterate(vector, ctx);
- if ((token == NULL) ||
+ if ((token == NULL) ||
((token->type != CSS_TOKEN_IDENT) &&
(token->type != CSS_TOKEN_URI))) {
*ctx = orig_ctx;
@@ -79,8 +79,8 @@ css_error css__parse_play_during(css_language *c,
return error;
}
- error = css__stylesheet_string_add(c->sheet,
- uri,
+ error = css__stylesheet_string_add(c->sheet,
+ uri,
&uri_snumber);
if (error != CSS_OK) {
*ctx = orig_ctx;
@@ -95,7 +95,7 @@ css_error css__parse_play_during(css_language *c,
if (token != NULL && token->type == CSS_TOKEN_IDENT) {
if ((lwc_string_caseless_isequal(
token->idata, c->strings[MIX],
- &match) == lwc_error_ok &&
+ &match) == lwc_error_ok &&
match)) {
if ((value & PLAY_DURING_MIX) == 0)
value |= PLAY_DURING_MIX;
@@ -104,7 +104,7 @@ css_error css__parse_play_during(css_language *c,
return CSS_INVALID;
}
} else if (lwc_string_caseless_isequal(
- token->idata,
+ token->idata,
c->strings[REPEAT],
&match) == lwc_error_ok &&
match) {
@@ -130,12 +130,12 @@ css_error css__parse_play_during(css_language *c,
return error;
}
- if ((flags & FLAG_INHERIT) == false &&
+ if ((flags & FLAG_INHERIT) == false &&
(value & PLAY_DURING_TYPE_MASK) == PLAY_DURING_URI) {
error = css__stylesheet_style_append(result, uri_snumber);
}
- if (error != CSS_OK)
+ if (error != CSS_OK)
*ctx = orig_ctx;
return error;
diff --git a/src/parse/properties/properties.h b/src/parse/properties/properties.h
index e7b2bf7..4517515 100644
--- a/src/parse/properties/properties.h
+++ b/src/parse/properties/properties.h
@@ -16,32 +16,32 @@
/**
* Type of property handler function
*/
-typedef css_error (*css_prop_handler)(css_language *c,
- const parserutils_vector *vector, int *ctx,
+typedef css_error (*css_prop_handler)(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
extern const css_prop_handler property_handlers[LAST_PROP + 1 - FIRST_PROP];
css_error css__parse_azimuth(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_background(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_background_attachment(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_background_color(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_background_image(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_background_position(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_background_repeat(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border(css_language *c,
const parserutils_vector *vector, int *ctx,
@@ -50,46 +50,46 @@ css_error css__parse_border_bottom(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_bottom_color(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_bottom_style(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_bottom_width(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_color(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_collapse(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_left(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_left_color(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_left_style(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_left_width(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_right(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_right_color(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_right_style(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_right_width(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_spacing(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_style(css_language *c,
const parserutils_vector *vector, int *ctx,
@@ -98,19 +98,19 @@ css_error css__parse_border_top(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_top_color(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_top_style(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_top_width(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_border_width(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_bottom(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_box_sizing(css_language *c,
const parserutils_vector *vector, int *ctx,
@@ -125,169 +125,169 @@ css_error css__parse_break_inside(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_caption_side(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_clear(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_clip(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_color(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_columns(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_column_count(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_column_fill(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_column_gap(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_column_rule(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_column_rule_color(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_column_rule_style(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_column_rule_width(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_column_span(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_column_width(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_content(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_counter_increment(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_counter_reset(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_cue(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_cue_after(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_cue_before(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_cursor(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_direction(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_display(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_elevation(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_empty_cells(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_float(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_font(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_font_family(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_font_size(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_font_style(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_font_variant(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_font_weight(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_height(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_left(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_letter_spacing(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_line_height(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_list_style(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_list_style_image(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_list_style_position(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_list_style_type(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_margin(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_margin_bottom(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_margin_left(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_margin_right(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_margin_top(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_max_height(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_max_width(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_min_height(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_min_width(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_opacity(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_orphans(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_outline(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_outline_color(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_outline_style(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_outline_width(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_overflow(css_language *c,
const parserutils_vector *vector, int *ctx,
@@ -302,124 +302,124 @@ css_error css__parse_padding(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_padding_bottom(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_padding_left(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_padding_right(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_padding_top(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_page_break_after(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_page_break_before(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_page_break_inside(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_pause(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_pause_after(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_pause_before(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_pitch_range(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_pitch(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_play_during(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_position(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_quotes(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_richness(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_right(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_speak_header(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_speak_numeral(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_speak_punctuation(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_speak(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_speech_rate(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_stress(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_table_layout(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_text_align(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_text_decoration(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_text_indent(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_text_transform(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_top(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_unicode_bidi(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_vertical_align(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_visibility(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_voice_family(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_volume(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_white_space(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_widows(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_width(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_word_spacing(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_writing_mode(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
css_error css__parse_z_index(css_language *c,
- const parserutils_vector *vector, int *ctx,
+ const parserutils_vector *vector, int *ctx,
css_style *result);
#endif
diff --git a/src/parse/properties/quotes.c b/src/parse/properties/quotes.c
index b7fc294..9d3c4c9 100644
--- a/src/parse/properties/quotes.c
+++ b/src/parse/properties/quotes.c
@@ -69,39 +69,39 @@ css_error css__parse_quotes(css_language *c,
uint32_t open_snumber;
uint32_t close_snumber;
- error = css__stylesheet_string_add(c->sheet,
- lwc_string_ref(token->idata),
+ error = css__stylesheet_string_add(c->sheet,
+ lwc_string_ref(token->idata),
&open_snumber);
- if (error != CSS_OK)
+ if (error != CSS_OK)
break;
consumeWhitespace(vector, ctx);
token = parserutils_vector_iterate(vector, ctx);
- if ((token == NULL) ||
+ if ((token == NULL) ||
(token->type != CSS_TOKEN_STRING)) {
error = CSS_INVALID;
break;
}
- error = css__stylesheet_string_add(c->sheet,
- lwc_string_ref(token->idata),
+ error = css__stylesheet_string_add(c->sheet,
+ lwc_string_ref(token->idata),
&close_snumber);
- if (error != CSS_OK)
+ if (error != CSS_OK)
break;
consumeWhitespace(vector, ctx);
error = CSS_FIRST_APPEND(QUOTES_STRING);
- if (error != CSS_OK)
+ if (error != CSS_OK)
break;
error = css__stylesheet_style_append(result, open_snumber);
- if (error != CSS_OK)
+ if (error != CSS_OK)
break;
error = css__stylesheet_style_append(result, close_snumber);
- if (error != CSS_OK)
+ if (error != CSS_OK)
break;
first = false;
@@ -115,7 +115,7 @@ css_error css__parse_quotes(css_language *c,
if (error == CSS_OK) {
/* AddTerminator */
error = css__stylesheet_style_append(result, QUOTES_NONE);
- }
+ }
} else {
error = CSS_INVALID;
}
diff --git a/src/parse/properties/text_decoration.c b/src/parse/properties/text_decoration.c
index 9bfdec2..a7bae24 100644
--- a/src/parse/properties/text_decoration.c
+++ b/src/parse/properties/text_decoration.c
@@ -27,8 +27,8 @@
* Post condition: \a *ctx is updated with the next token to process
* If the input is invalid, then \a *ctx remains unchanged.
*/
-css_error css__parse_text_decoration(css_language *c,
- const parserutils_vector *vector, int *ctx,
+css_error css__parse_text_decoration(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_style *result)
{
int orig_ctx = *ctx;
diff --git a/src/parse/properties/utils.c b/src/parse/properties/utils.c
index 82dacf8..47b06e3 100644
--- a/src/parse/properties/utils.c
+++ b/src/parse/properties/utils.c
@@ -136,28 +136,28 @@ css_error css__parse_border_side(css_language *c,
/* Firstly, handle inherit */
token = parserutils_vector_peek(vector, *ctx);
- if (token == NULL)
+ if (token == NULL)
return CSS_INVALID;
-
+
if (is_css_inherit(c, token)) {
error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_TOP_COLOR + side);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_TOP_STYLE + side);
- if (error != CSS_OK)
- return error;
+ if (error != CSS_OK)
+ return error;
error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_TOP_WIDTH + side);
- if (error == CSS_OK)
+ if (error == CSS_OK)
parserutils_vector_iterate(vector, ctx);
return error;
- }
+ }
/* allocate styles */
error = css__stylesheet_style_create(c->sheet, &color_style);
- if (error != CSS_OK)
+ if (error != CSS_OK)
return error;
error = css__stylesheet_style_create(c->sheet, &style_style);
@@ -188,19 +188,19 @@ css_error css__parse_border_side(css_language *c,
/* Try each property parser in turn, but only if we
* haven't already got a value for this property.
*/
- if ((color) &&
- (error = css__parse_border_side_color(c, vector, ctx,
+ if ((color) &&
+ (error = css__parse_border_side_color(c, vector, ctx,
color_style, CSS_PROP_BORDER_TOP_COLOR + side)) == CSS_OK) {
color = false;
- } else if ((style) &&
+ } else if ((style) &&
(error = css__parse_border_side_style(c, vector, ctx,
style_style, CSS_PROP_BORDER_TOP_STYLE + side)) == CSS_OK) {
style = false;
- } else if ((width) &&
+ } else if ((width) &&
(error = css__parse_border_side_width(c, vector, ctx,
width_style, CSS_PROP_BORDER_TOP_WIDTH + side)) == CSS_OK) {
width = false;
- }
+ }
if (error == CSS_OK) {
consumeWhitespace(vector, ctx);
@@ -214,7 +214,7 @@ css_error css__parse_border_side(css_language *c,
if (style) {
error = css__stylesheet_style_appendOPV(style_style,
- CSS_PROP_BORDER_TOP_STYLE + side, 0,
+ CSS_PROP_BORDER_TOP_STYLE + side, 0,
BORDER_STYLE_NONE);
if (error != CSS_OK)
goto css__parse_border_side_cleanup;
@@ -295,7 +295,7 @@ static void HSL_to_RGB(css_fixed hue, css_fixed sat, css_fixed lit, uint8_t *r,
/* Compute min(r,g,b) */
min_rgb = FSUB(FMUL(lit, INTTOFIX(2)), max_rgb);
- /* We know that the value of at least one of the components is
+ /* We know that the value of at least one of the components is
* max(r,g,b) and that the value of at least one of the other
* components is min(r,g,b).
*
@@ -370,7 +370,7 @@ css_error css__parse_colour_specifier(css_language *c,
consumeWhitespace(vector, ctx);
- /* IDENT(<colour name>) |
+ /* IDENT(<colour name>) |
* HASH(rgb | rrggbb) |
* FUNCTION(rgb) [ [ NUMBER | PERCENTAGE ] ',' ] {3} ')'
* FUNCTION(rgba) [ [ NUMBER | PERCENTAGE ] ',' ] {4} ')'
@@ -539,8 +539,8 @@ css_error css__parse_colour_specifier(css_language *c,
css_fixed hue, sat, lit;
int32_t alpha = 255;
- /* hue is a number without a unit representing an
- * angle (0-360) degrees
+ /* hue is a number without a unit representing an
+ * angle (0-360) degrees
*/
consumeWhitespace(vector, ctx);
@@ -615,7 +615,7 @@ css_error css__parse_colour_specifier(css_language *c,
if (!tokenIsChar(token, ','))
goto invalid;
-
+
consumeWhitespace(vector, ctx);
token = parserutils_vector_iterate(vector, ctx);
@@ -625,7 +625,7 @@ css_error css__parse_colour_specifier(css_language *c,
alpha = css__number_from_lwc_string(token->idata, false, &consumed);
if (consumed != lwc_string_length(token->idata))
goto invalid; /* failed to consume the whole string as a number */
-
+
alpha = FIXTOINT(FMUL(alpha, F_255));
consumeWhitespace(vector, ctx);
@@ -1074,11 +1074,11 @@ css_error css__ident_list_or_string_to_string(css_language *c,
lwc_string **result)
{
const css_token *token;
-
+
token = parserutils_vector_peek(vector, *ctx);
if (token == NULL)
return CSS_INVALID;
-
+
if (token->type == CSS_TOKEN_STRING) {
token = parserutils_vector_iterate(vector, ctx);
*result = lwc_string_ref(token->idata);
@@ -1087,7 +1087,7 @@ css_error css__ident_list_or_string_to_string(css_language *c,
return css__ident_list_to_string(c, vector, ctx, reserved,
result);
}
-
+
return CSS_INVALID;
}
@@ -1126,7 +1126,7 @@ css_error css__ident_list_to_string(css_language *c,
/* We know this token exists, and is an IDENT */
token = parserutils_vector_iterate(vector, ctx);
- /* Consume all subsequent IDENT or S tokens */
+ /* Consume all subsequent IDENT or S tokens */
while (token != NULL && (token->type == CSS_TOKEN_IDENT ||
token->type == CSS_TOKEN_S)) {
if (token->type == CSS_TOKEN_IDENT) {
@@ -1136,12 +1136,12 @@ css_error css__ident_list_to_string(css_language *c,
goto cleanup;
}
- perror = parserutils_buffer_append(buffer,
- (const uint8_t *) lwc_string_data(token->idata),
+ perror = parserutils_buffer_append(buffer,
+ (const uint8_t *) lwc_string_data(token->idata),
lwc_string_length(token->idata));
} else {
/* S */
- perror = parserutils_buffer_append(buffer,
+ perror = parserutils_buffer_append(buffer,
(const uint8_t *) " ", 1);
}
@@ -1232,7 +1232,7 @@ css_error css__comma_list_to_style(css_language *c,
if (error != CSS_OK)
goto cleanup;
- error = css__stylesheet_style_append(result,
+ error = css__stylesheet_style_append(result,
value);
if (error != CSS_OK)
goto cleanup;
@@ -1251,7 +1251,7 @@ css_error css__comma_list_to_style(css_language *c,
css_code_t value = get_value(c, token, first);
uint32_t snumber;
- error = css__stylesheet_string_add(c->sheet,
+ error = css__stylesheet_string_add(c->sheet,
lwc_string_ref(token->idata), &snumber);
if (error != CSS_OK)
goto cleanup;
diff --git a/src/parse/properties/utils.h b/src/parse/properties/utils.h
index b7b31da..e4c97c7 100644
--- a/src/parse/properties/utils.h
+++ b/src/parse/properties/utils.h
@@ -10,7 +10,7 @@
#include "parse/language.h"
-static inline bool is_css_inherit(css_language *c, const css_token *token)
+static inline bool is_css_inherit(css_language *c, const css_token *token)
{
bool match;
return ((token->type == CSS_TOKEN_IDENT) &&
@@ -168,7 +168,7 @@ css_error css__parse_colour_specifier(css_language *c,
const parserutils_vector *vector, int *ctx,
uint16_t *value, uint32_t *result);
-css_error css__parse_named_colour(css_language *c, lwc_string *data,
+css_error css__parse_named_colour(css_language *c, lwc_string *data,
uint32_t *result);
css_error css__parse_hash_colour(lwc_string *data, uint32_t *result);
@@ -178,7 +178,7 @@ css_error css__parse_unit_specifier(css_language *c,
uint32_t default_unit,
css_fixed *length, uint32_t *unit);
-css_error css__parse_unit_keyword(const char *ptr, size_t len,
+css_error css__parse_unit_keyword(const char *ptr, size_t len,
uint32_t *unit);
css_error css__ident_list_or_string_to_string(css_language *c,
@@ -195,7 +195,7 @@ css_error css__comma_list_to_style(css_language *c,
const parserutils_vector *vector, int *ctx,
bool (*reserved)(css_language *c, const css_token *ident),
css_code_t (*get_value)(css_language *c,
- const css_token *token,
+ const css_token *token,
bool first),
css_style *result);
diff --git a/src/parse/properties/voice_family.c b/src/parse/properties/voice_family.c
index 8a969a6..193cb6b 100644
--- a/src/parse/properties/voice_family.c
+++ b/src/parse/properties/voice_family.c
@@ -83,8 +83,8 @@ static css_code_t voice_family_value(css_language *c, const css_token *token, bo
* Post condition: \a *ctx is updated with the next token to process
* If the input is invalid, then \a *ctx remains unchanged.
*/
-css_error css__parse_voice_family(css_language *c,
- const parserutils_vector *vector, int *ctx,
+css_error css__parse_voice_family(css_language *c,
+ const parserutils_vector *vector, int *ctx,
css_style *result)
{
int orig_ctx = *ctx;
@@ -93,7 +93,7 @@ css_error css__parse_voice_family(css_language *c,
bool match;
/* [ IDENT+ | STRING ] [ ',' [ IDENT+ | STRING ] ]* | IDENT(inherit)
- *
+ *
* In the case of IDENT+, any whitespace between tokens is collapsed to
* a single space
*/
diff --git a/src/parse/propstrings.h b/src/parse/propstrings.h
index 1203c22..e0d16e2 100644
--- a/src/parse/propstrings.h
+++ b/src/parse/propstrings.h
@@ -22,15 +22,15 @@ enum {
CHARSET, LIBCSS_IMPORT, MEDIA, NAMESPACE, FONT_FACE, PAGE,
/* Media types */
- AURAL, BRAILLE, EMBOSSED, HANDHELD, PRINT, PROJECTION,
+ AURAL, BRAILLE, EMBOSSED, HANDHELD, PRINT, PROJECTION,
SCREEN, SPEECH, TTY, TV, ALL,
/* Pseudo classes */
- FIRST_CHILD, LINK, VISITED, HOVER, ACTIVE, FOCUS, LANG,
+ FIRST_CHILD, LINK, VISITED, HOVER, ACTIVE, FOCUS, LANG,
/* LEFT, RIGHT, -- already in properties */ FIRST,
ROOT, NTH_CHILD, NTH_LAST_CHILD, NTH_OF_TYPE, NTH_LAST_OF_TYPE,
LAST_CHILD, FIRST_OF_TYPE, LAST_OF_TYPE, ONLY_CHILD,
- ONLY_OF_TYPE, EMPTY, TARGET, ENABLED, DISABLED, CHECKED, NOT,
+ ONLY_OF_TYPE, EMPTY, TARGET, ENABLED, DISABLED, CHECKED, NOT,
/* Pseudo elements */
FIRST_LINE, FIRST_LETTER, BEFORE, AFTER,
@@ -38,14 +38,14 @@ enum {
/* Properties */
FIRST_PROP,
- AZIMUTH = FIRST_PROP, BACKGROUND, BACKGROUND_ATTACHMENT,
- BACKGROUND_COLOR, BACKGROUND_IMAGE, BACKGROUND_POSITION,
- BACKGROUND_REPEAT, BORDER, BORDER_BOTTOM, BORDER_BOTTOM_COLOR,
- BORDER_BOTTOM_STYLE, BORDER_BOTTOM_WIDTH, BORDER_COLLAPSE,
- BORDER_COLOR, BORDER_LEFT, BORDER_LEFT_COLOR, BORDER_LEFT_STYLE,
- BORDER_LEFT_WIDTH, BORDER_RIGHT, BORDER_RIGHT_COLOR,
- BORDER_RIGHT_STYLE, BORDER_RIGHT_WIDTH, BORDER_SPACING,
- BORDER_STYLE, BORDER_TOP, BORDER_TOP_COLOR, BORDER_TOP_STYLE,
+ AZIMUTH = FIRST_PROP, BACKGROUND, BACKGROUND_ATTACHMENT,
+ BACKGROUND_COLOR, BACKGROUND_IMAGE, BACKGROUND_POSITION,
+ BACKGROUND_REPEAT, BORDER, BORDER_BOTTOM, BORDER_BOTTOM_COLOR,
+ BORDER_BOTTOM_STYLE, BORDER_BOTTOM_WIDTH, BORDER_COLLAPSE,
+ BORDER_COLOR, BORDER_LEFT, BORDER_LEFT_COLOR, BORDER_LEFT_STYLE,
+ BORDER_LEFT_WIDTH, BORDER_RIGHT, BORDER_RIGHT_COLOR,
+ BORDER_RIGHT_STYLE, BORDER_RIGHT_WIDTH, BORDER_SPACING,
+ BORDER_STYLE, BORDER_TOP, BORDER_TOP_COLOR, BORDER_TOP_STYLE,
BORDER_TOP_WIDTH, BORDER_WIDTH, BOTTOM, BOX_SIZING, BREAK_AFTER,
BREAK_BEFORE, BREAK_INSIDE, CAPTION_SIDE, CLEAR, CLIP, COLOR, COLUMNS,
COLUMN_COUNT, COLUMN_FILL, COLUMN_GAP, COLUMN_RULE, COLUMN_RULE_COLOR,
@@ -79,7 +79,7 @@ enum {
TABLE_CELL, TABLE_CAPTION, BELOW, LEVEL, ABOVE, HIGHER, LOWER,
SHOW, HIDE, XX_SMALL, X_SMALL, SMALL, LARGE, X_LARGE, XX_LARGE,
LARGER, SMALLER, NORMAL, ITALIC, OBLIQUE, SMALL_CAPS, BOLD, BOLDER,
- LIGHTER, INSIDE, OUTSIDE, DISC, CIRCLE, SQUARE, DECIMAL,
+ LIGHTER, INSIDE, OUTSIDE, DISC, CIRCLE, SQUARE, DECIMAL,
DECIMAL_LEADING_ZERO, LOWER_ROMAN, UPPER_ROMAN, LOWER_GREEK,
LOWER_LATIN, UPPER_LATIN, ARMENIAN, GEORGIAN, LOWER_ALPHA, UPPER_ALPHA,
INVERT, VISIBLE, ALWAYS, AVOID, X_LOW, LOW, HIGH, X_HIGH, LIBCSS_STATIC,
@@ -88,12 +88,12 @@ enum {
UPPERCASE, LOWERCASE, EMBED, BIDI_OVERRIDE, BASELINE, SUB, SUPER,
TEXT_TOP, MIDDLE, TEXT_BOTTOM, SILENT, X_SOFT, SOFT, LOUD, X_LOUD,
PRE, NOWRAP, PRE_WRAP, PRE_LINE, LEFTWARDS, RIGHTWARDS, LEFT_SIDE,
- FAR_LEFT, CENTER_LEFT, CENTER_RIGHT, FAR_RIGHT, RIGHT_SIDE, BEHIND,
- RECT, OPEN_QUOTE, CLOSE_QUOTE, NO_OPEN_QUOTE, NO_CLOSE_QUOTE, ATTR,
- COUNTER, COUNTERS, CROSSHAIR, DEFAULT, POINTER, MOVE, E_RESIZE,
- NE_RESIZE, NW_RESIZE, N_RESIZE, SE_RESIZE, SW_RESIZE, S_RESIZE,
+ FAR_LEFT, CENTER_LEFT, CENTER_RIGHT, FAR_RIGHT, RIGHT_SIDE, BEHIND,
+ RECT, OPEN_QUOTE, CLOSE_QUOTE, NO_OPEN_QUOTE, NO_CLOSE_QUOTE, ATTR,
+ COUNTER, COUNTERS, CROSSHAIR, DEFAULT, POINTER, MOVE, E_RESIZE,
+ NE_RESIZE, NW_RESIZE, N_RESIZE, SE_RESIZE, SW_RESIZE, S_RESIZE,
W_RESIZE, LIBCSS_TEXT, WAIT, HELP, PROGRESS, SERIF, SANS_SERIF, CURSIVE,
- FANTASY, MONOSPACE, MALE, FEMALE, CHILD, MIX, UNDERLINE, OVERLINE,
+ FANTASY, MONOSPACE, MALE, FEMALE, CHILD, MIX, UNDERLINE, OVERLINE,
LINE_THROUGH, BLINK, RGB, RGBA, HSL, HSLA, LIBCSS_LEFT, LIBCSS_CENTER,
LIBCSS_RIGHT, CURRENTCOLOR, ODD, EVEN, SRC, LOCAL, INITIAL,
FORMAT, WOFF, TRUETYPE, OPENTYPE, EMBEDDED_OPENTYPE, SVG, COLUMN,
@@ -111,14 +111,14 @@ enum {
DARKORCHID, DARKRED, DARKSALMON, DARKSEAGREEN, DARKSLATEBLUE,
DARKSLATEGRAY, DARKSLATEGREY, DARKTURQUOISE, DARKVIOLET, DEEPPINK,
DEEPSKYBLUE, DIMGRAY, DIMGREY, DODGERBLUE, FELDSPAR, FIREBRICK,
- FLORALWHITE, FORESTGREEN, FUCHSIA, GAINSBORO, GHOSTWHITE, GOLD,
+ FLORALWHITE, FORESTGREEN, FUCHSIA, GAINSBORO, GHOSTWHITE, GOLD,
GOLDENROD, GRAY, GREEN, GREENYELLOW, GREY, HONEYDEW, HOTPINK,
INDIANRED, INDIGO, IVORY, KHAKI, LAVENDER, LAVENDERBLUSH, LAWNGREEN,
LEMONCHIFFON, LIGHTBLUE, LIGHTCORAL, LIGHTCYAN, LIGHTGOLDENRODYELLOW,
LIGHTGRAY, LIGHTGREEN, LIGHTGREY, LIGHTPINK, LIGHTSALMON, LIGHTSEAGREEN,
- LIGHTSKYBLUE, LIGHTSLATEBLUE, LIGHTSLATEGRAY, LIGHTSLATEGREY,
+ LIGHTSKYBLUE, LIGHTSLATEBLUE, LIGHTSLATEGRAY, LIGHTSLATEGREY,
LIGHTSTEELBLUE, LIGHTYELLOW, LIME, LIMEGREEN, LINEN, MAGENTA, MAROON,
- MEDIUMAQUAMARINE, MEDIUMBLUE, MEDIUMORCHID, MEDIUMPURPLE,
+ MEDIUMAQUAMARINE, MEDIUMBLUE, MEDIUMORCHID, MEDIUMPURPLE,
MEDIUMSEAGREEN, MEDIUMSLATEBLUE, MEDIUMSPRINGGREEN, MEDIUMTURQUOISE,
MEDIUMVIOLETRED, MIDNIGHTBLUE, MINTCREAM, MISTYROSE, MOCCASIN,
NAVAJOWHITE, NAVY, OLDLACE, OLIVE, OLIVEDRAB, ORANGE, ORANGERED,
@@ -126,7 +126,7 @@ enum {
PAPAYAWHIP, PEACHPUFF, PERU, PINK, PLUM, POWDERBLUE, PURPLE, RED,
ROSYBROWN, ROYALBLUE, SADDLEBROWN, SALMON, SANDYBROWN, SEAGREEN,
SEASHELL, SIENNA, SILVER, SKYBLUE, SLATEBLUE, SLATEGRAY, SLATEGREY,
- SNOW, SPRINGGREEN, STEELBLUE, TAN, TEAL, THISTLE, TOMATO, TURQUOISE,
+ SNOW, SPRINGGREEN, STEELBLUE, TAN, TEAL, THISTLE, TOMATO, TURQUOISE,
VIOLET, VIOLETRED, WHEAT, WHITE, WHITESMOKE, YELLOW, YELLOWGREEN,
LAST_COLOUR = YELLOWGREEN,
diff --git a/src/select/computed.c b/src/select/computed.c
index 23f7ea4..03e7c15 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -25,7 +25,7 @@ static css_error compute_absolute_border_width(css_computed_style *style,
const css_hint_length *ex_size);
static css_error compute_absolute_border_side_width(css_computed_style *style,
const css_hint_length *ex_size,
- uint8_t (*get)(const css_computed_style *style,
+ uint8_t (*get)(const css_computed_style *style,
css_fixed *len, css_unit *unit),
css_error (*set)(css_computed_style *style, uint8_t type,
css_fixed len, css_unit unit));
@@ -43,13 +43,13 @@ static css_error compute_absolute_vertical_align(css_computed_style *style,
const css_hint_length *ex_size);
static css_error compute_absolute_length(css_computed_style *style,
const css_hint_length *ex_size,
- uint8_t (*get)(const css_computed_style *style,
+ uint8_t (*get)(const css_computed_style *style,
css_fixed *len, css_unit *unit),
css_error (*set)(css_computed_style *style, uint8_t type,
css_fixed len, css_unit unit));
static css_error compute_absolute_length_pair(css_computed_style *style,
const css_hint_length *ex_size,
- uint8_t (*get)(const css_computed_style *style,
+ uint8_t (*get)(const css_computed_style *style,
css_fixed *len1, css_unit *unit1,
css_fixed *len2, css_unit *unit2),
css_error (*set)(css_computed_style *style, uint8_t type,
@@ -534,7 +534,7 @@ uint8_t css_computed_right(const css_computed_style *style,
*length = -style->i.left;
*unit = (css_unit) (left >> 2);
} else {
- /** \todo Consider containing block's direction
+ /** \todo Consider containing block's direction
* if overconstrained */
}
@@ -598,7 +598,7 @@ uint8_t css_computed_left(const css_computed_style *style,
*length = -style->i.right;
*unit = (css_unit) (right >> 2);
} else {
- /** \todo Consider containing block's direction
+ /** \todo Consider containing block's direction
* if overconstrained */
}
@@ -921,7 +921,7 @@ uint8_t css_computed_display(const css_computed_style *style,
if (display == CSS_DISPLAY_NONE)
return display; /* 1. */
- if ((position == CSS_POSITION_ABSOLUTE ||
+ if ((position == CSS_POSITION_ABSOLUTE ||
position == CSS_POSITION_FIXED) /* 2. */ ||
css_computed_float(style) != CSS_FLOAT_NONE /* 3. */ ||
root /* 4. */) {
@@ -1031,12 +1031,12 @@ uint8_t css_computed_page_break_after(const css_computed_style *style)
{
return get_page_break_after(style);
}
-
+
uint8_t css_computed_page_break_before(const css_computed_style *style)
{
return get_page_break_before(style);
}
-
+
uint8_t css_computed_page_break_inside(const css_computed_style *style)
{
return get_page_break_inside(style);
@@ -1070,7 +1070,7 @@ uint8_t css_computed_widows(const css_computed_style *style,
*/
css_error css__compute_absolute_values(const css_computed_style *parent,
css_computed_style *style,
- css_error (*compute_font_size)(void *pw,
+ css_error (*compute_font_size)(void *pw,
const css_hint *parent, css_hint *size),
void *pw)
{
@@ -1079,13 +1079,13 @@ css_error css__compute_absolute_values(const css_computed_style *parent,
/* Ensure font-size is absolute */
if (parent != NULL) {
- psize.status = get_font_size(parent,
- &psize.data.length.value,
+ psize.status = get_font_size(parent,
+ &psize.data.length.value,
&psize.data.length.unit);
}
- size.status = get_font_size(style,
- &size.data.length.value,
+ size.status = get_font_size(style,
+ &size.data.length.value,
&size.data.length.unit);
error = compute_font_size(pw, parent != NULL ? &psize : NULL, &size);
@@ -1093,7 +1093,7 @@ css_error css__compute_absolute_values(const css_computed_style *parent,
return error;
error = set_font_size(style, size.status,
- size.data.length.value,
+ size.data.length.value,
size.data.length.unit);
if (error != CSS_OK)
return error;
@@ -1108,14 +1108,14 @@ css_error css__compute_absolute_values(const css_computed_style *parent,
/* Convert ex size into ems */
if (size.data.length.value != 0)
- ex_size.data.length.value = FDIV(ex_size.data.length.value,
+ ex_size.data.length.value = FDIV(ex_size.data.length.value,
size.data.length.value);
else
ex_size.data.length.value = 0;
ex_size.data.length.unit = CSS_UNIT_EM;
/* Fix up background-position */
- error = compute_absolute_length_pair(style, &ex_size.data.length,
+ error = compute_absolute_length_pair(style, &ex_size.data.length,
get_background_position,
set_background_position);
if (error != CSS_OK)
@@ -1223,7 +1223,7 @@ css_error css__compute_absolute_values(const css_computed_style *parent,
/* Fix up letter-spacing */
error = compute_absolute_length(style,
&ex_size.data.length,
- get_letter_spacing,
+ get_letter_spacing,
set_letter_spacing);
if (error != CSS_OK)
return error;
@@ -1236,9 +1236,9 @@ css_error css__compute_absolute_values(const css_computed_style *parent,
return error;
/* Fix up outline-width */
- error = compute_absolute_border_side_width(style,
- &ex_size.data.length,
- get_outline_width,
+ error = compute_absolute_border_side_width(style,
+ &ex_size.data.length,
+ get_outline_width,
set_outline_width);
if (error != CSS_OK)
return error;
@@ -1246,7 +1246,7 @@ css_error css__compute_absolute_values(const css_computed_style *parent,
/* Fix up word-spacing */
error = compute_absolute_length(style,
&ex_size.data.length,
- get_word_spacing,
+ get_word_spacing,
set_word_spacing);
if (error != CSS_OK)
return error;
@@ -1313,7 +1313,7 @@ css_error compute_absolute_color(css_computed_style *style,
}
/**
- * Compute border colours, replacing any set to currentColor with
+ * Compute border colours, replacing any set to currentColor with
* the computed value of color.
*
* \param style The style to process
@@ -1327,28 +1327,28 @@ css_error compute_border_colors(css_computed_style *style)
css_computed_color(style, &color);
if (get_border_top_color(style, &bcol) == CSS_BORDER_COLOR_CURRENT_COLOR) {
- error = set_border_top_color(style,
+ error = set_border_top_color(style,
CSS_BORDER_COLOR_COLOR, color);
if (error != CSS_OK)
return error;
}
if (get_border_right_color(style, &bcol) == CSS_BORDER_COLOR_CURRENT_COLOR) {
- error = set_border_right_color(style,
+ error = set_border_right_color(style,
CSS_BORDER_COLOR_COLOR, color);
if (error != CSS_OK)
return error;
}
if (get_border_bottom_color(style, &bcol) == CSS_BORDER_COLOR_CURRENT_COLOR) {
- error = set_border_bottom_color(style,
+ error = set_border_bottom_color(style,
CSS_BORDER_COLOR_COLOR, color);
if (error != CSS_OK)
return error;
}
if (get_border_left_color(style, &bcol) == CSS_BORDER_COLOR_CURRENT_COLOR) {
- error = set_border_left_color(style,
+ error = set_border_left_color(style,
CSS_BORDER_COLOR_COLOR, color);
if (error != CSS_OK)
return error;
@@ -1370,25 +1370,25 @@ css_error compute_absolute_border_width(css_computed_style *style,
css_error error;
error = compute_absolute_border_side_width(style, ex_size,
- get_border_top_width,
+ get_border_top_width,
set_border_top_width);
if (error != CSS_OK)
return error;
error = compute_absolute_border_side_width(style, ex_size,
- get_border_right_width,
+ get_border_right_width,
set_border_right_width);
if (error != CSS_OK)
return error;
error = compute_absolute_border_side_width(style, ex_size,
- get_border_bottom_width,
+ get_border_bottom_width,
set_border_bottom_width);
if (error != CSS_OK)
return error;
error = compute_absolute_border_side_width(style, ex_size,
- get_border_left_width,
+ get_border_left_width,
set_border_left_width);
if (error != CSS_OK)
return error;
@@ -1407,7 +1407,7 @@ css_error compute_absolute_border_width(css_computed_style *style,
*/
css_error compute_absolute_border_side_width(css_computed_style *style,
const css_hint_length *ex_size,
- uint8_t (*get)(const css_computed_style *style,
+ uint8_t (*get)(const css_computed_style *style,
css_fixed *len, css_unit *unit),
css_error (*set)(css_computed_style *style, uint8_t type,
css_fixed len, css_unit unit))
@@ -1588,7 +1588,7 @@ css_error compute_absolute_margins(css_computed_style *style,
get_margin_left, set_margin_left);
if (error != CSS_OK)
return error;
-
+
return CSS_OK;
}
@@ -1623,7 +1623,7 @@ css_error compute_absolute_padding(css_computed_style *style,
get_padding_left, set_padding_left);
if (error != CSS_OK)
return error;
-
+
return CSS_OK;
}
@@ -1669,7 +1669,7 @@ css_error compute_absolute_vertical_align(css_computed_style *style,
*/
css_error compute_absolute_length(css_computed_style *style,
const css_hint_length *ex_size,
- uint8_t (*get)(const css_computed_style *style,
+ uint8_t (*get)(const css_computed_style *style,
css_fixed *len, css_unit *unit),
css_error (*set)(css_computed_style *style, uint8_t type,
css_fixed len, css_unit unit))
@@ -1702,7 +1702,7 @@ css_error compute_absolute_length(css_computed_style *style,
*/
css_error compute_absolute_length_pair(css_computed_style *style,
const css_hint_length *ex_size,
- uint8_t (*get)(const css_computed_style *style,
+ uint8_t (*get)(const css_computed_style *style,
css_fixed *len1, css_unit *unit1,
css_fixed *len2, css_unit *unit2),
css_error (*set)(css_computed_style *style, uint8_t type,
diff --git a/src/select/computed.h b/src/select/computed.h
index d2301f5..9f2abdd 100644
--- a/src/select/computed.h
+++ b/src/select/computed.h
@@ -124,11 +124,11 @@ typedef struct css_computed_page {
* 2 ......wo widows | orphans
*/
uint8_t bits[2];
-
+
int32_t widows;
int32_t orphans;
} css_computed_page;
-
+
struct css_computed_style_i {
/*
* background_attachment 2
@@ -205,7 +205,7 @@ struct css_computed_style_i {
* --- ---
* 181 bits 140 + 2sizeof(ptr) bytes
*
- * Encode font family as an array of string objects, terminated with a
+ * Encode font family as an array of string objects, terminated with a
* blank entry.
*
* font_family 3 sizeof(ptr)
@@ -357,7 +357,7 @@ css_error css__computed_uncommon_destroy(css_computed_uncommon *uncommon);
css_error css__compute_absolute_values(const css_computed_style *parent,
css_computed_style *style,
- css_error (*compute_font_size)(void *pw,
+ css_error (*compute_font_size)(void *pw,
const css_hint *parent, css_hint *size),
void *pw);
diff --git a/src/select/dispatch.h b/src/select/dispatch.h
index 2fcb739..c1db7d9 100644
--- a/src/select/dispatch.h
+++ b/src/select/dispatch.h
@@ -28,9 +28,9 @@ enum prop_group {
};
extern struct prop_table {
- css_error (*cascade)(uint32_t opv, css_style *style,
+ css_error (*cascade)(uint32_t opv, css_style *style,
css_select_state *state);
- css_error (*set_from_hint)(const css_hint *hint,
+ css_error (*set_from_hint)(const css_hint *hint,
css_computed_style *style);
css_error (*initial)(css_select_state *state);
css_error (*compose)(const css_computed_style *parent,
diff --git a/src/select/font_face.c b/src/select/font_face.c
index ea790eb..07e4ef9 100644
--- a/src/select/font_face.c
+++ b/src/select/font_face.c
@@ -20,7 +20,7 @@ static void font_faces_srcs_destroy(css_font_face *font_face)
lwc_string_unref(srcs[i].location);
}
}
-
+
free(srcs);
font_face->srcs = NULL;
}
@@ -43,18 +43,18 @@ static const css_font_face default_font_face = {
css_error css__font_face_create(css_font_face **result)
{
css_font_face *f;
-
+
if (result == NULL)
return CSS_BADPARM;
-
+
f = malloc(sizeof(css_font_face));
if (f == NULL)
return CSS_NOMEM;
-
+
memcpy(f, &default_font_face, sizeof(css_font_face));
-
+
*result = f;
-
+
return CSS_OK;
}
@@ -65,18 +65,18 @@ css_error css__font_face_create(css_font_face **result)
* \return CSS_OK on success, appropriate error otherwise
*/
css_error css__font_face_destroy(css_font_face *font_face)
-{
+{
if (font_face == NULL)
return CSS_BADPARM;
if (font_face->font_family != NULL)
lwc_string_unref(font_face->font_family);
-
+
if (font_face->srcs != NULL)
font_faces_srcs_destroy(font_face);
free(font_face);
-
+
return CSS_OK;
}
@@ -95,10 +95,10 @@ css_error css__font_face_set_font_family(css_font_face *font_face,
{
if (font_face == NULL || font_family == NULL)
return CSS_BADPARM;
-
+
if (font_face->font_family != NULL)
lwc_string_unref(font_face->font_family);
-
+
font_face->font_family = lwc_string_ref(font_family);
return CSS_OK;
@@ -117,9 +117,9 @@ css_error css_font_face_get_font_family(const css_font_face *font_face,
{
if (font_face == NULL || font_family == NULL)
return CSS_BADPARM;
-
+
*font_family = font_face->font_family;
-
+
return CSS_OK;
}
@@ -153,7 +153,7 @@ uint8_t css_font_face_font_weight(const css_font_face *font_face)
* \return CSS_OK on success,
* CSS_BADPARM on bad parameters.
*/
-css_error css_font_face_count_srcs(const css_font_face *font_face,
+css_error css_font_face_count_srcs(const css_font_face *font_face,
uint32_t *count)
{
if (font_face == NULL || count == NULL)
@@ -179,7 +179,7 @@ css_error css_font_face_get_src(const css_font_face *font_face,
return CSS_BADPARM;
*src = &(font_face->srcs[index]);
-
+
return CSS_OK;
}
@@ -191,19 +191,19 @@ css_error css_font_face_get_src(const css_font_face *font_face,
* \return CSS_OK on success,
* CSS_BADPARM on bad parameters.
*
- * \note The type of location (local or URL) can be gathered from
+ * \note The type of location (local or URL) can be gathered from
* css_font_face_src_location_type, and the format of font (if specified)
* from css_font_face_src_format.
*/
css_error css_font_face_src_get_location(const css_font_face_src *src,
lwc_string **location)
{
- if (src == NULL || location == NULL)
+ if (src == NULL || location == NULL)
return CSS_BADPARM;
-
+
*location = src->location;
- return CSS_OK;
+ return CSS_OK;
}
/**
@@ -232,9 +232,9 @@ css_font_face_format css_font_face_src_format(const css_font_face_src *src)
/**
* Set a font-faces array of srcs.
*
- * \param font_face The font-face
+ * \param font_face The font-face
* \param srcs The array of css_font_face_srcs
- * \param n_srcs The count of css_font_face_srcs in the array
+ * \param n_srcs The count of css_font_face_srcs in the array
* \return The format, if specified
*/
css_error css__font_face_set_srcs(css_font_face *font_face,
@@ -242,10 +242,10 @@ css_error css__font_face_set_srcs(css_font_face *font_face,
{
if (font_face->srcs != NULL)
font_faces_srcs_destroy(font_face);
-
+
font_face->srcs = srcs;
font_face->n_srcs = n_srcs;
-
+
return CSS_OK;
}
diff --git a/src/select/font_face.h b/src/select/font_face.h
index 4e6d094..5f46433 100644
--- a/src/select/font_face.h
+++ b/src/select/font_face.h
@@ -27,7 +27,7 @@ struct css_font_face {
lwc_string *font_family;
css_font_face_src *srcs;
uint32_t n_srcs;
-
+
/*
* Bit allocations:
*
diff --git a/src/select/hash.c b/src/select/hash.c
index 4807e0f..dce4065 100644
--- a/src/select/hash.c
+++ b/src/select/hash.c
@@ -43,7 +43,7 @@ static hash_entry empty_slot;
static inline lwc_string *_class_name(const css_selector *selector);
static inline lwc_string *_id_name(const css_selector *selector);
-static css_error _insert_into_chain(css_selector_hash *ctx, hash_entry *head,
+static css_error _insert_into_chain(css_selector_hash *ctx, hash_entry *head,
const css_selector *selector);
static css_error _remove_from_chain(css_selector_hash *ctx, hash_entry *head,
const css_selector *selector);
@@ -183,7 +183,7 @@ css_error css__selector_hash_create(css_selector_hash **hash)
/* Universal chain head already initiliased by calloc of `h`. */
- h->hash_size = sizeof(css_selector_hash) +
+ h->hash_size = sizeof(css_selector_hash) +
DEFAULT_SLOTS * sizeof(hash_entry) +
DEFAULT_SLOTS * sizeof(hash_entry) +
DEFAULT_SLOTS * sizeof(hash_entry);
@@ -810,7 +810,7 @@ static void print_chain_bloom_details(css_bloom bloom[CSS_BLOOM_SIZE])
* \return CSS_OK on success,
* CSS_NOMEM on memory exhaustion.
*/
-css_error _insert_into_chain(css_selector_hash *ctx, hash_entry *head,
+css_error _insert_into_chain(css_selector_hash *ctx, hash_entry *head,
const css_selector *selector)
{
if (head->sel == NULL) {
@@ -836,7 +836,7 @@ css_error _insert_into_chain(css_selector_hash *ctx, hash_entry *head,
/* Sort by ascending rule index */
if (search->sel->specificity == selector->specificity &&
- search->sel->rule->index >
+ search->sel->rule->index >
selector->rule->index)
break;
diff --git a/src/select/properties/azimuth.c b/src/select/properties/azimuth.c
index 275ae2f..d52110f 100644
--- a/src/select/properties/azimuth.c
+++ b/src/select/properties/azimuth.c
@@ -46,7 +46,7 @@ css_error css__cascade_azimuth(uint32_t opv, css_style *style,
unit = css__to_css_unit(unit);
- if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
+ if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
isInherit(opv))) {
/** \todo set computed azimuth */
}
@@ -54,7 +54,7 @@ css_error css__cascade_azimuth(uint32_t opv, css_style *style,
return CSS_OK;
}
-css_error css__set_azimuth_from_hint(const css_hint *hint,
+css_error css__set_azimuth_from_hint(const css_hint *hint,
css_computed_style *style)
{
UNUSED(hint);
diff --git a/src/select/properties/background_attachment.c b/src/select/properties/background_attachment.c
index 89fd181..834c830 100644
--- a/src/select/properties/background_attachment.c
+++ b/src/select/properties/background_attachment.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_background_attachment(uint32_t opv, css_style *style,
+css_error css__cascade_background_attachment(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_BACKGROUND_ATTACHMENT_INHERIT;
@@ -40,7 +40,7 @@ css_error css__cascade_background_attachment(uint32_t opv, css_style *style,
return CSS_OK;
}
-css_error css__set_background_attachment_from_hint(const css_hint *hint,
+css_error css__set_background_attachment_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_background_attachment(style, hint->status);
@@ -48,7 +48,7 @@ css_error css__set_background_attachment_from_hint(const css_hint *hint,
css_error css__initial_background_attachment(css_select_state *state)
{
- return set_background_attachment(state->computed,
+ return set_background_attachment(state->computed,
CSS_BACKGROUND_ATTACHMENT_SCROLL);
}
diff --git a/src/select/properties/background_color.c b/src/select/properties/background_color.c
index 07ba82e..bb90604 100644
--- a/src/select/properties/background_color.c
+++ b/src/select/properties/background_color.c
@@ -14,13 +14,13 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_background_color(uint32_t opv, css_style *style,
+css_error css__cascade_background_color(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_bg_border_color(opv, style, state, set_background_color);
}
-css_error css__set_background_color_from_hint(const css_hint *hint,
+css_error css__set_background_color_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_background_color(style, hint->status, hint->data.color);
@@ -28,7 +28,7 @@ css_error css__set_background_color_from_hint(const css_hint *hint,
css_error css__initial_background_color(css_select_state *state)
{
- return set_background_color(state->computed,
+ return set_background_color(state->computed,
CSS_BACKGROUND_COLOR_COLOR, 0);
}
diff --git a/src/select/properties/background_image.c b/src/select/properties/background_image.c
index e371a15..96f7409 100644
--- a/src/select/properties/background_image.c
+++ b/src/select/properties/background_image.c
@@ -14,13 +14,13 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_background_image(uint32_t opv, css_style *style,
+css_error css__cascade_background_image(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_uri_none(opv, style, state, set_background_image);
}
-css_error css__set_background_image_from_hint(const css_hint *hint,
+css_error css__set_background_image_from_hint(const css_hint *hint,
css_computed_style *style)
{
css_error error;
@@ -35,7 +35,7 @@ css_error css__set_background_image_from_hint(const css_hint *hint,
css_error css__initial_background_image(css_select_state *state)
{
- return set_background_image(state->computed,
+ return set_background_image(state->computed,
CSS_BACKGROUND_IMAGE_NONE, NULL);
}
diff --git a/src/select/properties/background_position.c b/src/select/properties/background_position.c
index e7b5d6f..d925b9c 100644
--- a/src/select/properties/background_position.c
+++ b/src/select/properties/background_position.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_background_position(uint32_t opv, css_style *style,
+css_error css__cascade_background_position(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_BACKGROUND_POSITION_INHERIT;
@@ -81,18 +81,18 @@ css_error css__cascade_background_position(uint32_t opv, css_style *style,
return CSS_OK;
}
-css_error css__set_background_position_from_hint(const css_hint *hint,
+css_error css__set_background_position_from_hint(const css_hint *hint,
css_computed_style *style)
{
- return set_background_position(style, hint->status,
+ return set_background_position(style, hint->status,
hint->data.position.h.value, hint->data.position.h.unit,
hint->data.position.v.value, hint->data.position.v.unit);
}
css_error css__initial_background_position(css_select_state *state)
{
- return set_background_position(state->computed,
- CSS_BACKGROUND_POSITION_SET,
+ return set_background_position(state->computed,
+ CSS_BACKGROUND_POSITION_SET,
0, CSS_UNIT_PCT, 0, CSS_UNIT_PCT);
}
@@ -102,7 +102,7 @@ css_error css__compose_background_position(const css_computed_style *parent,
{
css_fixed hlength = 0, vlength = 0;
css_unit hunit = CSS_UNIT_PX, vunit = CSS_UNIT_PX;
- uint8_t type = get_background_position(child, &hlength, &hunit,
+ uint8_t type = get_background_position(child, &hlength, &hunit,
&vlength, &vunit);
if (type == CSS_BACKGROUND_POSITION_INHERIT) {
diff --git a/src/select/properties/background_repeat.c b/src/select/properties/background_repeat.c
index e31275f..3881573 100644
--- a/src/select/properties/background_repeat.c
+++ b/src/select/properties/background_repeat.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_background_repeat(uint32_t opv, css_style *style,
+css_error css__cascade_background_repeat(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_BACKGROUND_REPEAT_INHERIT;
@@ -46,7 +46,7 @@ css_error css__cascade_background_repeat(uint32_t opv, css_style *style,
return CSS_OK;
}
-css_error css__set_background_repeat_from_hint(const css_hint *hint,
+css_error css__set_background_repeat_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_background_repeat(style, hint->status);
@@ -54,7 +54,7 @@ css_error css__set_background_repeat_from_hint(const css_hint *hint,
css_error css__initial_background_repeat(css_select_state *state)
{
- return set_background_repeat(state->computed,
+ return set_background_repeat(state->computed,
CSS_BACKGROUND_REPEAT_REPEAT);
}
diff --git a/src/select/properties/border_bottom_color.c b/src/select/properties/border_bottom_color.c
index 2e63982..bdbecb7 100644
--- a/src/select/properties/border_bottom_color.c
+++ b/src/select/properties/border_bottom_color.c
@@ -14,14 +14,14 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_border_bottom_color(uint32_t opv, css_style *style,
+css_error css__cascade_border_bottom_color(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_bg_border_color(opv, style, state,
set_border_bottom_color);
}
-css_error css__set_border_bottom_color_from_hint(const css_hint *hint,
+css_error css__set_border_bottom_color_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_border_bottom_color(style, hint->status, hint->data.color);
@@ -29,7 +29,7 @@ css_error css__set_border_bottom_color_from_hint(const css_hint *hint,
css_error css__initial_border_bottom_color(css_select_state *state)
{
- return set_border_bottom_color(state->computed,
+ return set_border_bottom_color(state->computed,
CSS_BORDER_COLOR_CURRENT_COLOR, 0);
}
diff --git a/src/select/properties/border_bottom_style.c b/src/select/properties/border_bottom_style.c
index 2a6cd6a..b5caccb 100644
--- a/src/select/properties/border_bottom_style.c
+++ b/src/select/properties/border_bottom_style.c
@@ -14,13 +14,13 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_border_bottom_style(uint32_t opv, css_style *style,
+css_error css__cascade_border_bottom_style(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_border_style(opv, style, state, set_border_bottom_style);
}
-css_error css__set_border_bottom_style_from_hint(const css_hint *hint,
+css_error css__set_border_bottom_style_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_border_bottom_style(style, hint->status);
diff --git a/src/select/properties/border_bottom_width.c b/src/select/properties/border_bottom_width.c
index fdf0824..b071fba 100644
--- a/src/select/properties/border_bottom_width.c
+++ b/src/select/properties/border_bottom_width.c
@@ -14,13 +14,13 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_border_bottom_width(uint32_t opv, css_style *style,
+css_error css__cascade_border_bottom_width(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_border_width(opv, style, state, set_border_bottom_width);
}
-css_error css__set_border_bottom_width_from_hint(const css_hint *hint,
+css_error css__set_border_bottom_width_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_border_bottom_width(style, hint->status,
diff --git a/src/select/properties/border_collapse.c b/src/select/properties/border_collapse.c
index 5da1a00..1363c7c 100644
--- a/src/select/properties/border_collapse.c
+++ b/src/select/properties/border_collapse.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_border_collapse(uint32_t opv, css_style *style,
+css_error css__cascade_border_collapse(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_BORDER_COLLAPSE_INHERIT;
@@ -40,7 +40,7 @@ css_error css__cascade_border_collapse(uint32_t opv, css_style *style,
return CSS_OK;
}
-css_error css__set_border_collapse_from_hint(const css_hint *hint,
+css_error css__set_border_collapse_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_border_collapse(style, hint->status);
@@ -60,7 +60,7 @@ css_error css__compose_border_collapse(const css_computed_style *parent,
if (type == CSS_BORDER_COLLAPSE_INHERIT) {
type = get_border_collapse(parent);
}
-
+
return set_border_collapse(result, type);
}
diff --git a/src/select/properties/border_left_color.c b/src/select/properties/border_left_color.c
index cf08257..2880751 100644
--- a/src/select/properties/border_left_color.c
+++ b/src/select/properties/border_left_color.c
@@ -14,14 +14,14 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_border_left_color(uint32_t opv, css_style *style,
+css_error css__cascade_border_left_color(uint32_t opv, css_style *style,
css_select_state *state)
{
- return css__cascade_bg_border_color(opv, style, state,
+ return css__cascade_bg_border_color(opv, style, state,
set_border_left_color);
}
-css_error css__set_border_left_color_from_hint(const css_hint *hint,
+css_error css__set_border_left_color_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_border_left_color(style, hint->status, hint->data.color);
@@ -29,7 +29,7 @@ css_error css__set_border_left_color_from_hint(const css_hint *hint,
css_error css__initial_border_left_color(css_select_state *state)
{
- return set_border_left_color(state->computed,
+ return set_border_left_color(state->computed,
CSS_BORDER_COLOR_CURRENT_COLOR, 0);
}
diff --git a/src/select/properties/border_left_style.c b/src/select/properties/border_left_style.c
index 89708f7..e6472b3 100644
--- a/src/select/properties/border_left_style.c
+++ b/src/select/properties/border_left_style.c
@@ -14,13 +14,13 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_border_left_style(uint32_t opv, css_style *style,
+css_error css__cascade_border_left_style(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_border_style(opv, style, state, set_border_left_style);
}
-css_error css__set_border_left_style_from_hint(const css_hint *hint,
+css_error css__set_border_left_style_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_border_left_style(style, hint->status);
diff --git a/src/select/properties/border_left_width.c b/src/select/properties/border_left_width.c
index a4633da..1278fa9 100644
--- a/src/select/properties/border_left_width.c
+++ b/src/select/properties/border_left_width.c
@@ -14,13 +14,13 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_border_left_width(uint32_t opv, css_style *style,
+css_error css__cascade_border_left_width(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_border_width(opv, style, state, set_border_left_width);
}
-css_error css__set_border_left_width_from_hint(const css_hint *hint,
+css_error css__set_border_left_width_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_border_left_width(style, hint->status,
diff --git a/src/select/properties/border_right_color.c b/src/select/properties/border_right_color.c
index 1829784..b8563e6 100644
--- a/src/select/properties/border_right_color.c
+++ b/src/select/properties/border_right_color.c
@@ -14,14 +14,14 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_border_right_color(uint32_t opv, css_style *style,
+css_error css__cascade_border_right_color(uint32_t opv, css_style *style,
css_select_state *state)
{
- return css__cascade_bg_border_color(opv, style, state,
+ return css__cascade_bg_border_color(opv, style, state,
set_border_right_color);
}
-css_error css__set_border_right_color_from_hint(const css_hint *hint,
+css_error css__set_border_right_color_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_border_right_color(style, hint->status, hint->data.color);
@@ -29,7 +29,7 @@ css_error css__set_border_right_color_from_hint(const css_hint *hint,
css_error css__initial_border_right_color(css_select_state *state)
{
- return set_border_right_color(state->computed,
+ return set_border_right_color(state->computed,
CSS_BORDER_COLOR_CURRENT_COLOR, 0);
}
diff --git a/src/select/properties/border_right_style.c b/src/select/properties/border_right_style.c
index 3f5934b..d75a99e 100644
--- a/src/select/properties/border_right_style.c
+++ b/src/select/properties/border_right_style.c
@@ -14,13 +14,13 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_border_right_style(uint32_t opv, css_style *style,
+css_error css__cascade_border_right_style(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_border_style(opv, style, state, set_border_right_style);
}
-css_error css__set_border_right_style_from_hint(const css_hint *hint,
+css_error css__set_border_right_style_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_border_right_style(style, hint->status);
diff --git a/src/select/properties/border_right_width.c b/src/select/properties/border_right_width.c
index 269fefe..18cacd2 100644
--- a/src/select/properties/border_right_width.c
+++ b/src/select/properties/border_right_width.c
@@ -14,13 +14,13 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_border_right_width(uint32_t opv, css_style *style,
+css_error css__cascade_border_right_width(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_border_width(opv, style, state, set_border_right_width);
}
-css_error css__set_border_right_width_from_hint(const css_hint *hint,
+css_error css__set_border_right_width_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_border_right_width(style, hint->status,
diff --git a/src/select/properties/border_spacing.c b/src/select/properties/border_spacing.c
index db7b1f2..147f56f 100644
--- a/src/select/properties/border_spacing.c
+++ b/src/select/properties/border_spacing.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_border_spacing(uint32_t opv, css_style *style,
+css_error css__cascade_border_spacing(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_BORDER_SPACING_INHERIT;
@@ -48,7 +48,7 @@ css_error css__cascade_border_spacing(uint32_t opv, css_style *style,
return CSS_OK;
}
-css_error css__set_border_spacing_from_hint(const css_hint *hint,
+css_error css__set_border_spacing_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_border_spacing(style, hint->status,
@@ -68,7 +68,7 @@ css_error css__compose_border_spacing(const css_computed_style *parent,
{
css_fixed hlength = 0, vlength = 0;
css_unit hunit = CSS_UNIT_PX, vunit = CSS_UNIT_PX;
- uint8_t type = get_border_spacing(child, &hlength, &hunit,
+ uint8_t type = get_border_spacing(child, &hlength, &hunit,
&vlength, &vunit);
if ((child->i.uncommon == NULL && parent->i.uncommon != NULL) ||
@@ -76,11 +76,11 @@ css_error css__compose_border_spacing(const css_computed_style *parent,
(child->i.uncommon != NULL && result != child)) {
if ((child->i.uncommon == NULL && parent->i.uncommon != NULL) ||
type == CSS_BORDER_SPACING_INHERIT) {
- type = get_border_spacing(parent,
+ type = get_border_spacing(parent,
&hlength, &hunit, &vlength, &vunit);
}
- return set_border_spacing(result, type, hlength, hunit,
+ return set_border_spacing(result, type, hlength, hunit,
vlength, vunit);
}
diff --git a/src/select/properties/border_top_color.c b/src/select/properties/border_top_color.c
index 1517eea..fd2ced4 100644
--- a/src/select/properties/border_top_color.c
+++ b/src/select/properties/border_top_color.c
@@ -14,13 +14,13 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_border_top_color(uint32_t opv, css_style *style,
+css_error css__cascade_border_top_color(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_bg_border_color(opv, style, state, set_border_top_color);
}
-css_error css__set_border_top_color_from_hint(const css_hint *hint,
+css_error css__set_border_top_color_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_border_top_color(style, hint->status, hint->data.color);
diff --git a/src/select/properties/border_top_style.c b/src/select/properties/border_top_style.c
index 9841202..48d6b6d 100644
--- a/src/select/properties/border_top_style.c
+++ b/src/select/properties/border_top_style.c
@@ -14,13 +14,13 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_border_top_style(uint32_t opv, css_style *style,
+css_error css__cascade_border_top_style(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_border_style(opv, style, state, set_border_top_style);
}
-css_error css__set_border_top_style_from_hint(const css_hint *hint,
+css_error css__set_border_top_style_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_border_top_style(style, hint->status);
diff --git a/src/select/properties/border_top_width.c b/src/select/properties/border_top_width.c
index 237d594..c0fb7da 100644
--- a/src/select/properties/border_top_width.c
+++ b/src/select/properties/border_top_width.c
@@ -14,22 +14,22 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_border_top_width(uint32_t opv, css_style *style,
+css_error css__cascade_border_top_width(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_border_width(opv, style, state, set_border_top_width);
}
-css_error css__set_border_top_width_from_hint(const css_hint *hint,
+css_error css__set_border_top_width_from_hint(const css_hint *hint,
css_computed_style *style)
{
- return set_border_top_width(style, hint->status,
+ return set_border_top_width(style, hint->status,
hint->data.length.value, hint->data.length.unit);
}
css_error css__initial_border_top_width(css_select_state *state)
{
- return set_border_top_width(state->computed, CSS_BORDER_WIDTH_MEDIUM,
+ return set_border_top_width(state->computed, CSS_BORDER_WIDTH_MEDIUM,
0, CSS_UNIT_PX);
}
diff --git a/src/select/properties/bottom.c b/src/select/properties/bottom.c
index 7c9b509..82754f1 100644
--- a/src/select/properties/bottom.c
+++ b/src/select/properties/bottom.c
@@ -14,16 +14,16 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_bottom(uint32_t opv, css_style *style,
+css_error css__cascade_bottom(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length_auto(opv, style, state, set_bottom);
}
-css_error css__set_bottom_from_hint(const css_hint *hint,
+css_error css__set_bottom_from_hint(const css_hint *hint,
css_computed_style *style)
{
- return set_bottom(style, hint->status,
+ return set_bottom(style, hint->status,
hint->data.length.value, hint->data.length.unit);
}
diff --git a/src/select/properties/box_sizing.c b/src/select/properties/box_sizing.c
index 91c475d..2d19c95 100644
--- a/src/select/properties/box_sizing.c
+++ b/src/select/properties/box_sizing.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_box_sizing(uint32_t opv, css_style *style,
+css_error css__cascade_box_sizing(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_BOX_SIZING_INHERIT;
diff --git a/src/select/properties/break_after.c b/src/select/properties/break_after.c
index 496a59b..1f253aa 100644
--- a/src/select/properties/break_after.c
+++ b/src/select/properties/break_after.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_break_after(uint32_t opv, css_style *style,
+css_error css__cascade_break_after(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_break_after_before_inside(opv, style, state,
diff --git a/src/select/properties/break_before.c b/src/select/properties/break_before.c
index b8a8d77..3dcda76 100644
--- a/src/select/properties/break_before.c
+++ b/src/select/properties/break_before.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_break_before(uint32_t opv, css_style *style,
+css_error css__cascade_break_before(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_break_after_before_inside(opv, style, state,
diff --git a/src/select/properties/break_inside.c b/src/select/properties/break_inside.c
index 4252fb8..fdc44c1 100644
--- a/src/select/properties/break_inside.c
+++ b/src/select/properties/break_inside.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_break_inside(uint32_t opv, css_style *style,
+css_error css__cascade_break_inside(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_BREAK_INSIDE_AUTO;
diff --git a/src/select/properties/caption_side.c b/src/select/properties/caption_side.c
index c097348..ecccc1d 100644
--- a/src/select/properties/caption_side.c
+++ b/src/select/properties/caption_side.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_caption_side(uint32_t opv, css_style *style,
+css_error css__cascade_caption_side(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_CAPTION_SIDE_INHERIT;
@@ -40,7 +40,7 @@ css_error css__cascade_caption_side(uint32_t opv, css_style *style,
return CSS_OK;
}
-css_error css__set_caption_side_from_hint(const css_hint *hint,
+css_error css__set_caption_side_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_caption_side(style, hint->status);
@@ -60,7 +60,7 @@ css_error css__compose_caption_side(const css_computed_style *parent,
if (type == CSS_CAPTION_SIDE_INHERIT) {
type = get_caption_side(parent);
}
-
+
return set_caption_side(result, type);
}
diff --git a/src/select/properties/clear.c b/src/select/properties/clear.c
index 55ca087..bbb2673 100644
--- a/src/select/properties/clear.c
+++ b/src/select/properties/clear.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_clear(uint32_t opv, css_style *style,
+css_error css__cascade_clear(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_CLEAR_INHERIT;
@@ -46,7 +46,7 @@ css_error css__cascade_clear(uint32_t opv, css_style *style,
return CSS_OK;
}
-css_error css__set_clear_from_hint(const css_hint *hint,
+css_error css__set_clear_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_clear(style, hint->status);
diff --git a/src/select/properties/clip.c b/src/select/properties/clip.c
index cc39d99..fe1dd87 100644
--- a/src/select/properties/clip.c
+++ b/src/select/properties/clip.c
@@ -14,11 +14,11 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_clip(uint32_t opv, css_style *style,
+css_error css__cascade_clip(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_CLIP_INHERIT;
- css_computed_clip_rect rect = { 0, 0, 0, 0,
+ css_computed_clip_rect rect = { 0, 0, 0, 0,
CSS_UNIT_PX, CSS_UNIT_PX, CSS_UNIT_PX, CSS_UNIT_PX,
false, false, false, false };
@@ -78,7 +78,7 @@ css_error css__cascade_clip(uint32_t opv, css_style *style,
return CSS_OK;
}
-css_error css__set_clip_from_hint(const css_hint *hint,
+css_error css__set_clip_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_clip(style, hint->status, hint->data.clip);
@@ -86,7 +86,7 @@ css_error css__set_clip_from_hint(const css_hint *hint,
css_error css__initial_clip(css_select_state *state)
{
- css_computed_clip_rect rect = { 0, 0, 0, 0,
+ css_computed_clip_rect rect = { 0, 0, 0, 0,
CSS_UNIT_PX, CSS_UNIT_PX, CSS_UNIT_PX, CSS_UNIT_PX,
false, false, false, false };
@@ -97,7 +97,7 @@ css_error css__compose_clip(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
- css_computed_clip_rect rect = { 0, 0, 0, 0,
+ css_computed_clip_rect rect = { 0, 0, 0, 0,
CSS_UNIT_PX, CSS_UNIT_PX, CSS_UNIT_PX, CSS_UNIT_PX,
false, false, false, false };
uint8_t type = get_clip(child, &rect);
diff --git a/src/select/properties/color.c b/src/select/properties/color.c
index dad2b9d..806f2cc 100644
--- a/src/select/properties/color.c
+++ b/src/select/properties/color.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_color(uint32_t opv, css_style *style,
+css_error css__cascade_color(uint32_t opv, css_style *style,
css_select_state *state)
{
bool inherit = isInherit(opv);
@@ -39,7 +39,7 @@ css_error css__cascade_color(uint32_t opv, css_style *style,
}
}
- if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
+ if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
inherit)) {
return set_color(state->computed, value, color);
}
@@ -47,7 +47,7 @@ css_error css__cascade_color(uint32_t opv, css_style *style,
return CSS_OK;
}
-css_error css__set_color_from_hint(const css_hint *hint,
+css_error css__set_color_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_color(style, hint->status, hint->data.color);
@@ -58,7 +58,7 @@ css_error css__initial_color(css_select_state *state)
css_hint hint;
css_error error;
- error = state->handler->ua_default_for_property(state->pw,
+ error = state->handler->ua_default_for_property(state->pw,
CSS_PROP_COLOR, &hint);
if (error != CSS_OK)
return error;
diff --git a/src/select/properties/column_count.c b/src/select/properties/column_count.c
index 4ded377..7e929b0 100644
--- a/src/select/properties/column_count.c
+++ b/src/select/properties/column_count.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_column_count(uint32_t opv, css_style *style,
+css_error css__cascade_column_count(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_COLUMN_COUNT_INHERIT;
@@ -22,7 +22,7 @@ css_error css__cascade_column_count(uint32_t opv, css_style *style,
if (isInherit(opv) == false) {
switch (getValue(opv)) {
- case COLUMN_COUNT_SET:
+ case COLUMN_COUNT_SET:
value = CSS_COLUMN_COUNT_SET;
count = *((css_fixed *) style->bytecode);
advance_bytecode(style, sizeof(count));
diff --git a/src/select/properties/column_fill.c b/src/select/properties/column_fill.c
index 9b4f1e0..31f19f0 100644
--- a/src/select/properties/column_fill.c
+++ b/src/select/properties/column_fill.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_column_fill(uint32_t opv, css_style *style,
+css_error css__cascade_column_fill(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_COLUMN_FILL_INHERIT;
diff --git a/src/select/properties/column_gap.c b/src/select/properties/column_gap.c
index f544f44..824b3a4 100644
--- a/src/select/properties/column_gap.c
+++ b/src/select/properties/column_gap.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_column_gap(uint32_t opv, css_style *style,
+css_error css__cascade_column_gap(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length_normal(opv, style, state, set_column_gap);
diff --git a/src/select/properties/column_rule_color.c b/src/select/properties/column_rule_color.c
index a5666e4..f54c2ab 100644
--- a/src/select/properties/column_rule_color.c
+++ b/src/select/properties/column_rule_color.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_column_rule_color(uint32_t opv, css_style *style,
+css_error css__cascade_column_rule_color(uint32_t opv, css_style *style,
css_select_state *state)
{
bool inherit = isInherit(opv);
diff --git a/src/select/properties/column_rule_style.c b/src/select/properties/column_rule_style.c
index 586ce5d..1d9a41e 100644
--- a/src/select/properties/column_rule_style.c
+++ b/src/select/properties/column_rule_style.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_column_rule_style(uint32_t opv, css_style *style,
+css_error css__cascade_column_rule_style(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_border_style(opv, style, state,
diff --git a/src/select/properties/column_rule_width.c b/src/select/properties/column_rule_width.c
index 8694a09..3ca9367 100644
--- a/src/select/properties/column_rule_width.c
+++ b/src/select/properties/column_rule_width.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_column_rule_width(uint32_t opv, css_style *style,
+css_error css__cascade_column_rule_width(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_border_width(opv, style, state,
diff --git a/src/select/properties/content.c b/src/select/properties/content.c
index 472a66a..0506ef3 100644
--- a/src/select/properties/content.c
+++ b/src/select/properties/content.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_content(uint32_t opv, css_style *style,
+css_error css__cascade_content(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_CONTENT_INHERIT;
@@ -30,14 +30,14 @@ css_error css__cascade_content(uint32_t opv, css_style *style,
value = CSS_CONTENT_NONE;
} else {
value = CSS_CONTENT_SET;
-
+
while (v != CONTENT_NORMAL) {
lwc_string *he;
css_computed_content_item *temp;
css__stylesheet_string_get(style->sheet,
*((css_code_t *) style->bytecode), &he);
-
+
temp = realloc(content,
(n_contents + 1) *
sizeof(css_computed_content_item));
@@ -63,7 +63,7 @@ css_error css__cascade_content(uint32_t opv, css_style *style,
case CONTENT_COUNTERS:
{
lwc_string *sep;
-
+
advance_bytecode(style, sizeof(css_code_t));
css__stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &sep);
@@ -155,7 +155,7 @@ css_error css__cascade_content(uint32_t opv, css_style *style,
return CSS_OK;
}
-css_error css__set_content_from_hint(const css_hint *hint,
+css_error css__set_content_from_hint(const css_hint *hint,
css_computed_style *style)
{
css_computed_content_item *item;
@@ -221,16 +221,16 @@ css_error css__compose_content(const css_computed_style *parent,
if (type == CSS_CONTENT_SET) {
const css_computed_content_item *i;
- for (i = items; i->type != CSS_COMPUTED_CONTENT_NONE;
+ for (i = items; i->type != CSS_COMPUTED_CONTENT_NONE;
i++)
n_items++;
- copy = malloc((n_items + 1) *
+ copy = malloc((n_items + 1) *
sizeof(css_computed_content_item));
if (copy == NULL)
return CSS_NOMEM;
- memcpy(copy, items, (n_items + 1) *
+ memcpy(copy, items, (n_items + 1) *
sizeof(css_computed_content_item));
}
diff --git a/src/select/properties/counter_increment.c b/src/select/properties/counter_increment.c
index 644607b..9888e0a 100644
--- a/src/select/properties/counter_increment.c
+++ b/src/select/properties/counter_increment.c
@@ -14,14 +14,14 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_counter_increment(uint32_t opv, css_style *style,
+css_error css__cascade_counter_increment(uint32_t opv, css_style *style,
css_select_state *state)
-{
- return css__cascade_counter_increment_reset(opv, style, state,
+{
+ return css__cascade_counter_increment_reset(opv, style, state,
set_counter_increment);
}
-css_error css__set_counter_increment_from_hint(const css_hint *hint,
+css_error css__set_counter_increment_from_hint(const css_hint *hint,
css_computed_style *style)
{
css_computed_counter *item;
@@ -44,7 +44,7 @@ css_error css__set_counter_increment_from_hint(const css_hint *hint,
css_error css__initial_counter_increment(css_select_state *state)
{
- return set_counter_increment(state->computed,
+ return set_counter_increment(state->computed,
CSS_COUNTER_INCREMENT_NONE, NULL);
}
@@ -57,7 +57,7 @@ css_error css__compose_counter_increment(const css_computed_style *parent,
uint8_t type = get_counter_increment(child, &items);
if ((child->i.uncommon == NULL && parent->i.uncommon != NULL) ||
- type == CSS_COUNTER_INCREMENT_INHERIT ||
+ type == CSS_COUNTER_INCREMENT_INHERIT ||
(child->i.uncommon != NULL && result != child)) {
size_t n_items = 0;
css_computed_counter *copy = NULL;
@@ -73,12 +73,12 @@ css_error css__compose_counter_increment(const css_computed_style *parent,
for (i = items; i->name != NULL; i++)
n_items++;
- copy = malloc((n_items + 1) *
+ copy = malloc((n_items + 1) *
sizeof(css_computed_counter));
if (copy == NULL)
return CSS_NOMEM;
- memcpy(copy, items, (n_items + 1) *
+ memcpy(copy, items, (n_items + 1) *
sizeof(css_computed_counter));
}
diff --git a/src/select/properties/counter_reset.c b/src/select/properties/counter_reset.c
index 05559f5..9d20609 100644
--- a/src/select/properties/counter_reset.c
+++ b/src/select/properties/counter_reset.c
@@ -14,14 +14,14 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_counter_reset(uint32_t opv, css_style *style,
+css_error css__cascade_counter_reset(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_counter_increment_reset(opv, style, state,
set_counter_reset);
}
-css_error css__set_counter_reset_from_hint(const css_hint *hint,
+css_error css__set_counter_reset_from_hint(const css_hint *hint,
css_computed_style *style)
{
css_computed_counter *item;
@@ -72,12 +72,12 @@ css_error css__compose_counter_reset(const css_computed_style *parent,
for (i = items; i->name != NULL; i++)
n_items++;
- copy = malloc((n_items + 1) *
+ copy = malloc((n_items + 1) *
sizeof(css_computed_counter));
if (copy == NULL)
return CSS_NOMEM;
- memcpy(copy, items, (n_items + 1) *
+ memcpy(copy, items, (n_items + 1) *
sizeof(css_computed_counter));
}
diff --git a/src/select/properties/cue_after.c b/src/select/properties/cue_after.c
index 86dd4a7..e1c09e8 100644
--- a/src/select/properties/cue_after.c
+++ b/src/select/properties/cue_after.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_cue_after(uint32_t opv, css_style *style,
+css_error css__cascade_cue_after(uint32_t opv, css_style *style,
css_select_state *state)
{
/** \todo cue-after */
diff --git a/src/select/properties/cue_before.c b/src/select/properties/cue_before.c
index cf89475..d562b3b 100644
--- a/src/select/properties/cue_before.c
+++ b/src/select/properties/cue_before.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_cue_before(uint32_t opv, css_style *style,
+css_error css__cascade_cue_before(uint32_t opv, css_style *style,
css_select_state *state)
{
/** \todo cue-before */
diff --git a/src/select/properties/cursor.c b/src/select/properties/cursor.c
index 1ca497f..6effdb5 100644
--- a/src/select/properties/cursor.c
+++ b/src/select/properties/cursor.c
@@ -14,9 +14,9 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_cursor(uint32_t opv, css_style *style,
+css_error css__cascade_cursor(uint32_t opv, css_style *style,
css_select_state *state)
-{
+{
uint16_t value = CSS_CURSOR_INHERIT;
lwc_string **uris = NULL;
uint32_t n_uris = 0;
@@ -33,7 +33,7 @@ css_error css__cascade_cursor(uint32_t opv, css_style *style,
&uri);
advance_bytecode(style, sizeof(css_code_t));
- temp = realloc(uris,
+ temp = realloc(uris,
(n_uris + 1) * sizeof(lwc_string *));
if (temp == NULL) {
if (uris != NULL) {
@@ -111,7 +111,7 @@ css_error css__cascade_cursor(uint32_t opv, css_style *style,
if (n_uris > 0) {
lwc_string **temp;
- temp = realloc(uris,
+ temp = realloc(uris,
(n_uris + 1) * sizeof(lwc_string *));
if (temp == NULL) {
free(uris);
@@ -148,7 +148,7 @@ css_error css__set_cursor_from_hint(const css_hint *hint,
error = set_cursor(style, hint->status, hint->data.strings);
- for (item = hint->data.strings;
+ for (item = hint->data.strings;
item != NULL && (*item) != NULL; item++) {
lwc_string_unref(*item);
}
@@ -189,12 +189,12 @@ css_error css__compose_cursor(const css_computed_style *parent,
for (i = urls; (*i) != NULL; i++)
n_urls++;
- copy = malloc((n_urls + 1) *
+ copy = malloc((n_urls + 1) *
sizeof(lwc_string *));
if (copy == NULL)
return CSS_NOMEM;
- memcpy(copy, urls, (n_urls + 1) *
+ memcpy(copy, urls, (n_urls + 1) *
sizeof(lwc_string *));
}
diff --git a/src/select/properties/direction.c b/src/select/properties/direction.c
index 1e68123..f4a5c46 100644
--- a/src/select/properties/direction.c
+++ b/src/select/properties/direction.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_direction(uint32_t opv, css_style *style,
+css_error css__cascade_direction(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_DIRECTION_INHERIT;
diff --git a/src/select/properties/display.c b/src/select/properties/display.c
index e5e7711..40c2e3e 100644
--- a/src/select/properties/display.c
+++ b/src/select/properties/display.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_display(uint32_t opv, css_style *style,
+css_error css__cascade_display(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_DISPLAY_INHERIT;
diff --git a/src/select/properties/elevation.c b/src/select/properties/elevation.c
index d893748..ee7d036 100644
--- a/src/select/properties/elevation.c
+++ b/src/select/properties/elevation.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_elevation(uint32_t opv, css_style *style,
+css_error css__cascade_elevation(uint32_t opv, css_style *style,
css_select_state *state)
{
css_fixed val = 0;
@@ -22,7 +22,7 @@ css_error css__cascade_elevation(uint32_t opv, css_style *style,
if (isInherit(opv) == false) {
switch (getValue(opv)) {
- case ELEVATION_ANGLE:
+ case ELEVATION_ANGLE:
val = *((css_fixed *) style->bytecode);
advance_bytecode(style, sizeof(val));
diff --git a/src/select/properties/empty_cells.c b/src/select/properties/empty_cells.c
index 5e749c2..fecdbdc 100644
--- a/src/select/properties/empty_cells.c
+++ b/src/select/properties/empty_cells.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_empty_cells(uint32_t opv, css_style *style,
+css_error css__cascade_empty_cells(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_EMPTY_CELLS_INHERIT;
diff --git a/src/select/properties/float.c b/src/select/properties/float.c
index 82df983..c3ba909 100644
--- a/src/select/properties/float.c
+++ b/src/select/properties/float.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_float(uint32_t opv, css_style *style,
+css_error css__cascade_float(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_FLOAT_INHERIT;
diff --git a/src/select/properties/font_family.c b/src/select/properties/font_family.c
index 514a43a..f853fcc 100644
--- a/src/select/properties/font_family.c
+++ b/src/select/properties/font_family.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_font_family(uint32_t opv, css_style *style,
+css_error css__cascade_font_family(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_FONT_FAMILY_INHERIT;
@@ -31,8 +31,8 @@ css_error css__cascade_font_family(uint32_t opv, css_style *style,
switch (v) {
case FONT_FAMILY_STRING:
case FONT_FAMILY_IDENT_LIST:
- css__stylesheet_string_get(style->sheet,
- *((css_code_t *) style->bytecode),
+ css__stylesheet_string_get(style->sheet,
+ *((css_code_t *) style->bytecode),
&font);
advance_bytecode(style, sizeof(css_code_t));
break;
@@ -63,7 +63,7 @@ css_error css__cascade_font_family(uint32_t opv, css_style *style,
* first generic-family are ignored. */
/** \todo Do this at bytecode generation time? */
if (value == CSS_FONT_FAMILY_INHERIT && font != NULL) {
- temp = realloc(fonts,
+ temp = realloc(fonts,
(n_fonts + 1) * sizeof(lwc_string *));
if (temp == NULL) {
if (fonts != NULL) {
@@ -97,25 +97,25 @@ css_error css__cascade_font_family(uint32_t opv, css_style *style,
fonts = temp;
fonts[n_fonts] = NULL;
-
+
if (value == CSS_FONT_FAMILY_INHERIT) {
/* The stylesheet doesn't specify a generic family,
* but it has specified named fonts.
* Fall back to the user agent's default family.
- * We don't want to inherit, because that will
+ * We don't want to inherit, because that will
* incorrectly overwrite the named fonts list too.
*/
css_hint hint;
css_error error;
-
+
error = state->handler->ua_default_for_property(
state->pw, CSS_PROP_FONT_FAMILY, &hint);
if (error == CSS_OK) {
lwc_string **item;
value = hint.status;
-
- for (item = hint.data.strings;
+
+ for (item = hint.data.strings;
item != NULL && (*item) != NULL;
item++) {
lwc_string_unref(*item);
@@ -158,7 +158,7 @@ css_error css__set_font_family_from_hint(const css_hint *hint,
error = set_font_family(style, hint->status, hint->data.strings);
- for (item = hint->data.strings;
+ for (item = hint->data.strings;
item != NULL && (*item) != NULL; item++) {
lwc_string_unref(*item);
}
@@ -207,7 +207,7 @@ css_error css__compose_font_family(const css_computed_style *parent,
if (copy == NULL)
return CSS_NOMEM;
- memcpy(copy, names, (n_names + 1) *
+ memcpy(copy, names, (n_names + 1) *
sizeof(lwc_string *));
}
diff --git a/src/select/properties/font_size.c b/src/select/properties/font_size.c
index 65fbb94..a0269be 100644
--- a/src/select/properties/font_size.c
+++ b/src/select/properties/font_size.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_font_size(uint32_t opv, css_style *style,
+css_error css__cascade_font_size(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_FONT_SIZE_INHERIT;
@@ -23,7 +23,7 @@ css_error css__cascade_font_size(uint32_t opv, css_style *style,
if (isInherit(opv) == false) {
switch (getValue(opv)) {
- case FONT_SIZE_DIMENSION:
+ case FONT_SIZE_DIMENSION:
value = CSS_FONT_SIZE_DIMENSION;
size = *((css_fixed *) style->bytecode);
@@ -75,13 +75,13 @@ css_error css__cascade_font_size(uint32_t opv, css_style *style,
css_error css__set_font_size_from_hint(const css_hint *hint,
css_computed_style *style)
{
- return set_font_size(style, hint->status,
+ return set_font_size(style, hint->status,
hint->data.length.value, hint->data.length.unit);
}
css_error css__initial_font_size(css_select_state *state)
{
- return set_font_size(state->computed, CSS_FONT_SIZE_MEDIUM,
+ return set_font_size(state->computed, CSS_FONT_SIZE_MEDIUM,
0, CSS_UNIT_PX);
}
diff --git a/src/select/properties/font_style.c b/src/select/properties/font_style.c
index 68846d6..0ba1fdd 100644
--- a/src/select/properties/font_style.c
+++ b/src/select/properties/font_style.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_font_style(uint32_t opv, css_style *style,
+css_error css__cascade_font_style(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_FONT_STYLE_INHERIT;
@@ -63,7 +63,7 @@ css_error css__compose_font_style(const css_computed_style *parent,
if (type == CSS_FONT_STYLE_INHERIT) {
type= get_font_style(parent);
}
-
+
return set_font_style(result, type);
}
diff --git a/src/select/properties/font_variant.c b/src/select/properties/font_variant.c
index b6bb2e9..a9b6e56 100644
--- a/src/select/properties/font_variant.c
+++ b/src/select/properties/font_variant.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_font_variant(uint32_t opv, css_style *style,
+css_error css__cascade_font_variant(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_FONT_VARIANT_INHERIT;
diff --git a/src/select/properties/font_weight.c b/src/select/properties/font_weight.c
index bd67f89..c0c2f2b 100644
--- a/src/select/properties/font_weight.c
+++ b/src/select/properties/font_weight.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_font_weight(uint32_t opv, css_style *style,
+css_error css__cascade_font_weight(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_FONT_WEIGHT_INHERIT;
diff --git a/src/select/properties/height.c b/src/select/properties/height.c
index 7aeec3f..1d74c4a 100644
--- a/src/select/properties/height.c
+++ b/src/select/properties/height.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_height(uint32_t opv, css_style *style,
+css_error css__cascade_height(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length_auto(opv, style, state, set_height);
diff --git a/src/select/properties/helpers.c b/src/select/properties/helpers.c
index 1091a10..36c3cba 100644
--- a/src/select/properties/helpers.c
+++ b/src/select/properties/helpers.c
@@ -46,17 +46,17 @@ css_unit css__to_css_unit(uint32_t u)
* Utilities below here *
******************************************************************************/
css_error css__cascade_bg_border_color(uint32_t opv, css_style *style,
- css_select_state *state,
+ css_select_state *state,
css_error (*fun)(css_computed_style *, uint8_t, css_color))
{
uint16_t value = CSS_BACKGROUND_COLOR_INHERIT;
css_color color = 0;
- assert(CSS_BACKGROUND_COLOR_INHERIT ==
+ assert(CSS_BACKGROUND_COLOR_INHERIT ==
(enum css_background_color_e)CSS_BORDER_COLOR_INHERIT);
- assert(CSS_BACKGROUND_COLOR_COLOR ==
+ assert(CSS_BACKGROUND_COLOR_COLOR ==
(enum css_background_color_e)CSS_BORDER_COLOR_COLOR);
- assert(CSS_BACKGROUND_COLOR_CURRENT_COLOR ==
+ assert(CSS_BACKGROUND_COLOR_CURRENT_COLOR ==
(enum css_background_color_e)CSS_BORDER_COLOR_CURRENT_COLOR);
if (isInherit(opv) == false) {
@@ -85,7 +85,7 @@ css_error css__cascade_bg_border_color(uint32_t opv, css_style *style,
css_error css__cascade_uri_none(uint32_t opv, css_style *style,
css_select_state *state,
- css_error (*fun)(css_computed_style *, uint8_t,
+ css_error (*fun)(css_computed_style *, uint8_t,
lwc_string *))
{
uint16_t value = CSS_BACKGROUND_IMAGE_INHERIT;
@@ -105,7 +105,7 @@ css_error css__cascade_uri_none(uint32_t opv, css_style *style,
}
/** \todo lose fun != NULL once all properties have set routines */
- if (fun != NULL && css__outranks_existing(getOpcode(opv),
+ if (fun != NULL && css__outranks_existing(getOpcode(opv),
isImportant(opv), state, isInherit(opv))) {
return fun(state->computed, value, uri);
}
@@ -114,7 +114,7 @@ css_error css__cascade_uri_none(uint32_t opv, css_style *style,
}
css_error css__cascade_border_style(uint32_t opv, css_style *style,
- css_select_state *state,
+ css_select_state *state,
css_error (*fun)(css_computed_style *, uint8_t))
{
uint16_t value = CSS_BORDER_STYLE_INHERIT;
@@ -165,8 +165,8 @@ css_error css__cascade_border_style(uint32_t opv, css_style *style,
}
css_error css__cascade_border_width(uint32_t opv, css_style *style,
- css_select_state *state,
- css_error (*fun)(css_computed_style *, uint8_t, css_fixed,
+ css_select_state *state,
+ css_error (*fun)(css_computed_style *, uint8_t, css_fixed,
css_unit))
{
uint16_t value = CSS_BORDER_WIDTH_INHERIT;
@@ -326,7 +326,7 @@ css_error css__cascade_length(uint32_t opv, css_style *style,
unit = css__to_css_unit(unit);
/** \todo lose fun != NULL once all properties have set routines */
- if (fun != NULL && css__outranks_existing(getOpcode(opv),
+ if (fun != NULL && css__outranks_existing(getOpcode(opv),
isImportant(opv), state, isInherit(opv))) {
return fun(state->computed, value, length, unit);
}
@@ -350,7 +350,7 @@ css_error css__cascade_number(uint32_t opv, css_style *style,
}
/** \todo lose fun != NULL once all properties have set routines */
- if (fun != NULL && css__outranks_existing(getOpcode(opv),
+ if (fun != NULL && css__outranks_existing(getOpcode(opv),
isImportant(opv), state, isInherit(opv))) {
return fun(state->computed, value, length);
}
@@ -358,7 +358,7 @@ css_error css__cascade_number(uint32_t opv, css_style *style,
return CSS_OK;
}
-css_error css__cascade_page_break_after_before_inside(uint32_t opv,
+css_error css__cascade_page_break_after_before_inside(uint32_t opv,
css_style *style, css_select_state *state,
css_error (*fun)(css_computed_style *, uint8_t))
{
@@ -387,7 +387,7 @@ css_error css__cascade_page_break_after_before_inside(uint32_t opv,
}
/** \todo lose fun != NULL */
- if (fun != NULL && css__outranks_existing(getOpcode(opv),
+ if (fun != NULL && css__outranks_existing(getOpcode(opv),
isImportant(opv), state, isInherit(opv))) {
return fun(state->computed, value);
}
@@ -471,7 +471,7 @@ css_error css__cascade_counter_increment_reset(uint32_t opv, css_style *style,
advance_bytecode(style, sizeof(css_code_t));
temp = realloc(counters,
- (n_counters + 1) *
+ (n_counters + 1) *
sizeof(css_computed_counter));
if (temp == NULL) {
if (counters != NULL) {
diff --git a/src/select/properties/helpers.h b/src/select/properties/helpers.h
index feed146..901bcf0 100644
--- a/src/select/properties/helpers.h
+++ b/src/select/properties/helpers.h
@@ -16,18 +16,18 @@ uint32_t generic_destroy_number(void *bytecode);
css_unit css__to_css_unit(uint32_t u);
css_error css__cascade_bg_border_color(uint32_t opv, css_style *style,
- css_select_state *state,
+ css_select_state *state,
css_error (*fun)(css_computed_style *, uint8_t, css_color));
css_error css__cascade_uri_none(uint32_t opv, css_style *style,
css_select_state *state,
- css_error (*fun)(css_computed_style *, uint8_t,
+ css_error (*fun)(css_computed_style *, uint8_t,
lwc_string *));
css_error css__cascade_border_style(uint32_t opv, css_style *style,
- css_select_state *state,
+ css_select_state *state,
css_error (*fun)(css_computed_style *, uint8_t));
css_error css__cascade_border_width(uint32_t opv, css_style *style,
- css_select_state *state,
- css_error (*fun)(css_computed_style *, uint8_t, css_fixed,
+ css_select_state *state,
+ css_error (*fun)(css_computed_style *, uint8_t, css_fixed,
css_unit));
css_error css__cascade_length_auto(uint32_t opv, css_style *style,
css_select_state *state,
@@ -48,7 +48,7 @@ css_error css__cascade_length(uint32_t opv, css_style *style,
css_error css__cascade_number(uint32_t opv, css_style *style,
css_select_state *state,
css_error (*fun)(css_computed_style *, uint8_t, css_fixed));
-css_error css__cascade_page_break_after_before_inside(uint32_t opv,
+css_error css__cascade_page_break_after_before_inside(uint32_t opv,
css_style *style, css_select_state *state,
css_error (*fun)(css_computed_style *, uint8_t));
css_error css__cascade_break_after_before_inside(uint32_t opv,
diff --git a/src/select/properties/left.c b/src/select/properties/left.c
index faf76bb..4baa324 100644
--- a/src/select/properties/left.c
+++ b/src/select/properties/left.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_left(uint32_t opv, css_style *style,
+css_error css__cascade_left(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length_auto(opv, style, state, set_left);
diff --git a/src/select/properties/letter_spacing.c b/src/select/properties/letter_spacing.c
index cc00100..d799467 100644
--- a/src/select/properties/letter_spacing.c
+++ b/src/select/properties/letter_spacing.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_letter_spacing(uint32_t opv, css_style *style,
+css_error css__cascade_letter_spacing(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length_normal(opv, style, state, set_letter_spacing);
@@ -29,7 +29,7 @@ css_error css__set_letter_spacing_from_hint(const css_hint *hint,
css_error css__initial_letter_spacing(css_select_state *state)
{
- return set_letter_spacing(state->computed, CSS_LETTER_SPACING_NORMAL,
+ return set_letter_spacing(state->computed, CSS_LETTER_SPACING_NORMAL,
0, CSS_UNIT_PX);
}
diff --git a/src/select/properties/line_height.c b/src/select/properties/line_height.c
index 24b9e80..091a575 100644
--- a/src/select/properties/line_height.c
+++ b/src/select/properties/line_height.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_line_height(uint32_t opv, css_style *style,
+css_error css__cascade_line_height(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_LINE_HEIGHT_INHERIT;
@@ -60,7 +60,7 @@ css_error css__set_line_height_from_hint(const css_hint *hint,
css_error css__initial_line_height(css_select_state *state)
{
- return set_line_height(state->computed, CSS_LINE_HEIGHT_NORMAL,
+ return set_line_height(state->computed, CSS_LINE_HEIGHT_NORMAL,
0, CSS_UNIT_PX);
}
diff --git a/src/select/properties/list_style_image.c b/src/select/properties/list_style_image.c
index edc92fb..cc77eb4 100644
--- a/src/select/properties/list_style_image.c
+++ b/src/select/properties/list_style_image.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_list_style_image(uint32_t opv, css_style *style,
+css_error css__cascade_list_style_image(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_uri_none(opv, style, state, set_list_style_image);
@@ -35,7 +35,7 @@ css_error css__set_list_style_image_from_hint(const css_hint *hint,
css_error css__initial_list_style_image(css_select_state *state)
{
- return set_list_style_image(state->computed,
+ return set_list_style_image(state->computed,
CSS_LIST_STYLE_IMAGE_NONE, NULL);
}
diff --git a/src/select/properties/list_style_position.c b/src/select/properties/list_style_position.c
index acdbedb..02d7651 100644
--- a/src/select/properties/list_style_position.c
+++ b/src/select/properties/list_style_position.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_list_style_position(uint32_t opv, css_style *style,
+css_error css__cascade_list_style_position(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_LIST_STYLE_POSITION_INHERIT;
@@ -48,7 +48,7 @@ css_error css__set_list_style_position_from_hint(const css_hint *hint,
css_error css__initial_list_style_position(css_select_state *state)
{
- return set_list_style_position(state->computed,
+ return set_list_style_position(state->computed,
CSS_LIST_STYLE_POSITION_OUTSIDE);
}
diff --git a/src/select/properties/list_style_type.c b/src/select/properties/list_style_type.c
index 470bfb0..b1e5db6 100644
--- a/src/select/properties/list_style_type.c
+++ b/src/select/properties/list_style_type.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_list_style_type(uint32_t opv, css_style *style,
+css_error css__cascade_list_style_type(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_LIST_STYLE_TYPE_INHERIT;
diff --git a/src/select/properties/margin_bottom.c b/src/select/properties/margin_bottom.c
index c34004e..3b1d8a1 100644
--- a/src/select/properties/margin_bottom.c
+++ b/src/select/properties/margin_bottom.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_margin_bottom(uint32_t opv, css_style *style,
+css_error css__cascade_margin_bottom(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length_auto(opv, style, state, set_margin_bottom);
diff --git a/src/select/properties/margin_left.c b/src/select/properties/margin_left.c
index ac22c3d..240285a 100644
--- a/src/select/properties/margin_left.c
+++ b/src/select/properties/margin_left.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_margin_left(uint32_t opv, css_style *style,
+css_error css__cascade_margin_left(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length_auto(opv, style, state, set_margin_left);
diff --git a/src/select/properties/margin_right.c b/src/select/properties/margin_right.c
index a10df13..737fbee 100644
--- a/src/select/properties/margin_right.c
+++ b/src/select/properties/margin_right.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_margin_right(uint32_t opv, css_style *style,
+css_error css__cascade_margin_right(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length_auto(opv, style, state, set_margin_right);
diff --git a/src/select/properties/margin_top.c b/src/select/properties/margin_top.c
index f66c8ee..5563a48 100644
--- a/src/select/properties/margin_top.c
+++ b/src/select/properties/margin_top.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_margin_top(uint32_t opv, css_style *style,
+css_error css__cascade_margin_top(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length_auto(opv, style, state, set_margin_top);
diff --git a/src/select/properties/max_height.c b/src/select/properties/max_height.c
index 51fae8c..e03c8da 100644
--- a/src/select/properties/max_height.c
+++ b/src/select/properties/max_height.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_max_height(uint32_t opv, css_style *style,
+css_error css__cascade_max_height(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length_none(opv, style, state, set_max_height);
@@ -29,7 +29,7 @@ css_error css__set_max_height_from_hint(const css_hint *hint,
css_error css__initial_max_height(css_select_state *state)
{
- return set_max_height(state->computed, CSS_MAX_HEIGHT_NONE,
+ return set_max_height(state->computed, CSS_MAX_HEIGHT_NONE,
0, CSS_UNIT_PX);
}
diff --git a/src/select/properties/max_width.c b/src/select/properties/max_width.c
index f9ccc03..ec98712 100644
--- a/src/select/properties/max_width.c
+++ b/src/select/properties/max_width.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_max_width(uint32_t opv, css_style *style,
+css_error css__cascade_max_width(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length_none(opv, style, state, set_max_width);;
diff --git a/src/select/properties/min_height.c b/src/select/properties/min_height.c
index a3ab6b9..687d8a1 100644
--- a/src/select/properties/min_height.c
+++ b/src/select/properties/min_height.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_min_height(uint32_t opv, css_style *style,
+css_error css__cascade_min_height(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length(opv, style, state, set_min_height);
@@ -29,7 +29,7 @@ css_error css__set_min_height_from_hint(const css_hint *hint,
css_error css__initial_min_height(css_select_state *state)
{
- return set_min_height(state->computed, CSS_MIN_HEIGHT_SET,
+ return set_min_height(state->computed, CSS_MIN_HEIGHT_SET,
0, CSS_UNIT_PX);
}
diff --git a/src/select/properties/min_width.c b/src/select/properties/min_width.c
index 4139eda..5365588 100644
--- a/src/select/properties/min_width.c
+++ b/src/select/properties/min_width.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_min_width(uint32_t opv, css_style *style,
+css_error css__cascade_min_width(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length(opv, style, state, set_min_width);
diff --git a/src/select/properties/opacity.c b/src/select/properties/opacity.c
index 9ef0998..aadab0b 100644
--- a/src/select/properties/opacity.c
+++ b/src/select/properties/opacity.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_opacity(uint32_t opv, css_style *style,
+css_error css__cascade_opacity(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_OPACITY_INHERIT;
diff --git a/src/select/properties/orphans.c b/src/select/properties/orphans.c
index d5c4937..f169b81 100644
--- a/src/select/properties/orphans.c
+++ b/src/select/properties/orphans.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_orphans(uint32_t opv, css_style *style,
+css_error css__cascade_orphans(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_number(opv, style, state, set_orphans);
@@ -37,11 +37,11 @@ css_error css__compose_orphans(const css_computed_style *parent,
{
int32_t count = 0;
uint8_t type = get_orphans(child, &count);
-
+
if (type == CSS_ORPHANS_INHERIT) {
type = get_orphans(parent, &count);
}
-
+
return set_orphans(result, type, count);
}
diff --git a/src/select/properties/outline_color.c b/src/select/properties/outline_color.c
index 2613839..c6c576b 100644
--- a/src/select/properties/outline_color.c
+++ b/src/select/properties/outline_color.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_outline_color(uint32_t opv, css_style *style,
+css_error css__cascade_outline_color(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_OUTLINE_COLOR_INHERIT;
diff --git a/src/select/properties/outline_style.c b/src/select/properties/outline_style.c
index 7b64381..5c30735 100644
--- a/src/select/properties/outline_style.c
+++ b/src/select/properties/outline_style.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_outline_style(uint32_t opv, css_style *style,
+css_error css__cascade_outline_style(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_border_style(opv, style, state, set_outline_style);
diff --git a/src/select/properties/outline_width.c b/src/select/properties/outline_width.c
index 547c42a..4d9101c 100644
--- a/src/select/properties/outline_width.c
+++ b/src/select/properties/outline_width.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_outline_width(uint32_t opv, css_style *style,
+css_error css__cascade_outline_width(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_border_width(opv, style, state, set_outline_width);
diff --git a/src/select/properties/overflow_x.c b/src/select/properties/overflow_x.c
index 0173f5a..817d1d2 100644
--- a/src/select/properties/overflow_x.c
+++ b/src/select/properties/overflow_x.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_overflow_x(uint32_t opv, css_style *style,
+css_error css__cascade_overflow_x(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_OVERFLOW_INHERIT;
diff --git a/src/select/properties/overflow_y.c b/src/select/properties/overflow_y.c
index 13213b5..b54c4c8 100644
--- a/src/select/properties/overflow_y.c
+++ b/src/select/properties/overflow_y.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_overflow_y(uint32_t opv, css_style *style,
+css_error css__cascade_overflow_y(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_OVERFLOW_INHERIT;
diff --git a/src/select/properties/padding_bottom.c b/src/select/properties/padding_bottom.c
index 806f0f5..e3b36f7 100644
--- a/src/select/properties/padding_bottom.c
+++ b/src/select/properties/padding_bottom.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_padding_bottom(uint32_t opv, css_style *style,
+css_error css__cascade_padding_bottom(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length(opv, style, state, set_padding_bottom);
@@ -29,7 +29,7 @@ css_error css__set_padding_bottom_from_hint(const css_hint *hint,
css_error css__initial_padding_bottom(css_select_state *state)
{
- return set_padding_bottom(state->computed, CSS_PADDING_SET,
+ return set_padding_bottom(state->computed, CSS_PADDING_SET,
0, CSS_UNIT_PX);
}
diff --git a/src/select/properties/padding_left.c b/src/select/properties/padding_left.c
index 8873652..bdea11e 100644
--- a/src/select/properties/padding_left.c
+++ b/src/select/properties/padding_left.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_padding_left(uint32_t opv, css_style *style,
+css_error css__cascade_padding_left(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length(opv, style, state, set_padding_left);
diff --git a/src/select/properties/padding_right.c b/src/select/properties/padding_right.c
index a79d8f4..82c1ed3 100644
--- a/src/select/properties/padding_right.c
+++ b/src/select/properties/padding_right.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_padding_right(uint32_t opv, css_style *style,
+css_error css__cascade_padding_right(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length(opv, style, state, set_padding_right);
@@ -29,7 +29,7 @@ css_error css__set_padding_right_from_hint(const css_hint *hint,
css_error css__initial_padding_right(css_select_state *state)
{
- return set_padding_right(state->computed, CSS_PADDING_SET,
+ return set_padding_right(state->computed, CSS_PADDING_SET,
0, CSS_UNIT_PX);
}
diff --git a/src/select/properties/padding_top.c b/src/select/properties/padding_top.c
index 20fbe1e..f6d8b3e 100644
--- a/src/select/properties/padding_top.c
+++ b/src/select/properties/padding_top.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_padding_top(uint32_t opv, css_style *style,
+css_error css__cascade_padding_top(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length(opv, style, state, set_padding_top);
diff --git a/src/select/properties/page_break_after.c b/src/select/properties/page_break_after.c
index 0fd44c4..fdb6774 100644
--- a/src/select/properties/page_break_after.c
+++ b/src/select/properties/page_break_after.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_page_break_after(uint32_t opv, css_style *style,
+css_error css__cascade_page_break_after(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_page_break_after_before_inside(opv, style, state,
diff --git a/src/select/properties/page_break_before.c b/src/select/properties/page_break_before.c
index 0acae48..1491997 100644
--- a/src/select/properties/page_break_before.c
+++ b/src/select/properties/page_break_before.c
@@ -14,10 +14,10 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_page_break_before(uint32_t opv, css_style *style,
+css_error css__cascade_page_break_before(uint32_t opv, css_style *style,
css_select_state *state)
{
- return css__cascade_page_break_after_before_inside(opv, style, state,
+ return css__cascade_page_break_after_before_inside(opv, style, state,
set_page_break_before);
}
@@ -29,7 +29,7 @@ css_error css__set_page_break_before_from_hint(const css_hint *hint,
css_error css__initial_page_break_before(css_select_state *state)
{
- return set_page_break_before(state->computed,
+ return set_page_break_before(state->computed,
CSS_PAGE_BREAK_BEFORE_AUTO);
}
@@ -38,10 +38,10 @@ css_error css__compose_page_break_before(const css_computed_style *parent,
css_computed_style *result)
{
uint8_t type = get_page_break_before(child);
-
+
if (type == CSS_PAGE_BREAK_BEFORE_INHERIT) {
type = get_page_break_before(parent);
}
-
+
return set_page_break_before(result, type);
}
diff --git a/src/select/properties/page_break_inside.c b/src/select/properties/page_break_inside.c
index 20b8bf5..ddcb19f 100644
--- a/src/select/properties/page_break_inside.c
+++ b/src/select/properties/page_break_inside.c
@@ -14,10 +14,10 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_page_break_inside(uint32_t opv, css_style *style,
+css_error css__cascade_page_break_inside(uint32_t opv, css_style *style,
css_select_state *state)
{
- return css__cascade_page_break_after_before_inside(opv, style, state,
+ return css__cascade_page_break_after_before_inside(opv, style, state,
set_page_break_inside);
}
@@ -38,11 +38,11 @@ css_error css__compose_page_break_inside(const css_computed_style *parent,
css_computed_style *result)
{
uint8_t type = get_page_break_inside(child);
-
+
if (type == CSS_PAGE_BREAK_INSIDE_INHERIT) {
type = get_page_break_inside(parent);
}
-
+
return set_page_break_inside(result, type);
}
diff --git a/src/select/properties/pause_after.c b/src/select/properties/pause_after.c
index a33ee66..16bbefe 100644
--- a/src/select/properties/pause_after.c
+++ b/src/select/properties/pause_after.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_pause_after(uint32_t opv, css_style *style,
+css_error css__cascade_pause_after(uint32_t opv, css_style *style,
css_select_state *state)
{
/** \todo pause-after */
diff --git a/src/select/properties/pause_before.c b/src/select/properties/pause_before.c
index b33e94a..7770615 100644
--- a/src/select/properties/pause_before.c
+++ b/src/select/properties/pause_before.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_pause_before(uint32_t opv, css_style *style,
+css_error css__cascade_pause_before(uint32_t opv, css_style *style,
css_select_state *state)
{
/** \todo pause-before */
diff --git a/src/select/properties/pitch.c b/src/select/properties/pitch.c
index b6dc649..c5484d9 100644
--- a/src/select/properties/pitch.c
+++ b/src/select/properties/pitch.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_pitch(uint32_t opv, css_style *style,
+css_error css__cascade_pitch(uint32_t opv, css_style *style,
css_select_state *state)
{
css_fixed freq = 0;
diff --git a/src/select/properties/pitch_range.c b/src/select/properties/pitch_range.c
index 9a2ea24..52a5751 100644
--- a/src/select/properties/pitch_range.c
+++ b/src/select/properties/pitch_range.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_pitch_range(uint32_t opv, css_style *style,
+css_error css__cascade_pitch_range(uint32_t opv, css_style *style,
css_select_state *state)
{
/** \todo pitch-range */
diff --git a/src/select/properties/play_during.c b/src/select/properties/play_during.c
index 0210567..413d75a 100644
--- a/src/select/properties/play_during.c
+++ b/src/select/properties/play_during.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_play_during(uint32_t opv, css_style *style,
+css_error css__cascade_play_during(uint32_t opv, css_style *style,
css_select_state *state)
{
lwc_string *uri = NULL;
diff --git a/src/select/properties/position.c b/src/select/properties/position.c
index 7f566da..9f9658f 100644
--- a/src/select/properties/position.c
+++ b/src/select/properties/position.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_position(uint32_t opv, css_style *style,
+css_error css__cascade_position(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_POSITION_INHERIT;
diff --git a/src/select/properties/quotes.c b/src/select/properties/quotes.c
index 2dd6af4..4144d8e 100644
--- a/src/select/properties/quotes.c
+++ b/src/select/properties/quotes.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_quotes(uint32_t opv, css_style *style,
+css_error css__cascade_quotes(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_QUOTES_INHERIT;
@@ -40,7 +40,7 @@ css_error css__cascade_quotes(uint32_t opv, css_style *style,
&close);
advance_bytecode(style, sizeof(css_code_t));
- temp = realloc(quotes,
+ temp = realloc(quotes,
(n_quotes + 2) * sizeof(lwc_string *));
if (temp == NULL) {
if (quotes != NULL) {
@@ -96,7 +96,7 @@ css_error css__set_quotes_from_hint(const css_hint *hint,
{
lwc_string **item;
css_error error;
-
+
error = set_quotes(style, hint->status, hint->data.strings);
for (item = hint->data.strings;
@@ -149,7 +149,7 @@ css_error css__compose_quotes(const css_computed_style *parent,
if (copy == NULL)
return CSS_NOMEM;
- memcpy(copy, quotes, (n_quotes + 1) *
+ memcpy(copy, quotes, (n_quotes + 1) *
sizeof(lwc_string *));
}
diff --git a/src/select/properties/richness.c b/src/select/properties/richness.c
index d05ed7b..9656486 100644
--- a/src/select/properties/richness.c
+++ b/src/select/properties/richness.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_richness(uint32_t opv, css_style *style,
+css_error css__cascade_richness(uint32_t opv, css_style *style,
css_select_state *state)
{
/** \todo richness */
diff --git a/src/select/properties/right.c b/src/select/properties/right.c
index b87e63e..142e7e8 100644
--- a/src/select/properties/right.c
+++ b/src/select/properties/right.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_right(uint32_t opv, css_style *style,
+css_error css__cascade_right(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length_auto(opv, style, state, set_right);
diff --git a/src/select/properties/speak.c b/src/select/properties/speak.c
index 0b52e62..eb5528b 100644
--- a/src/select/properties/speak.c
+++ b/src/select/properties/speak.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_speak(uint32_t opv, css_style *style,
+css_error css__cascade_speak(uint32_t opv, css_style *style,
css_select_state *state)
{
UNUSED(style);
diff --git a/src/select/properties/speak_header.c b/src/select/properties/speak_header.c
index 6fc37d5..0935528 100644
--- a/src/select/properties/speak_header.c
+++ b/src/select/properties/speak_header.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_speak_header(uint32_t opv, css_style *style,
+css_error css__cascade_speak_header(uint32_t opv, css_style *style,
css_select_state *state)
{
UNUSED(style);
diff --git a/src/select/properties/speak_numeral.c b/src/select/properties/speak_numeral.c
index 1e74abd..fc54caf 100644
--- a/src/select/properties/speak_numeral.c
+++ b/src/select/properties/speak_numeral.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_speak_numeral(uint32_t opv, css_style *style,
+css_error css__cascade_speak_numeral(uint32_t opv, css_style *style,
css_select_state *state)
{
UNUSED(style);
diff --git a/src/select/properties/speak_punctuation.c b/src/select/properties/speak_punctuation.c
index 9898b7c..67cbdaf 100644
--- a/src/select/properties/speak_punctuation.c
+++ b/src/select/properties/speak_punctuation.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_speak_punctuation(
+css_error css__cascade_speak_punctuation(
uint32_t opv, css_style *style, css_select_state *state)
{
UNUSED(style);
diff --git a/src/select/properties/speech_rate.c b/src/select/properties/speech_rate.c
index c974997..5cec19b 100644
--- a/src/select/properties/speech_rate.c
+++ b/src/select/properties/speech_rate.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_speech_rate(uint32_t opv, css_style *style,
+css_error css__cascade_speech_rate(uint32_t opv, css_style *style,
css_select_state *state)
{
css_fixed rate = 0;
diff --git a/src/select/properties/stress.c b/src/select/properties/stress.c
index 81cf0e4..c9d61dd 100644
--- a/src/select/properties/stress.c
+++ b/src/select/properties/stress.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_stress(uint32_t opv, css_style *style,
+css_error css__cascade_stress(uint32_t opv, css_style *style,
css_select_state *state)
{
/** \todo stress */
diff --git a/src/select/properties/table_layout.c b/src/select/properties/table_layout.c
index c28cdae..c911e10 100644
--- a/src/select/properties/table_layout.c
+++ b/src/select/properties/table_layout.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_table_layout(uint32_t opv, css_style *style,
+css_error css__cascade_table_layout(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_TABLE_LAYOUT_INHERIT;
diff --git a/src/select/properties/text_align.c b/src/select/properties/text_align.c
index 611fcd3..808107f 100644
--- a/src/select/properties/text_align.c
+++ b/src/select/properties/text_align.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_text_align(uint32_t opv, css_style *style,
+css_error css__cascade_text_align(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_TEXT_ALIGN_INHERIT;
@@ -66,7 +66,7 @@ css_error css__initial_text_align(css_select_state *state)
return set_text_align(state->computed, CSS_TEXT_ALIGN_DEFAULT);
}
-css_error css__compose_text_align(const css_computed_style *parent,
+css_error css__compose_text_align(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
@@ -78,8 +78,8 @@ css_error css__compose_text_align(const css_computed_style *parent,
/* This is purely for the benefit of HTML tables */
type = get_text_align(parent);
- /* If the parent's text-align is a magical one,
- * then reset to the default value. Otherwise,
+ /* If the parent's text-align is a magical one,
+ * then reset to the default value. Otherwise,
* inherit as normal. */
if (type == CSS_TEXT_ALIGN_LIBCSS_LEFT ||
type == CSS_TEXT_ALIGN_LIBCSS_CENTER ||
diff --git a/src/select/properties/text_decoration.c b/src/select/properties/text_decoration.c
index 7f5a172..0e7544d 100644
--- a/src/select/properties/text_decoration.c
+++ b/src/select/properties/text_decoration.c
@@ -16,11 +16,11 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_text_decoration(uint32_t opv, css_style *style,
+css_error css__cascade_text_decoration(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_TEXT_DECORATION_INHERIT;
-
+
UNUSED(style);
if (isInherit(opv) == false) {
@@ -59,7 +59,7 @@ css_error css__initial_text_decoration(css_select_state *state)
return set_text_decoration(state->computed, CSS_TEXT_DECORATION_NONE);
}
-css_error css__compose_text_decoration(const css_computed_style *parent,
+css_error css__compose_text_decoration(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
diff --git a/src/select/properties/text_indent.c b/src/select/properties/text_indent.c
index 867292e..787c0be 100644
--- a/src/select/properties/text_indent.c
+++ b/src/select/properties/text_indent.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_text_indent(uint32_t opv, css_style *style,
+css_error css__cascade_text_indent(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length(opv, style, state, set_text_indent);
@@ -29,7 +29,7 @@ css_error css__set_text_indent_from_hint(const css_hint *hint,
css_error css__initial_text_indent(css_select_state *state)
{
- return set_text_indent(state->computed, CSS_TEXT_INDENT_SET,
+ return set_text_indent(state->computed, CSS_TEXT_INDENT_SET,
0, CSS_UNIT_PX);
}
diff --git a/src/select/properties/text_transform.c b/src/select/properties/text_transform.c
index 43117e9..38cb427 100644
--- a/src/select/properties/text_transform.c
+++ b/src/select/properties/text_transform.c
@@ -14,11 +14,11 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_text_transform(uint32_t opv, css_style *style,
+css_error css__cascade_text_transform(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_TEXT_TRANSFORM_INHERIT;
-
+
UNUSED(style);
if (isInherit(opv) == false) {
@@ -57,7 +57,7 @@ css_error css__initial_text_transform(css_select_state *state)
return set_text_transform(state->computed, CSS_TEXT_TRANSFORM_NONE);
}
-css_error css__compose_text_transform(const css_computed_style *parent,
+css_error css__compose_text_transform(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
diff --git a/src/select/properties/top.c b/src/select/properties/top.c
index 8fd1935..72129aa 100644
--- a/src/select/properties/top.c
+++ b/src/select/properties/top.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_top(uint32_t opv, css_style *style,
+css_error css__cascade_top(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length_auto(opv, style, state, set_top);
diff --git a/src/select/properties/unicode_bidi.c b/src/select/properties/unicode_bidi.c
index d798ff2..5b91df1 100644
--- a/src/select/properties/unicode_bidi.c
+++ b/src/select/properties/unicode_bidi.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_unicode_bidi(uint32_t opv, css_style *style,
+css_error css__cascade_unicode_bidi(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_UNICODE_BIDI_INHERIT;
@@ -54,7 +54,7 @@ css_error css__initial_unicode_bidi(css_select_state *state)
return set_unicode_bidi(state->computed, CSS_UNICODE_BIDI_NORMAL);
}
-css_error css__compose_unicode_bidi(const css_computed_style *parent,
+css_error css__compose_unicode_bidi(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
diff --git a/src/select/properties/vertical_align.c b/src/select/properties/vertical_align.c
index dba2343..9fb7143 100644
--- a/src/select/properties/vertical_align.c
+++ b/src/select/properties/vertical_align.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_vertical_align(uint32_t opv, css_style *style,
+css_error css__cascade_vertical_align(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_VERTICAL_ALIGN_INHERIT;
diff --git a/src/select/properties/visibility.c b/src/select/properties/visibility.c
index dd1c1e3..ef95252 100644
--- a/src/select/properties/visibility.c
+++ b/src/select/properties/visibility.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_visibility(uint32_t opv, css_style *style,
+css_error css__cascade_visibility(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_VISIBILITY_INHERIT;
@@ -54,7 +54,7 @@ css_error css__initial_visibility(css_select_state *state)
return set_visibility(state->computed, CSS_VISIBILITY_VISIBLE);
}
-css_error css__compose_visibility(const css_computed_style *parent,
+css_error css__compose_visibility(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
diff --git a/src/select/properties/voice_family.c b/src/select/properties/voice_family.c
index 5c70d1e..b370a2b 100644
--- a/src/select/properties/voice_family.c
+++ b/src/select/properties/voice_family.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_voice_family(uint32_t opv, css_style *style,
+css_error css__cascade_voice_family(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = 0;
@@ -55,7 +55,7 @@ css_error css__cascade_voice_family(uint32_t opv, css_style *style,
* first generic-family are ignored. */
/** \todo Do this at bytecode generation time? */
if (value == 0 && voice != NULL) {
- temp = realloc(voices,
+ temp = realloc(voices,
(n_voices + 1) * sizeof(lwc_string *));
if (temp == NULL) {
if (voices != NULL) {
diff --git a/src/select/properties/volume.c b/src/select/properties/volume.c
index ca0e9dd..96787fa 100644
--- a/src/select/properties/volume.c
+++ b/src/select/properties/volume.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_volume(uint32_t opv, css_style *style,
+css_error css__cascade_volume(uint32_t opv, css_style *style,
css_select_state *state)
{
css_fixed val = 0;
diff --git a/src/select/properties/white_space.c b/src/select/properties/white_space.c
index d537768..b8d2e02 100644
--- a/src/select/properties/white_space.c
+++ b/src/select/properties/white_space.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_white_space(uint32_t opv, css_style *style,
+css_error css__cascade_white_space(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_WHITE_SPACE_INHERIT;
@@ -60,7 +60,7 @@ css_error css__initial_white_space(css_select_state *state)
return set_white_space(state->computed, CSS_WHITE_SPACE_NORMAL);
}
-css_error css__compose_white_space(const css_computed_style *parent,
+css_error css__compose_white_space(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
diff --git a/src/select/properties/widows.c b/src/select/properties/widows.c
index 916966a..61126c2 100644
--- a/src/select/properties/widows.c
+++ b/src/select/properties/widows.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_widows(uint32_t opv, css_style *style,
+css_error css__cascade_widows(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_number(opv, style, state, set_widows);
@@ -37,11 +37,11 @@ css_error css__compose_widows(const css_computed_style *parent,
{
int32_t count = 0;
uint8_t type = get_widows(child, &count);
-
+
if (type == CSS_WIDOWS_INHERIT) {
type = get_widows(parent, &count);
}
-
+
return set_widows(result, type, count);
}
diff --git a/src/select/properties/width.c b/src/select/properties/width.c
index 4b43a8c..829df91 100644
--- a/src/select/properties/width.c
+++ b/src/select/properties/width.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_width(uint32_t opv, css_style *style,
+css_error css__cascade_width(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length_auto(opv, style, state, set_width);
diff --git a/src/select/properties/word_spacing.c b/src/select/properties/word_spacing.c
index 24eda89..4cb9422 100644
--- a/src/select/properties/word_spacing.c
+++ b/src/select/properties/word_spacing.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_word_spacing(uint32_t opv, css_style *style,
+css_error css__cascade_word_spacing(uint32_t opv, css_style *style,
css_select_state *state)
{
return css__cascade_length_normal(opv, style, state, set_word_spacing);
@@ -29,7 +29,7 @@ css_error css__set_word_spacing_from_hint(const css_hint *hint,
css_error css__initial_word_spacing(css_select_state *state)
{
- return set_word_spacing(state->computed, CSS_WORD_SPACING_NORMAL,
+ return set_word_spacing(state->computed, CSS_WORD_SPACING_NORMAL,
0, CSS_UNIT_PX);
}
diff --git a/src/select/properties/writing_mode.c b/src/select/properties/writing_mode.c
index 3ec1352..bbd3753 100644
--- a/src/select/properties/writing_mode.c
+++ b/src/select/properties/writing_mode.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_writing_mode(uint32_t opv, css_style *style,
+css_error css__cascade_writing_mode(uint32_t opv, css_style *style,
css_select_state *state)
{
bool inherit = isInherit(opv);
@@ -35,7 +35,7 @@ css_error css__cascade_writing_mode(uint32_t opv, css_style *style,
}
}
- if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
+ if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
inherit)) {
return set_writing_mode(state->computed, writing_mode);
}
@@ -43,7 +43,7 @@ css_error css__cascade_writing_mode(uint32_t opv, css_style *style,
return CSS_OK;
}
-css_error css__set_writing_mode_from_hint(const css_hint *hint,
+css_error css__set_writing_mode_from_hint(const css_hint *hint,
css_computed_style *style)
{
return set_writing_mode(style, hint->status);
diff --git a/src/select/properties/z_index.c b/src/select/properties/z_index.c
index 3ad15e7..59cf242 100644
--- a/src/select/properties/z_index.c
+++ b/src/select/properties/z_index.c
@@ -14,7 +14,7 @@
#include "select/properties/properties.h"
#include "select/properties/helpers.h"
-css_error css__cascade_z_index(uint32_t opv, css_style *style,
+css_error css__cascade_z_index(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_Z_INDEX_INHERIT;
diff --git a/src/select/select.c b/src/select/select.c
index 580c29e..6b5225a 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -118,38 +118,38 @@ typedef struct css_select_rule_source {
static css_error set_hint(css_select_state *state, css_hint *hint);
-static css_error set_initial(css_select_state *state,
+static css_error set_initial(css_select_state *state,
uint32_t prop, css_pseudo_element pseudo,
void *parent);
static css_error intern_strings(css_select_ctx *ctx);
static void destroy_strings(css_select_ctx *ctx);
-static css_error select_from_sheet(css_select_ctx *ctx,
+static css_error select_from_sheet(css_select_ctx *ctx,
const css_stylesheet *sheet, css_origin origin,
css_select_state *state);
-static css_error match_selectors_in_sheet(css_select_ctx *ctx,
+static css_error match_selectors_in_sheet(css_select_ctx *ctx,
const css_stylesheet *sheet, css_select_state *state);
-static css_error match_selector_chain(css_select_ctx *ctx,
+static css_error match_selector_chain(css_select_ctx *ctx,
const css_selector *selector, css_select_state *state);
-static css_error match_named_combinator(css_select_ctx *ctx,
- css_combinator type, const css_selector *selector,
+static css_error match_named_combinator(css_select_ctx *ctx,
+ css_combinator type, const css_selector *selector,
css_select_state *state, void *node, void **next_node);
-static css_error match_universal_combinator(css_select_ctx *ctx,
- css_combinator type, const css_selector *selector,
+static css_error match_universal_combinator(css_select_ctx *ctx,
+ css_combinator type, const css_selector *selector,
css_select_state *state, void *node, bool may_optimise,
bool *rejected_by_cache, void **next_node);
-static css_error match_details(css_select_ctx *ctx, void *node,
- const css_selector_detail *detail, css_select_state *state,
+static css_error match_details(css_select_ctx *ctx, void *node,
+ const css_selector_detail *detail, css_select_state *state,
bool *match, css_pseudo_element *pseudo_element);
-static css_error match_detail(css_select_ctx *ctx, void *node,
- const css_selector_detail *detail, css_select_state *state,
+static css_error match_detail(css_select_ctx *ctx, void *node,
+ const css_selector_detail *detail, css_select_state *state,
bool *match, css_pseudo_element *pseudo_element);
static css_error cascade_style(const css_style *style, css_select_state *state);
static css_error select_font_faces_from_sheet(
- const css_stylesheet *sheet,
- css_origin origin,
+ const css_stylesheet *sheet,
+ css_origin origin,
css_select_font_faces_state *state);
#ifdef DEBUG_CHAIN_MATCHING
@@ -305,7 +305,7 @@ css_error css_select_ctx_destroy(css_select_ctx *ctx)
* \param media Media types to which the sheet applies
* \return CSS_OK on success, appropriate error otherwise
*/
-css_error css_select_ctx_append_sheet(css_select_ctx *ctx,
+css_error css_select_ctx_append_sheet(css_select_ctx *ctx,
const css_stylesheet *sheet, css_origin origin,
uint64_t media)
{
@@ -318,7 +318,7 @@ css_error css_select_ctx_append_sheet(css_select_ctx *ctx,
/**
* Insert a stylesheet into a selection context
- *
+ *
* \param ctx The context to insert into
* \param sheet Sheet to insert
* \param index Index in context to insert sheet
@@ -344,7 +344,7 @@ css_error css_select_ctx_insert_sheet(css_select_ctx *ctx,
if (index > ctx->n_sheets)
return CSS_INVALID;
- temp = realloc(ctx->sheets,
+ temp = realloc(ctx->sheets,
(ctx->n_sheets + 1) * sizeof(css_select_sheet));
if (temp == NULL)
return CSS_NOMEM;
@@ -1245,7 +1245,7 @@ css_error css_select_style(css_select_ctx *ctx, void *node,
if ((s.media & media) != 0 &&
s.sheet->disabled == false) {
- error = select_from_sheet(ctx, s.sheet,
+ error = select_from_sheet(ctx, s.sheet,
s.origin, &state);
if (error != CSS_OK)
goto cleanup;
@@ -1254,12 +1254,12 @@ css_error css_select_style(css_select_ctx *ctx, void *node,
/* Consider any inline style for the node */
if (inline_style != NULL) {
- css_rule_selector *sel =
+ css_rule_selector *sel =
(css_rule_selector *) inline_style->rule_list;
/* Sanity check style */
if (inline_style->rule_count != 1 ||
- inline_style->rule_list->type != CSS_RULE_SELECTOR ||
+ inline_style->rule_list->type != CSS_RULE_SELECTOR ||
inline_style->rule_list->items != 0) {
error = CSS_INVALID;
goto cleanup;
@@ -1284,16 +1284,16 @@ css_error css_select_style(css_select_ctx *ctx, void *node,
state.current_pseudo = CSS_PSEUDO_ELEMENT_NONE;
state.computed = state.results->styles[CSS_PSEUDO_ELEMENT_NONE];
for (i = 0; i < CSS_N_PROPERTIES; i++) {
- const prop_state *prop =
+ const prop_state *prop =
&state.props[i][CSS_PSEUDO_ELEMENT_NONE];
- /* If the property is still unset or it's set to inherit
- * and we're the root element, then set it to its initial
+ /* If the property is still unset or it's set to inherit
+ * and we're the root element, then set it to its initial
* value. */
- if (prop->set == false ||
- (parent == NULL &&
+ if (prop->set == false ||
+ (parent == NULL &&
prop->inherit == true)) {
- error = set_initial(&state, i,
+ error = set_initial(&state, i,
CSS_PSEUDO_ELEMENT_NONE, parent);
if (error != CSS_OK)
goto cleanup;
@@ -1312,7 +1312,7 @@ css_error css_select_style(css_select_ctx *ctx, void *node,
for (i = 0; i < CSS_N_PROPERTIES; i++) {
const prop_state *prop = &state.props[i][j];
- /* If the property is still unset then set it
+ /* If the property is still unset then set it
* to its initial value. */
if (prop->set == false) {
error = set_initial(&state, i, j, parent);
@@ -1323,8 +1323,8 @@ css_error css_select_style(css_select_ctx *ctx, void *node,
}
/* If this is the root element, then we must ensure that all
- * length values are absolute, display and float are correctly
- * computed, and the default border-{top,right,bottom,left}-color
+ * length values are absolute, display and float are correctly
+ * computed, and the default border-{top,right,bottom,left}-color
* is set to the computed value of color. */
if (parent == NULL) {
/* Only compute absolute values for the base element */
@@ -1406,20 +1406,20 @@ css_error css_select_font_faces(css_select_ctx *ctx,
css_error error;
css_select_font_faces_state state;
uint32_t n_font_faces;
-
+
if (ctx == NULL || font_family == NULL || result == NULL)
return CSS_BADPARM;
memset(&state, 0, sizeof(css_select_font_faces_state));
state.font_family = font_family;
state.media = media;
-
+
/* Iterate through the top-level stylesheets, selecting font-faces
* from those which apply to our current media requirements and
* are not disabled */
for (i = 0; i < ctx->n_sheets; i++) {
const css_select_sheet s = ctx->sheets[i];
-
+
if ((s.media & media) != 0 &&
s.sheet->disabled == false) {
error = select_font_faces_from_sheet(s.sheet,
@@ -1428,23 +1428,23 @@ css_error css_select_font_faces(css_select_ctx *ctx,
goto cleanup;
}
}
-
- n_font_faces = state.ua_font_faces.count +
+
+ n_font_faces = state.ua_font_faces.count +
state.user_font_faces.count +
state.author_font_faces.count;
-
-
+
+
if (n_font_faces > 0) {
/* We found some matching faces. Make a results structure with
* the font faces in priority order. */
css_select_font_faces_results *results;
-
+
results = malloc(sizeof(css_select_font_faces_results));
if (results == NULL) {
error = CSS_NOMEM;
goto cleanup;
}
-
+
results->font_faces = malloc(
n_font_faces * sizeof(css_font_face *));
if (results->font_faces == NULL) {
@@ -1454,47 +1454,47 @@ css_error css_select_font_faces(css_select_ctx *ctx,
}
results->n_font_faces = n_font_faces;
-
+
i = 0;
if (state.ua_font_faces.count != 0) {
- memcpy(results->font_faces,
+ memcpy(results->font_faces,
state.ua_font_faces.font_faces,
- sizeof(css_font_face *) *
+ sizeof(css_font_face *) *
state.ua_font_faces.count);
-
+
i += state.ua_font_faces.count;
}
-
+
if (state.user_font_faces.count != 0) {
- memcpy(results->font_faces + i,
+ memcpy(results->font_faces + i,
state.user_font_faces.font_faces,
- sizeof(css_font_face *) *
+ sizeof(css_font_face *) *
state.user_font_faces.count);
i += state.user_font_faces.count;
}
-
+
if (state.author_font_faces.count != 0) {
- memcpy(results->font_faces + i,
+ memcpy(results->font_faces + i,
state.author_font_faces.font_faces,
- sizeof(css_font_face *) *
+ sizeof(css_font_face *) *
state.author_font_faces.count);
}
*result = results;
}
-
+
error = CSS_OK;
-
+
cleanup:
- if (state.ua_font_faces.count != 0)
+ if (state.ua_font_faces.count != 0)
free(state.ua_font_faces.font_faces);
- if (state.user_font_faces.count != 0)
+ if (state.user_font_faces.count != 0)
free(state.user_font_faces.font_faces);
-
- if (state.author_font_faces.count != 0)
+
+ if (state.author_font_faces.count != 0)
free(state.author_font_faces.font_faces);
-
+
return error;
}
@@ -1509,15 +1509,15 @@ css_error css_select_font_faces_results_destroy(
{
if (results == NULL)
return CSS_BADPARM;
-
+
if (results->font_faces != NULL) {
/* Don't destroy the individual css_font_faces, they're owned
by their respective sheets */
free(results->font_faces);
}
-
+
free(results);
-
+
return CSS_OK;
}
@@ -1536,37 +1536,37 @@ css_error intern_strings(css_select_ctx *ctx)
/* Pseudo classes */
error = lwc_intern_string(
- "first-child", SLEN("first-child"),
+ "first-child", SLEN("first-child"),
&ctx->first_child);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
error = lwc_intern_string(
- "link", SLEN("link"),
+ "link", SLEN("link"),
&ctx->link);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
error = lwc_intern_string(
- "visited", SLEN("visited"),
+ "visited", SLEN("visited"),
&ctx->visited);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
error = lwc_intern_string(
- "hover", SLEN("hover"),
+ "hover", SLEN("hover"),
&ctx->hover);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
error = lwc_intern_string(
- "active", SLEN("active"),
+ "active", SLEN("active"),
&ctx->active);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
error = lwc_intern_string(
- "focus", SLEN("focus"),
+ "focus", SLEN("focus"),
&ctx->focus);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
@@ -1669,7 +1669,7 @@ css_error intern_strings(css_select_ctx *ctx)
/* Pseudo elements */
error = lwc_intern_string(
- "first-line", SLEN("first-line"),
+ "first-line", SLEN("first-line"),
&ctx->first_line);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
@@ -1681,13 +1681,13 @@ css_error intern_strings(css_select_ctx *ctx)
return css_error_from_lwc_error(error);
error = lwc_intern_string(
- "before", SLEN("before"),
+ "before", SLEN("before"),
&ctx->before);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
error = lwc_intern_string(
- "after", SLEN("after"),
+ "after", SLEN("after"),
&ctx->after);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
@@ -1774,29 +1774,29 @@ css_error set_hint(css_select_state *state, css_hint *hint)
return CSS_OK;
}
-css_error set_initial(css_select_state *state,
+css_error set_initial(css_select_state *state,
uint32_t prop, css_pseudo_element pseudo,
void *parent)
{
css_error error;
- /* Do nothing if this property is inherited (the default state
+ /* Do nothing if this property is inherited (the default state
* of a clean computed style is for everything to be set to inherit)
*
- * If the node is tree root and we're dealing with the base element,
+ * If the node is tree root and we're dealing with the base element,
* everything should be defaulted.
*/
- if (prop_dispatch[prop].inherited == false ||
+ if (prop_dispatch[prop].inherited == false ||
(pseudo == CSS_PSEUDO_ELEMENT_NONE && parent == NULL)) {
enum prop_group group = prop_dispatch[prop].group;
- /* Remaining properties are neither inherited nor
- * already set. Thus, we set them to their initial
- * values here. Except, however, if the property in
- * question resides in one of the extension blocks and
- * the extension block has yet to be allocated. In that
- * case, we do nothing and leave it to the property
- * accessors to return the initial values for the
+ /* Remaining properties are neither inherited nor
+ * already set. Thus, we set them to their initial
+ * values here. Except, however, if the property in
+ * question resides in one of the extension blocks and
+ * the extension block has yet to be allocated. In that
+ * case, we do nothing and leave it to the property
+ * accessors to return the initial values for the
* property.
*/
switch (group) {
@@ -1825,7 +1825,7 @@ css_error set_initial(css_select_state *state,
#define IMPORT_STACK_SIZE 256
-css_error select_from_sheet(css_select_ctx *ctx, const css_stylesheet *sheet,
+css_error select_from_sheet(css_select_ctx *ctx, const css_stylesheet *sheet,
css_origin origin, css_select_state *state)
{
const css_stylesheet *s = sheet;
@@ -1842,7 +1842,7 @@ css_error select_from_sheet(css_select_ctx *ctx, const css_stylesheet *sheet,
if (rule != NULL && rule->type == CSS_RULE_IMPORT) {
/* Current rule is an import */
- const css_rule_import *import =
+ const css_rule_import *import =
(const css_rule_import *) rule;
if (import->sheet != NULL &&
@@ -1893,7 +1893,7 @@ static inline bool _rule_applies_to_media(const css_rule *rule, uint64_t media)
while (ancestor != NULL) {
const css_rule_media *m = (const css_rule_media *) ancestor;
- if (ancestor->type == CSS_RULE_MEDIA &&
+ if (ancestor->type == CSS_RULE_MEDIA &&
(m->media & media) == 0) {
applies = false;
break;
@@ -1917,7 +1917,7 @@ static css_error _select_font_face_from_rule(
if (lwc_string_isequal(
rule->font_face->font_family,
- state->font_family,
+ state->font_family,
&correct_family) == lwc_error_ok &&
correct_family) {
css_select_font_faces_list *faces = NULL;
@@ -1936,16 +1936,16 @@ static css_error _select_font_face_from_rule(
faces = &state->author_font_faces;
break;
}
-
- index = faces->count++;
+
+ index = faces->count++;
new_size = faces->count * sizeof(css_font_face *);
-
+
new_faces = realloc(faces->font_faces, new_size);
if (new_faces == NULL) {
return CSS_NOMEM;
}
faces->font_faces = new_faces;
-
+
faces->font_faces[index] = rule->font_face;
}
}
@@ -1954,35 +1954,35 @@ static css_error _select_font_face_from_rule(
}
static css_error select_font_faces_from_sheet(
- const css_stylesheet *sheet,
- css_origin origin,
+ const css_stylesheet *sheet,
+ css_origin origin,
css_select_font_faces_state *state)
{
const css_stylesheet *s = sheet;
const css_rule *rule = s->rule_list;
uint32_t sp = 0;
const css_rule *import_stack[IMPORT_STACK_SIZE];
-
+
do {
/* Find first non-charset rule, if we're at the list head */
if (rule == s->rule_list) {
while (rule != NULL && rule->type == CSS_RULE_CHARSET)
rule = rule->next;
}
-
+
if (rule != NULL && rule->type == CSS_RULE_IMPORT) {
/* Current rule is an import */
- const css_rule_import *import =
+ const css_rule_import *import =
(const css_rule_import *) rule;
-
+
if (import->sheet != NULL &&
(import->media & state->media) != 0) {
/* It's applicable, so process it */
if (sp >= IMPORT_STACK_SIZE)
return CSS_NOMEM;
-
+
import_stack[sp++] = rule;
-
+
s = import->sheet;
rule = s->rule_list;
} else {
@@ -1991,15 +1991,15 @@ static css_error select_font_faces_from_sheet(
}
} else if (rule != NULL && rule->type == CSS_RULE_FONT_FACE) {
css_error error;
-
+
error = _select_font_face_from_rule(
(const css_rule_font_face *) rule,
origin,
state);
-
+
if (error != CSS_OK)
return error;
-
+
rule = rule->next;
} else if (rule == NULL) {
/* Find next sheet to process */
@@ -2014,7 +2014,7 @@ static css_error select_font_faces_from_sheet(
rule = rule->next;
}
} while (s != NULL);
-
+
return CSS_OK;
}
@@ -2039,7 +2039,7 @@ static inline bool _selectors_pending(const css_selector **node,
return pending;
}
-static inline bool _selector_less_specific(const css_selector *ref,
+static inline bool _selector_less_specific(const css_selector *ref,
const css_selector *cand)
{
bool result = true;
@@ -2103,7 +2103,7 @@ static const css_selector *_selector_next(const css_selector **node,
return ret;
}
-css_error match_selectors_in_sheet(css_select_ctx *ctx,
+css_error match_selectors_in_sheet(css_select_ctx *ctx,
const css_stylesheet *sheet, css_select_state *state)
{
static const css_selector *empty_selector = NULL;
@@ -2128,7 +2128,7 @@ css_error match_selectors_in_sheet(css_select_ctx *ctx,
/* Find hash chain that applies to current node */
req.qname = state->element;
- error = css__selector_hash_find(sheet->selectors,
+ error = css__selector_hash_find(sheet->selectors,
&req, &node_iterator,
&node_selectors);
if (error != CSS_OK)
@@ -2155,7 +2155,7 @@ css_error match_selectors_in_sheet(css_select_ctx *ctx,
if (state->id != NULL) {
/* Find hash chain for node ID */
req.id = state->id;
- error = css__selector_hash_find_by_id(sheet->selectors,
+ error = css__selector_hash_find_by_id(sheet->selectors,
&req, &id_iterator, &id_selectors);
if (error != CSS_OK)
goto cleanup;
@@ -2168,7 +2168,7 @@ css_error match_selectors_in_sheet(css_select_ctx *ctx,
goto cleanup;
/* Process matching selectors, if any */
- while (_selectors_pending(node_selectors, id_selectors,
+ while (_selectors_pending(node_selectors, id_selectors,
class_selectors, n_classes, univ_selectors)) {
const css_selector *selector;
@@ -2190,7 +2190,7 @@ css_error match_selectors_in_sheet(css_select_ctx *ctx,
if (error != CSS_OK)
goto cleanup;
- /* Advance to next selector in whichever chain we extracted
+ /* Advance to next selector in whichever chain we extracted
* the processed selector from. */
switch (src.source) {
case CSS_SELECT_RULE_SRC_ELEMENT:
@@ -2227,7 +2227,7 @@ cleanup:
return error;
}
-static void update_reject_cache(css_select_state *state,
+static void update_reject_cache(css_select_state *state,
css_combinator comb, const css_selector *s)
{
const css_selector_detail *detail = &s->data;
@@ -2250,7 +2250,7 @@ static void update_reject_cache(css_select_state *state,
state->next_reject--;
}
-css_error match_selector_chain(css_select_ctx *ctx,
+css_error match_selector_chain(css_select_ctx *ctx,
const css_selector *selector, css_select_state *state)
{
const css_selector *s = selector;
@@ -2267,11 +2267,11 @@ css_error match_selector_chain(css_select_ctx *ctx,
fprintf(stderr, "\n");
#endif
- /* Match the details of the first selector in the chain.
+ /* Match the details of the first selector in the chain.
*
* Note that pseudo elements will only appear as details of
* the first selector in the chain, as the parser will reject
- * any selector chains containing pseudo elements anywhere
+ * any selector chains containing pseudo elements anywhere
* else.
*/
error = match_details(ctx, node, detail, state, &match, &pseudo);
@@ -2288,14 +2288,14 @@ css_error match_selector_chain(css_select_ctx *ctx,
/* Consider any combinator on this selector */
if (s->data.comb != CSS_COMBINATOR_NONE &&
- s->combinator->data.qname.name !=
+ s->combinator->data.qname.name !=
ctx->universal) {
/* Named combinator */
- may_optimise &=
- (s->data.comb == CSS_COMBINATOR_ANCESTOR ||
+ may_optimise &=
+ (s->data.comb == CSS_COMBINATOR_ANCESTOR ||
s->data.comb == CSS_COMBINATOR_PARENT);
- error = match_named_combinator(ctx, s->data.comb,
+ error = match_named_combinator(ctx, s->data.comb,
s->combinator, state, node, &next_node);
if (error != CSS_OK)
return error;
@@ -2305,12 +2305,12 @@ css_error match_selector_chain(css_select_ctx *ctx,
return CSS_OK;
} else if (s->data.comb != CSS_COMBINATOR_NONE) {
/* Universal combinator */
- may_optimise &=
- (s->data.comb == CSS_COMBINATOR_ANCESTOR ||
+ may_optimise &=
+ (s->data.comb == CSS_COMBINATOR_ANCESTOR ||
s->data.comb == CSS_COMBINATOR_PARENT);
- error = match_universal_combinator(ctx, s->data.comb,
- s->combinator, state, node,
+ error = match_universal_combinator(ctx, s->data.comb,
+ s->combinator, state, node,
may_optimise, &rejected_by_cache,
&next_node);
if (error != CSS_OK)
@@ -2339,7 +2339,7 @@ css_error match_selector_chain(css_select_ctx *ctx,
/* Ensure that the appropriate computed style exists */
if (state->results->styles[pseudo] == NULL) {
error = css__computed_style_create(
- &state->results->styles[pseudo]);
+ &state->results->styles[pseudo]);
if (error != CSS_OK)
return error;
}
@@ -2347,12 +2347,12 @@ css_error match_selector_chain(css_select_ctx *ctx,
state->current_pseudo = pseudo;
state->computed = state->results->styles[pseudo];
- return cascade_style(((css_rule_selector *) selector->rule)->style,
+ return cascade_style(((css_rule_selector *) selector->rule)->style,
state);
}
css_error match_named_combinator(css_select_ctx *ctx, css_combinator type,
- const css_selector *selector, css_select_state *state,
+ const css_selector *selector, css_select_state *state,
void *node, void **next_node)
{
const css_selector_detail *detail = &selector->data;
@@ -2365,19 +2365,19 @@ css_error match_named_combinator(css_select_ctx *ctx, css_combinator type,
/* Find candidate node */
switch (type) {
case CSS_COMBINATOR_ANCESTOR:
- error = state->handler->named_ancestor_node(state->pw,
+ error = state->handler->named_ancestor_node(state->pw,
n, &selector->data.qname, &n);
if (error != CSS_OK)
return error;
break;
case CSS_COMBINATOR_PARENT:
- error = state->handler->named_parent_node(state->pw,
+ error = state->handler->named_parent_node(state->pw,
n, &selector->data.qname, &n);
if (error != CSS_OK)
return error;
break;
case CSS_COMBINATOR_SIBLING:
- error = state->handler->named_sibling_node(state->pw,
+ error = state->handler->named_sibling_node(state->pw,
n, &selector->data.qname, &n);
if (error != CSS_OK)
return error;
@@ -2402,7 +2402,7 @@ css_error match_named_combinator(css_select_ctx *ctx, css_combinator type,
if (n != NULL) {
/* Match its details */
- error = match_details(ctx, n, detail, state,
+ error = match_details(ctx, n, detail, state,
&match, NULL);
if (error != CSS_OK)
return error;
@@ -2411,8 +2411,8 @@ css_error match_named_combinator(css_select_ctx *ctx, css_combinator type,
if (match == true)
break;
- /* For parent and sibling selectors, only adjacent
- * nodes are valid. Thus, if we failed to match,
+ /* For parent and sibling selectors, only adjacent
+ * nodes are valid. Thus, if we failed to match,
* give up. */
if (type == CSS_COMBINATOR_PARENT ||
type == CSS_COMBINATOR_SIBLING)
@@ -2453,10 +2453,10 @@ css_error match_universal_combinator(css_select_ctx *ctx, css_combinator type,
*rejected_by_cache = false;
/* Consult reject cache first */
- if (may_optimise && (type == CSS_COMBINATOR_ANCESTOR ||
- type == CSS_COMBINATOR_PARENT) &&
+ if (may_optimise && (type == CSS_COMBINATOR_ANCESTOR ||
+ type == CSS_COMBINATOR_PARENT) &&
next_detail != NULL &&
- (next_detail->type == CSS_SELECTOR_CLASS ||
+ (next_detail->type == CSS_SELECTOR_CLASS ||
next_detail->type == CSS_SELECTOR_ID)) {
reject_item *reject = state->next_reject + 1;
reject_item *last = state->reject_cache +
@@ -2466,8 +2466,8 @@ css_error match_universal_combinator(css_select_ctx *ctx, css_combinator type,
while (reject <= last) {
/* Perform pessimistic matching (may hurt quirks) */
if (reject->type == next_detail->type &&
- lwc_string_isequal(reject->value,
- next_detail->qname.name,
+ lwc_string_isequal(reject->value,
+ next_detail->qname.name,
&match) == lwc_error_ok &&
match) {
/* Found it: can't match */
@@ -2505,7 +2505,7 @@ css_error match_universal_combinator(css_select_ctx *ctx, css_combinator type,
if (n != NULL) {
/* Match its details */
- error = match_details(ctx, n, detail, state,
+ error = match_details(ctx, n, detail, state,
&match, NULL);
if (error != CSS_OK)
return error;
@@ -2528,8 +2528,8 @@ css_error match_universal_combinator(css_select_ctx *ctx, css_combinator type,
return CSS_OK;
}
-css_error match_details(css_select_ctx *ctx, void *node,
- const css_selector_detail *detail, css_select_state *state,
+css_error match_details(css_select_ctx *ctx, void *node,
+ const css_selector_detail *detail, css_select_state *state,
bool *match, css_pseudo_element *pseudo_element)
{
css_error error;
@@ -2547,10 +2547,10 @@ css_error match_details(css_select_ctx *ctx, void *node,
* selector, then we must match) */
*match = true;
- /** \todo Some details are easier to test than others (e.g. dashmatch
- * actually requires looking at data rather than simply comparing
- * pointers). Should we consider sorting the detail list such that the
- * simpler details come first (and thus the expensive match routines
+ /** \todo Some details are easier to test than others (e.g. dashmatch
+ * actually requires looking at data rather than simply comparing
+ * pointers). Should we consider sorting the detail list such that the
+ * simpler details come first (and thus the expensive match routines
* can be avoided unless absolutely necessary)? */
while (detail != NULL) {
@@ -2592,8 +2592,8 @@ static inline bool match_nth(int32_t a, int32_t b, int32_t count)
}
}
-css_error match_detail(css_select_ctx *ctx, void *node,
- const css_selector_detail *detail, css_select_state *state,
+css_error match_detail(css_select_ctx *ctx, void *node,
+ const css_selector_detail *detail, css_select_state *state,
bool *match, css_pseudo_element *pseudo_element)
{
bool is_root = false;
@@ -2623,19 +2623,19 @@ css_error match_detail(css_select_ctx *ctx, void *node,
if (error != CSS_OK)
return error;
- if (is_root == false &&
+ if (is_root == false &&
detail->qname.name == ctx->first_child) {
int32_t num_before = 0;
- error = state->handler->node_count_siblings(state->pw,
+ error = state->handler->node_count_siblings(state->pw,
node, false, false, &num_before);
if (error == CSS_OK)
*match = (num_before == 0);
- } else if (is_root == false &&
+ } else if (is_root == false &&
detail->qname.name == ctx->nth_child) {
int32_t num_before = 0;
- error = state->handler->node_count_siblings(state->pw,
+ error = state->handler->node_count_siblings(state->pw,
node, false, false, &num_before);
if (error == CSS_OK) {
int32_t a = detail->value.nth.a;
@@ -2643,11 +2643,11 @@ css_error match_detail(css_select_ctx *ctx, void *node,
*match = match_nth(a, b, num_before + 1);
}
- } else if (is_root == false &&
+ } else if (is_root == false &&
detail->qname.name == ctx->nth_last_child) {
int32_t num_after = 0;
- error = state->handler->node_count_siblings(state->pw,
+ error = state->handler->node_count_siblings(state->pw,
node, false, true, &num_after);
if (error == CSS_OK) {
int32_t a = detail->value.nth.a;
@@ -2655,11 +2655,11 @@ css_error match_detail(css_select_ctx *ctx, void *node,
*match = match_nth(a, b, num_after + 1);
}
- } else if (is_root == false &&
+ } else if (is_root == false &&
detail->qname.name == ctx->nth_of_type) {
int32_t num_before = 0;
- error = state->handler->node_count_siblings(state->pw,
+ error = state->handler->node_count_siblings(state->pw,
node, true, false, &num_before);
if (error == CSS_OK) {
int32_t a = detail->value.nth.a;
@@ -2667,11 +2667,11 @@ css_error match_detail(css_select_ctx *ctx, void *node,
*match = match_nth(a, b, num_before + 1);
}
- } else if (is_root == false &&
+ } else if (is_root == false &&
detail->qname.name == ctx->nth_last_of_type) {
int32_t num_after = 0;
- error = state->handler->node_count_siblings(state->pw,
+ error = state->handler->node_count_siblings(state->pw,
node, true, true, &num_after);
if (error == CSS_OK) {
int32_t a = detail->value.nth.a;
@@ -2691,7 +2691,7 @@ css_error match_detail(css_select_ctx *ctx, void *node,
detail->qname.name == ctx->first_of_type) {
int32_t num_before = 0;
- error = state->handler->node_count_siblings(state->pw,
+ error = state->handler->node_count_siblings(state->pw,
node, true, false, &num_before);
if (error == CSS_OK)
*match = (num_before == 0);
@@ -2699,36 +2699,36 @@ css_error match_detail(css_select_ctx *ctx, void *node,
detail->qname.name == ctx->last_of_type) {
int32_t num_after = 0;
- error = state->handler->node_count_siblings(state->pw,
+ error = state->handler->node_count_siblings(state->pw,
node, true, true, &num_after);
if (error == CSS_OK)
*match = (num_after == 0);
- } else if (is_root == false &&
+ } else if (is_root == false &&
detail->qname.name == ctx->only_child) {
int32_t num_before = 0, num_after = 0;
- error = state->handler->node_count_siblings(state->pw,
+ error = state->handler->node_count_siblings(state->pw,
node, false, false, &num_before);
if (error == CSS_OK) {
error = state->handler->node_count_siblings(
state->pw, node, false, true,
&num_after);
if (error == CSS_OK)
- *match = (num_before == 0) &&
+ *match = (num_before == 0) &&
(num_after == 0);
}
- } else if (is_root == false &&
+ } else if (is_root == false &&
detail->qname.name == ctx->only_of_type) {
int32_t num_before = 0, num_after = 0;
- error = state->handler->node_count_siblings(state->pw,
+ error = state->handler->node_count_siblings(state->pw,
node, true, false, &num_before);
if (error == CSS_OK) {
error = state->handler->node_count_siblings(
state->pw, node, true, true,
&num_after);
if (error == CSS_OK)
- *match = (num_before == 0) &&
+ *match = (num_before == 0) &&
(num_after == 0);
}
} else if (detail->qname.name == ctx->root) {
@@ -2796,8 +2796,8 @@ css_error match_detail(css_select_ctx *ctx, void *node,
add_node_flags(node, state, CSS_NODE_FLAGS_TAINT_ATTRIBUTE);
break;
case CSS_SELECTOR_ATTRIBUTE_EQUAL:
- error = state->handler->node_has_attribute_equal(state->pw,
- node, &detail->qname, detail->value.string,
+ error = state->handler->node_has_attribute_equal(state->pw,
+ node, &detail->qname, detail->value.string,
match);
add_node_flags(node, state, CSS_NODE_FLAGS_TAINT_ATTRIBUTE);
break;
@@ -2808,7 +2808,7 @@ css_error match_detail(css_select_ctx *ctx, void *node,
add_node_flags(node, state, CSS_NODE_FLAGS_TAINT_ATTRIBUTE);
break;
case CSS_SELECTOR_ATTRIBUTE_INCLUDES:
- error = state->handler->node_has_attribute_includes(state->pw,
+ error = state->handler->node_has_attribute_includes(state->pw,
node, &detail->qname, detail->value.string,
match);
add_node_flags(node, state, CSS_NODE_FLAGS_TAINT_ATTRIBUTE);
@@ -2868,7 +2868,7 @@ bool css__outranks_existing(uint16_t op, bool important, css_select_state *state
bool outranks = false;
/* Sorting on origin & importance gives the following:
- *
+ *
* | UA, - | UA, i | USER, - | USER, i | AUTHOR, - | AUTHOR, i
* |----------------------------------------------------------
* UA , - | S S Y Y Y Y
@@ -2878,8 +2878,8 @@ bool css__outranks_existing(uint16_t op, bool important, css_select_state *state
* AUTHOR, - | - - - Y S Y
* AUTHOR, i | - - - Y - S
*
- * Where the columns represent the origin/importance of the property
- * being considered and the rows represent the origin/importance of
+ * Where the columns represent the origin/importance of the property
+ * being considered and the rows represent the origin/importance of
* the existing property.
*
* - means that the existing property must be preserved
@@ -2893,12 +2893,12 @@ bool css__outranks_existing(uint16_t op, bool important, css_select_state *state
* the specificities are the same because:
*
* a) We process stylesheets in order
- * b) The selector hash chains within a sheet are ordered such that
+ * b) The selector hash chains within a sheet are ordered such that
* more specific rules come after less specific ones and, when
* specificities are identical, rules defined later occur after
* those defined earlier.
*
- * Therefore, where we consider specificity, below, the property
+ * Therefore, where we consider specificity, below, the property
* currently being considered will always be applied if its specificity
* is greater than or equal to that of the existing property.
*/
@@ -2912,15 +2912,15 @@ bool css__outranks_existing(uint16_t op, bool important, css_select_state *state
if (existing->origin < state->current_origin) {
/* New origin has more weight than existing one.
- * Thus, new property wins, except when the existing
+ * Thus, new property wins, except when the existing
* one is USER, i. */
if (existing->important == 0 ||
existing->origin != CSS_ORIGIN_USER) {
outranks = true;
}
} else if (existing->origin == state->current_origin) {
- /* Origins are identical, consider importance, except
- * for UA stylesheets, when specificity is always
+ /* Origins are identical, consider importance, except
+ * for UA stylesheets, when specificity is always
* considered (as importance is meaningless) */
if (existing->origin == CSS_ORIGIN_UA) {
if (state->current_specificity >=
@@ -2984,7 +2984,7 @@ void dump_chain(const css_selector *selector)
do {
switch (detail->type) {
case CSS_SELECTOR_ELEMENT:
- if (lwc_string_length(detail->name) == 1 &&
+ if (lwc_string_length(detail->name) == 1 &&
lwc_string_data(detail->name)[0] == '*' &&
detail->next == 1) {
break;
diff --git a/src/stylesheet.c b/src/stylesheet.c
index 0a281e7..7c6728b 100644
--- a/src/stylesheet.c
+++ b/src/stylesheet.c
@@ -39,33 +39,33 @@ css_error css__stylesheet_string_add(css_stylesheet *sheet, lwc_string *string,
uint32_t new_string_number; /* The string number count */
/* search for the string in the existing vector */
- for (new_string_number = 0;
+ for (new_string_number = 0;
new_string_number < sheet->string_vector_c;
new_string_number++) {
lwc_error res;
bool isequal;
- res = lwc_string_isequal(string,
- sheet->string_vector[new_string_number],
+ res = lwc_string_isequal(string,
+ sheet->string_vector[new_string_number],
&isequal);
if (res != lwc_error_ok) {
- lwc_string_unref(string);
+ lwc_string_unref(string);
return css_error_from_lwc_error(res);
}
if (isequal) {
- lwc_string_unref(string);
+ lwc_string_unref(string);
*string_number = (new_string_number + 1);
return CSS_OK;
}
-
+
}
/* string does not exist in current vector, add a new one */
if (sheet->string_vector_c >= sheet->string_vector_l) {
/* additional storage must be allocated to deal with
- * this request.
+ * this request.
*/
lwc_string **new_vector;
uint32_t new_vector_len;
@@ -75,7 +75,7 @@ css_error css__stylesheet_string_add(css_stylesheet *sheet, lwc_string *string,
new_vector_len * sizeof(lwc_string *));
if (new_vector == NULL) {
- lwc_string_unref(string);
+ lwc_string_unref(string);
return CSS_NOMEM;
}
sheet->string_vector = new_vector;
@@ -128,7 +128,7 @@ css_error css_stylesheet_create(const css_stylesheet_params *params,
css_error error;
css_stylesheet *sheet;
- if (params == NULL || params->params_version !=
+ if (params == NULL || params->params_version !=
CSS_STYLESHEET_PARAMS_VERSION_1 ||
params->url == NULL || params->resolve == NULL ||
stylesheet == NULL)
@@ -143,11 +143,11 @@ css_error css_stylesheet_create(const css_stylesheet_params *params,
free(sheet);
return error;
}
-
+
sheet->inline_style = params->inline_style;
if (params->inline_style) {
- error = css__parser_create_for_inline_style(params->charset,
+ error = css__parser_create_for_inline_style(params->charset,
(params->charset != NULL) ?
CSS_CHARSET_DICTATED : CSS_CHARSET_DEFAULT,
&sheet->parser);
@@ -255,12 +255,12 @@ css_error css_stylesheet_destroy(css_stylesheet *sheet)
if (sheet == NULL)
return CSS_BADPARM;
-
+
if (sheet->title != NULL)
free(sheet->title);
free(sheet->url);
-
+
for (r = sheet->rule_list; r != NULL; r = s) {
s = r->next;
@@ -286,14 +286,14 @@ css_error css_stylesheet_destroy(css_stylesheet *sheet)
/* destroy string vector */
for (index = 0; index < sheet->string_vector_c; index++) {
- lwc_string_unref(sheet->string_vector[index]);
+ lwc_string_unref(sheet->string_vector[index]);
}
if (sheet->string_vector != NULL)
free(sheet->string_vector);
css__propstrings_unref();
-
+
free(sheet);
return CSS_OK;
@@ -348,7 +348,7 @@ css_error css_stylesheet_data_done(css_stylesheet *sheet)
sheet->parser_frontend = NULL;
sheet->parser = NULL;
-
+
/* If we have a cached style, drop it as we're done parsing. */
if (sheet->cached_style != NULL) {
css__stylesheet_style_destroy(sheet->cached_style);
@@ -375,7 +375,7 @@ css_error css_stylesheet_data_done(css_stylesheet *sheet)
* Retrieve the next pending import for the parent stylesheet
*
* \param parent Parent stylesheet
- * \param url Pointer to object to be populated with details of URL of
+ * \param url Pointer to object to be populated with details of URL of
* imported stylesheet (potentially relative)
* \param media Pointer to location to receive applicable media types for
* imported sheet,
@@ -427,7 +427,7 @@ css_error css_stylesheet_next_pending_import(css_stylesheet *parent,
*
* \param parent Parent stylesheet
* \param import Imported sheet
- * \return CSS_OK on success,
+ * \return CSS_OK on success,
* CSS_INVALID if there are no outstanding imports,
* appropriate error otherwise.
*
@@ -612,7 +612,7 @@ css_error css_stylesheet_size(css_stylesheet *sheet, size_t *size)
bytes += hash_size;
}
-
+
*size = bytes;
return CSS_OK;
@@ -643,13 +643,13 @@ css_error css__stylesheet_style_create(css_stylesheet *sheet, css_style **style)
if (sheet == NULL)
return CSS_BADPARM;
-
+
if (sheet->cached_style != NULL) {
*style = sheet->cached_style;
sheet->cached_style = NULL;
return CSS_OK;
}
-
+
s = malloc(sizeof(css_style));
if (s == NULL)
return CSS_NOMEM;
@@ -658,7 +658,7 @@ css_error css__stylesheet_style_create(css_stylesheet *sheet, css_style **style)
if (s->bytecode == NULL) {
free(s); /* do not leak */
-
+
return CSS_NOMEM;
}
s->allocated = CSS_STYLE_DEFAULT_SIZE;
@@ -679,7 +679,7 @@ css_error css__stylesheet_merge_style(css_style *target, css_style *style)
return CSS_BADPARM;
newcode_len = target->used + style->used ;
-
+
if (newcode_len > target->allocated) {
newcode_len += CSS_STYLE_DEFAULT_SIZE - 1;
newcode_len &= ~(CSS_STYLE_DEFAULT_SIZE - 1);
@@ -702,7 +702,7 @@ css_error css__stylesheet_merge_style(css_style *target, css_style *style)
}
-/** append one or more css code entries to a style */
+/** append one or more css code entries to a style */
css_error css__stylesheet_style_vappend(css_style *style, uint32_t style_count, ...)
{
va_list ap;
@@ -721,7 +721,7 @@ css_error css__stylesheet_style_vappend(css_style *style, uint32_t style_count,
return error;
}
-/** append a css code entry to a style */
+/** append a css code entry to a style */
css_error css__stylesheet_style_append(css_style *style, css_code_t css_code)
{
if (style == NULL)
@@ -755,7 +755,7 @@ css_error css__stylesheet_style_append(css_style *style, css_code_t css_code)
css_error css__stylesheet_style_destroy(css_style *style)
{
css_stylesheet *sheet;
-
+
if (style == NULL)
return CSS_BADPARM;
@@ -773,7 +773,7 @@ css_error css__stylesheet_style_destroy(css_style *style)
free(style->bytecode);
free(style);
}
-
+
return CSS_OK;
}
@@ -792,7 +792,7 @@ css_error css__stylesheet_selector_create(css_stylesheet *sheet,
{
css_selector *sel;
- if (sheet == NULL || qname == NULL || qname->name == NULL ||
+ if (sheet == NULL || qname == NULL || qname->name == NULL ||
selector == NULL)
return CSS_BADPARM;
@@ -815,7 +815,7 @@ css_error css__stylesheet_selector_create(css_stylesheet *sheet,
sel->specificity = CSS_SPECIFICITY_A;
} else {
/* Initial specificity -- 1 for an element, 0 for universal */
- if (lwc_string_length(qname->name) != 1 ||
+ if (lwc_string_length(qname->name) != 1 ||
lwc_string_data(qname->name)[0] != '*')
sel->specificity = CSS_SPECIFICITY_D;
else
@@ -857,8 +857,8 @@ css_error css__stylesheet_selector_destroy(css_stylesheet *sheet,
lwc_string_unref(detail->qname.ns);
lwc_string_unref(detail->qname.name);
- if (detail->value_type ==
- CSS_SELECTOR_DETAIL_VALUE_STRING &&
+ if (detail->value_type ==
+ CSS_SELECTOR_DETAIL_VALUE_STRING &&
detail->value.string != NULL) {
lwc_string_unref(detail->value.string);
}
@@ -868,16 +868,16 @@ css_error css__stylesheet_selector_destroy(css_stylesheet *sheet,
else
detail = NULL;
}
-
+
free(c);
}
-
+
for (detail = &selector->data; detail;) {
if (detail->qname.ns != NULL)
lwc_string_unref(detail->qname.ns);
lwc_string_unref(detail->qname.name);
- if (detail->value_type == CSS_SELECTOR_DETAIL_VALUE_STRING &&
+ if (detail->value_type == CSS_SELECTOR_DETAIL_VALUE_STRING &&
detail->value.string != NULL) {
lwc_string_unref(detail->value.string);
}
@@ -887,8 +887,8 @@ css_error css__stylesheet_selector_destroy(css_stylesheet *sheet,
else
detail = NULL;
}
-
-
+
+
/* Destroy this selector */
free(selector);
@@ -908,16 +908,16 @@ css_error css__stylesheet_selector_destroy(css_stylesheet *sheet,
* \return CSS_OK on success,
* CSS_BADPARM on bad parameters
*
- * \note No strings are referenced at this point: they will be
+ * \note No strings are referenced at this point: they will be
* referenced when appending the detail to a selector.
*/
css_error css__stylesheet_selector_detail_init(css_stylesheet *sheet,
- css_selector_type type, css_qname *qname,
- css_selector_detail_value value,
+ css_selector_type type, css_qname *qname,
+ css_selector_detail_value value,
css_selector_detail_value_type value_type,
bool negate, css_selector_detail *detail)
{
- if (sheet == NULL || qname == NULL || qname->name == NULL ||
+ if (sheet == NULL || qname == NULL || qname->name == NULL ||
detail == NULL)
return CSS_BADPARM;
@@ -947,11 +947,11 @@ css_error css__stylesheet_selector_append_specific(css_stylesheet *sheet,
css_selector_detail *d;
size_t num_details = 0;
- if (sheet == NULL || parent == NULL ||
+ if (sheet == NULL || parent == NULL ||
*parent == NULL || detail == NULL)
return CSS_BADPARM;
- /** \todo this may want optimising -- counting blocks is O(n)
+ /** \todo this may want optimising -- counting blocks is O(n)
* In practice, however, n isn't likely to be large, so may be fine
*/
@@ -969,7 +969,7 @@ css_error css__stylesheet_selector_append_specific(css_stylesheet *sheet,
*(d = &(&temp->data)[num_details + 1]) = *detail;
/* Flag that there's another block */
(&temp->data)[num_details].next = 1;
-
+
/* Ref the strings */
if (detail->qname.ns != NULL)
d->qname.ns = lwc_string_ref(detail->qname.ns);
@@ -977,7 +977,7 @@ css_error css__stylesheet_selector_append_specific(css_stylesheet *sheet,
if (detail->value_type == CSS_SELECTOR_DETAIL_VALUE_STRING &&
detail->value.string != NULL)
d->value.string = lwc_string_ref(detail->value.string);
-
+
(*parent) = temp;
/* Update parent's specificity */
@@ -1014,7 +1014,7 @@ css_error css__stylesheet_selector_append_specific(css_stylesheet *sheet,
* \param b The second operand
* \return CSS_OK on success, appropriate error otherwise.
*
- * For example, given A + B, the combinator field of B would point at A,
+ * For example, given A + B, the combinator field of B would point at A,
* with a combinator type of CSS_COMBINATOR_SIBLING. Thus, given B, we can
* find its combinator. It is not possible to find B given A.
*/
@@ -1115,7 +1115,7 @@ css_error css__stylesheet_rule_destroy(css_stylesheet *sheet, css_rule *rule)
return CSS_BADPARM;
/* Must be detached from parent/siblings */
- assert(rule->parent == NULL && rule->next == NULL &&
+ assert(rule->parent == NULL && rule->next == NULL &&
rule->prev == NULL);
/* Destroy type-specific contents */
@@ -1152,9 +1152,9 @@ css_error css__stylesheet_rule_destroy(css_stylesheet *sheet, css_rule *rule)
case CSS_RULE_IMPORT:
{
css_rule_import *import = (css_rule_import *) rule;
-
+
lwc_string_unref(import->url);
-
+
/* Do not destroy imported sheet: it is owned by the client */
}
break;
@@ -1212,7 +1212,7 @@ css_error css__stylesheet_rule_destroy(css_stylesheet *sheet, css_rule *rule)
* \param selector The selector to add
* \return CSS_OK on success, appropriate error otherwise
*/
-css_error css__stylesheet_rule_add_selector(css_stylesheet *sheet,
+css_error css__stylesheet_rule_add_selector(css_stylesheet *sheet,
css_rule *rule, css_selector *selector)
{
css_rule_selector *r = (css_rule_selector *) rule;
@@ -1236,7 +1236,7 @@ css_error css__stylesheet_rule_add_selector(css_stylesheet *sheet,
/* Set selector's rule field */
selector->rule = rule;
-
+
return CSS_OK;
}
@@ -1310,7 +1310,7 @@ css_error css__stylesheet_rule_set_charset(css_stylesheet *sheet,
/* Set rule's encoding field */
r->encoding = lwc_string_ref(charset);
-
+
return CSS_OK;
}
@@ -1325,7 +1325,7 @@ css_error css__stylesheet_rule_set_charset(css_stylesheet *sheet,
* \return CSS_OK on success, appropriate error otherwise
*/
css_error css__stylesheet_rule_set_nascent_import(css_stylesheet *sheet,
- css_rule *rule, lwc_string *url,
+ css_rule *rule, lwc_string *url,
uint64_t media)
{
css_rule_import *r = (css_rule_import *) rule;
@@ -1505,9 +1505,9 @@ css_error css__stylesheet_remove_rule(css_stylesheet *sheet, css_rule *rule)
rule->prev = NULL;
rule->next = NULL;
- /**\ todo renumber subsequent rules? may not be necessary, as there's
- * only an expectation that rules which occur later in the stylesheet
- * have a higher index than those that appear earlier. There's no
+ /**\ todo renumber subsequent rules? may not be necessary, as there's
+ * only an expectation that rules which occur later in the stylesheet
+ * have a higher index than those that appear earlier. There's no
* guarantee that the number space is continuous. */
/** \todo needs to trigger some event announcing styles have changed */
@@ -1556,7 +1556,7 @@ css_error _add_selectors(css_stylesheet *sheet, css_rule *rule)
css__selector_hash_remove(
sheet->selectors, sel);
}
-
+
return error;
}
}
@@ -1705,7 +1705,7 @@ size_t _rule_size(const css_rule *r)
d++;
}
- s = s->combinator;
+ s = s->combinator;
}
if (rp->style != NULL)
diff --git a/src/stylesheet.h b/src/stylesheet.h
index a2b3fd5..18e077e 100644
--- a/src/stylesheet.h
+++ b/src/stylesheet.h
@@ -74,7 +74,7 @@ typedef struct css_selector_detail {
unsigned int type : 4, /**< Type of selector */
comb : 3, /**< Type of combinator */
- next : 1, /**< Another selector detail
+ next : 1, /**< Another selector detail
* follows */
value_type : 1, /**< Type of value field */
negate : 1; /**< Detail match is inverted */
@@ -110,7 +110,7 @@ typedef enum css_rule_parent_type {
} css_rule_parent_type;
struct css_rule {
- void *parent; /**< containing rule or owning
+ void *parent; /**< containing rule or owning
* stylesheet (defined by ptype)
*/
css_rule *next; /**< next in list */
@@ -173,7 +173,7 @@ struct css_stylesheet {
css_rule *rule_list; /**< List of rules in sheet */
css_rule *last_rule; /**< Last rule in list */
- bool disabled; /**< Whether this sheet is
+ bool disabled; /**< Whether this sheet is
* disabled */
char *url; /**< URL of this sheet */
@@ -201,19 +201,19 @@ struct css_stylesheet {
void *color_pw; /**< Private word */
/** System font resolution function */
- css_font_resolution_fn font;
+ css_font_resolution_fn font;
void *font_pw; /**< Private word */
-
+
css_style *cached_style; /**< Cache for style parsing */
-
+
lwc_string **string_vector; /**< Bytecode string vector */
uint32_t string_vector_l; /**< The string vector allocated
* length in entries */
- uint32_t string_vector_c; /**< The number of string
- * vector entries used */
+ uint32_t string_vector_c; /**< The number of string
+ * vector entries used */
};
-css_error css__stylesheet_style_create(css_stylesheet *sheet,
+css_error css__stylesheet_style_create(css_stylesheet *sheet,
css_style **style);
css_error css__stylesheet_style_append(css_style *style, css_code_t code);
css_error css__stylesheet_style_vappend(css_style *style, uint32_t style_count,
@@ -221,19 +221,19 @@ css_error css__stylesheet_style_vappend(css_style *style, uint32_t style_count,
css_error css__stylesheet_style_destroy(css_style *style);
css_error css__stylesheet_merge_style(css_style *target, css_style *style);
-/** Helper function to avoid distinct buildOPV call */
-static inline css_error css__stylesheet_style_appendOPV(css_style *style,
+/** Helper function to avoid distinct buildOPV call */
+static inline css_error css__stylesheet_style_appendOPV(css_style *style,
opcode_t opcode, uint8_t flags, uint16_t value)
{
- return css__stylesheet_style_append(style,
+ return css__stylesheet_style_append(style,
buildOPV(opcode, flags, value));
}
-/** Helper function to set inherit flag */
-static inline css_error css_stylesheet_style_inherit(css_style *style,
+/** Helper function to set inherit flag */
+static inline css_error css_stylesheet_style_inherit(css_style *style,
opcode_t opcode)
{
- return css__stylesheet_style_append(style,
+ return css__stylesheet_style_append(style,
buildOPV(opcode, FLAG_INHERIT, 0));
}
@@ -244,7 +244,7 @@ css_error css__stylesheet_selector_destroy(css_stylesheet *sheet,
css_error css__stylesheet_selector_detail_init(css_stylesheet *sheet,
css_selector_type type, css_qname *qname,
- css_selector_detail_value value,
+ css_selector_detail_value value,
css_selector_detail_value_type value_type,
bool negate, css_selector_detail *detail);
@@ -258,7 +258,7 @@ css_error css__stylesheet_rule_create(css_stylesheet *sheet, css_rule_type type,
css_rule **rule);
css_error css__stylesheet_rule_destroy(css_stylesheet *sheet, css_rule *rule);
-css_error css__stylesheet_rule_add_selector(css_stylesheet *sheet,
+css_error css__stylesheet_rule_add_selector(css_stylesheet *sheet,
css_rule *rule, css_selector *selector);
css_error css__stylesheet_rule_append_style(css_stylesheet *sheet,
@@ -280,10 +280,10 @@ css_error css__stylesheet_add_rule(css_stylesheet *sheet, css_rule *rule,
css_rule *parent);
css_error css__stylesheet_remove_rule(css_stylesheet *sheet, css_rule *rule);
-css_error css__stylesheet_string_get(css_stylesheet *sheet,
+css_error css__stylesheet_string_get(css_stylesheet *sheet,
uint32_t string_number, lwc_string **string);
-css_error css__stylesheet_string_add(css_stylesheet *sheet,
+css_error css__stylesheet_string_add(css_stylesheet *sheet,
lwc_string *string, uint32_t *string_number);
#endif
diff --git a/src/utils/parserutilserror.h b/src/utils/parserutilserror.h
index d2cffb6..2243b06 100644
--- a/src/utils/parserutilserror.h
+++ b/src/utils/parserutilserror.h
@@ -14,7 +14,7 @@
/**
* Convert a ParserUtils error into a LibCSS error
- *
+ *
* \param error The ParserUtils error to convert
* \return The corresponding LibCSS error
*/
diff --git a/src/utils/utils.c b/src/utils/utils.c
index 1745ea0..4bd93f6 100644
--- a/src/utils/utils.c
+++ b/src/utils/utils.c
@@ -10,7 +10,7 @@
css_fixed css__number_from_lwc_string(lwc_string *string,
bool int_only, size_t *consumed)
{
- if (string == NULL || lwc_string_length(string) == 0 ||
+ if (string == NULL || lwc_string_length(string) == 0 ||
consumed == NULL)
return 0;
@@ -77,7 +77,7 @@ css_fixed css__number_from_string(const uint8_t *data, size_t len,
}
/* And fracpart, again, assuming base 10 */
- if (int_only == false && len > 1 && ptr[0] == '.' &&
+ if (int_only == false && len > 1 && ptr[0] == '.' &&
('0' <= ptr[1] && ptr[1] <= '9')) {
ptr++;
len--;