Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2002-2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2002-2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 App le Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 App le Inc. All rights reserved. |
| 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
| 6 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 6 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 1531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1542 | | 1542 | |
| 1543 property ':' maybe_space error_location expr prio { | 1543 property ':' maybe_space error_location expr prio { |
| 1544 $$ = false; | 1544 $$ = false; |
| 1545 bool isPropertyParsed = false; | 1545 bool isPropertyParsed = false; |
| 1546 if ($1 && $5) { | 1546 if ($1 && $5) { |
| 1547 parser->m_valueList = parser->sinkFloatingValueList($5); | 1547 parser->m_valueList = parser->sinkFloatingValueList($5); |
| 1548 int oldParsedProperties = parser->m_parsedProperties.size(); | 1548 int oldParsedProperties = parser->m_parsedProperties.size(); |
| 1549 $$ = parser->parseValue(static_cast<CSSPropertyID>($1), $6); | 1549 $$ = parser->parseValue(static_cast<CSSPropertyID>($1), $6); |
| 1550 if (!$$) { | 1550 if (!$$) { |
| 1551 parser->rollbackLastProperties(parser->m_parsedProperties.size() - oldParsedProperties); | 1551 parser->rollbackLastProperties(parser->m_parsedProperties.size() - oldParsedProperties); |
| 1552 parser->reportError(parser->getSource($4, parser->currentLocatio n()).trimTrailingWhitespace(), CSSParser::InvalidPropertyValueError); | 1552 CSSParserLocation exprSourceLocation = parser->getSource($4, par ser->currentLocation()); |
| 1553 exprSourceLocation.content.trimTrailingWhitespace(); | |
|
apavlov
2013/05/23 10:47:07
Can we perform the trimming in parser->reportError
SeRya
2013/05/23 15:02:37
Done.
| |
| 1554 parser->reportError(exprSourceLocation, CSSParser::InvalidProper tyValueError); | |
| 1553 } else | 1555 } else |
| 1554 isPropertyParsed = true; | 1556 isPropertyParsed = true; |
| 1555 parser->m_valueList = nullptr; | 1557 parser->m_valueList = nullptr; |
| 1556 } | 1558 } |
| 1557 parser->endProperty($6, isPropertyParsed); | 1559 parser->endProperty($6, isPropertyParsed); |
| 1558 } | 1560 } |
| 1559 | | 1561 | |
| 1560 property declaration_recovery { | 1562 property declaration_recovery { |
| 1561 parser->endProperty(false, false, CSSParser::GeneralError); | 1563 parser->endProperty(false, false, CSSParser::GeneralError); |
| 1562 $$ = false; | 1564 $$ = false; |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1904 $$ = 0; | 1906 $$ = 0; |
| 1905 } | 1907 } |
| 1906 ; | 1908 ; |
| 1907 | 1909 |
| 1908 at_rule_recovery: | 1910 at_rule_recovery: |
| 1909 error ';' | 1911 error ';' |
| 1910 | error invalid_block | 1912 | error invalid_block |
| 1911 ; | 1913 ; |
| 1912 | 1914 |
| 1913 invalid_rule: | 1915 invalid_rule: |
| 1914 error rule_error_recovery invalid_block { | 1916 error rule_error_recovery { parser->endInvalidRuleHeader(); } invalid_block { |
|
apavlov
2013/05/23 10:47:07
We prefer to avoid actions in the middle - can you
SeRya
2013/05/23 15:02:37
Done.
| |
| 1917 parser->resumeErrorLogging(); | |
| 1915 $$ = 0; | 1918 $$ = 0; |
| 1916 } | 1919 } |
| 1917 ; | 1920 ; |
| 1918 | 1921 |
| 1919 invalid_block: | 1922 invalid_block: |
| 1920 '{' error_recovery closing_brace { | 1923 '{' error_recovery closing_brace { |
| 1921 parser->invalidBlockHit(); | 1924 parser->invalidBlockHit(); |
| 1922 } | 1925 } |
| 1923 ; | 1926 ; |
| 1924 | 1927 |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 1949 | 1952 |
| 1950 rule_error_recovery: | 1953 rule_error_recovery: |
| 1951 /* empty */ | 1954 /* empty */ |
| 1952 | rule_error_recovery error | 1955 | rule_error_recovery error |
| 1953 | rule_error_recovery invalid_square_brackets_block | 1956 | rule_error_recovery invalid_square_brackets_block |
| 1954 | rule_error_recovery invalid_parentheses_block | 1957 | rule_error_recovery invalid_parentheses_block |
| 1955 ; | 1958 ; |
| 1956 | 1959 |
| 1957 %% | 1960 %% |
| 1958 | 1961 |
| OLD | NEW |