OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 queries->appendMediaQuery(m_mediaQuery.release()); | 608 queries->appendMediaQuery(m_mediaQuery.release()); |
609 } | 609 } |
610 | 610 |
611 return ok; | 611 return ok; |
612 } | 612 } |
613 | 613 |
614 void CSSParser::addProperty(int propId, PassRefPtr<CSSValue> value, bool importa
nt) | 614 void CSSParser::addProperty(int propId, PassRefPtr<CSSValue> value, bool importa
nt) |
615 { | 615 { |
616 OwnPtr<CSSProperty> prop(adoptPtr(new CSSProperty(propId, value, important,
m_currentShorthand, m_implicitShorthand))); | 616 OwnPtr<CSSProperty> prop(adoptPtr(new CSSProperty(propId, value, important,
m_currentShorthand, m_implicitShorthand))); |
617 if (m_numParsedProperties >= m_maxParsedProperties) { | 617 if (m_numParsedProperties >= m_maxParsedProperties) { |
| 618 if (m_numParsedProperties > (UINT_MAX / sizeof(CSSProperty*)) - 32) |
| 619 CRASH(); // Avoid inconsistencies with rollbackLastProperties. |
618 m_maxParsedProperties += 32; | 620 m_maxParsedProperties += 32; |
619 if (m_maxParsedProperties > UINT_MAX / sizeof(CSSProperty*)) | |
620 return; | |
621 m_parsedProperties = static_cast<CSSProperty**>(fastRealloc(m_parsedProp
erties, | 621 m_parsedProperties = static_cast<CSSProperty**>(fastRealloc(m_parsedProp
erties, |
622 m_maxParsedProperties * sizeof(CSSProperty*))); | 622 m_maxParsedProperties * sizeof(CSSProperty*))); |
623 } | 623 } |
624 m_parsedProperties[m_numParsedProperties++] = prop.leakPtr(); | 624 m_parsedProperties[m_numParsedProperties++] = prop.leakPtr(); |
625 } | 625 } |
626 | 626 |
627 void CSSParser::rollbackLastProperties(int num) | 627 void CSSParser::rollbackLastProperties(int num) |
628 { | 628 { |
629 ASSERT(num >= 0); | 629 ASSERT(num >= 0); |
630 ASSERT(m_numParsedProperties >= static_cast<unsigned>(num)); | 630 ASSERT(m_numParsedProperties >= static_cast<unsigned>(num)); |
(...skipping 7070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7701 // The macro is used in the tokenizer grammar with lines containing | 7701 // The macro is used in the tokenizer grammar with lines containing |
7702 // BEGIN(mediaqueries) and BEGIN(initial). yy_start acts as index to | 7702 // BEGIN(mediaqueries) and BEGIN(initial). yy_start acts as index to |
7703 // tokenizer transition table, and 'mediaqueries' and 'initial' are | 7703 // tokenizer transition table, and 'mediaqueries' and 'initial' are |
7704 // offset multipliers that specify which transitions are active | 7704 // offset multipliers that specify which transitions are active |
7705 // in the tokenizer during in each condition (tokenizer state). | 7705 // in the tokenizer during in each condition (tokenizer state). |
7706 #define BEGIN yy_start = 1 + 2 * | 7706 #define BEGIN yy_start = 1 + 2 * |
7707 | 7707 |
7708 #include "tokenizer.cpp" | 7708 #include "tokenizer.cpp" |
7709 | 7709 |
7710 } | 7710 } |
OLD | NEW |