summaryrefslogtreecommitdiff
path: root/src/cssparser.cc
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2011-09-19 21:33:52 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2011-09-19 21:33:52 +0200
commitabd446c2eebe1f96764b6d95f1c6c61ae9bc40b2 (patch)
treeb313bbeebf50fd53369d303824edab57aa69d016 /src/cssparser.cc
parentb0b0cddaff10b4cff371b8bb7aa21e045f8e3915 (diff)
parent0caf22a3f7c33578a073cee42c6cfa61f971bc42 (diff)
merge
Diffstat (limited to 'src/cssparser.cc')
-rw-r--r--src/cssparser.cc22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/cssparser.cc b/src/cssparser.cc
index 7b522c8c..f6e60731 100644
--- a/src/cssparser.cc
+++ b/src/cssparser.cc
@@ -1053,7 +1053,7 @@ void CssParser::parseDeclaration(CssPropertyList * props,
CssPropertyList * importantProps)
{
CssPropertyInfo pi = {NULL, {CSS_TYPE_UNUSED}, NULL}, *pip;
- CssShorthandInfo si, *sip;
+ CssShorthandInfo *sip;
CssValueType type = CSS_TYPE_UNUSED;
CssPropertyName prop;
@@ -1091,7 +1091,6 @@ void CssParser::parseDeclaration(CssPropertyList * props,
}
} else {
/* Try shorthands. */
- si.symbol = tval;
sip =
(CssShorthandInfo *) bsearch(&pi, Css_shorthand_info,
CSS_SHORTHAND_NUM,
@@ -1294,6 +1293,9 @@ CssSelector *CssParser::parseSelector()
} else if (ttype == CSS_TK_CHAR && tval[0] == '>') {
selector->addSimpleSelector (CssSelector::CHILD);
nextToken();
+ } else if (ttype == CSS_TK_CHAR && tval[0] == '+') {
+ selector->addSimpleSelector (CssSelector::ADJACENT_SIBLING);
+ nextToken();
} else if (ttype != CSS_TK_END && spaceSeparated) {
selector->addSimpleSelector (CssSelector::DESCENDANT);
} else {
@@ -1526,7 +1528,7 @@ const char * CssParser::propertyNameString(CssPropertyName name)
{
return Css_property_info[name].symbol;
}
-
+
void CssParser::ignoreBlock()
{
int depth = 0;
@@ -1594,22 +1596,16 @@ void CssParser::parse(DilloHtml *html, DilloUrl *url, CssContext * context,
}
}
-CssPropertyList *CssParser::parseDeclarationBlock(const char *buf, int buflen)
+void CssParser::parseDeclarationBlock(const char *buf, int buflen,
+ CssPropertyList *props,
+ CssPropertyList *propsImortant)
{
- CssPropertyList *props = new CssPropertyList (true);
CssParser parser (NULL, CSS_ORIGIN_AUTHOR, buf, buflen);
parser.withinBlock = true;
do
- parser.parseDeclaration(props, NULL);
+ parser.parseDeclaration(props, propsImortant);
while (!(parser.ttype == CSS_TK_END ||
(parser.ttype == CSS_TK_CHAR && parser.tval[0] == '}')));
-
- if (props->size () == 0) {
- delete props;
- props = NULL;
- }
-
- return props;
}