| 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, 2011, 2012 Apple Inc.
All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
| 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
| 10 * | 10 * |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 m_defaultNamespace = starAtom; | 134 m_defaultNamespace = starAtom; |
| 135 m_observer = 0; | 135 m_observer = 0; |
| 136 m_source = 0; | 136 m_source = 0; |
| 137 m_ruleHeaderType = CSSRuleSourceData::UNKNOWN_RULE; | 137 m_ruleHeaderType = CSSRuleSourceData::UNKNOWN_RULE; |
| 138 m_allowImportRules = true; | 138 m_allowImportRules = true; |
| 139 m_allowNamespaceDeclarations = true; | 139 m_allowNamespaceDeclarations = true; |
| 140 m_inViewport = false; | 140 m_inViewport = false; |
| 141 #if YYDEBUG > 0 | 141 #if YYDEBUG > 0 |
| 142 cssyydebug = 1; | 142 cssyydebug = 1; |
| 143 #endif | 143 #endif |
| 144 CSSPropertySourceData::init(); | |
| 145 } | 144 } |
| 146 | 145 |
| 147 BisonCSSParser::~BisonCSSParser() | 146 BisonCSSParser::~BisonCSSParser() |
| 148 { | 147 { |
| 149 clearProperties(); | 148 clearProperties(); |
| 150 | 149 |
| 151 deleteAllValues(m_floatingSelectors); | 150 deleteAllValues(m_floatingSelectors); |
| 152 deleteAllValues(m_floatingSelectorVectors); | 151 deleteAllValues(m_floatingSelectorVectors); |
| 153 deleteAllValues(m_floatingValueLists); | 152 deleteAllValues(m_floatingValueLists); |
| 154 deleteAllValues(m_floatingFunctions); | 153 deleteAllValues(m_floatingFunctions); |
| (...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1687 } | 1686 } |
| 1688 StyleRuleMedia* result = rule.get(); | 1687 StyleRuleMedia* result = rule.get(); |
| 1689 m_parsedRules.append(rule.release()); | 1688 m_parsedRules.append(rule.release()); |
| 1690 return result; | 1689 return result; |
| 1691 } | 1690 } |
| 1692 | 1691 |
| 1693 StyleRuleBase* BisonCSSParser::createSupportsRule(bool conditionIsSupported, Rul
eList* rules) | 1692 StyleRuleBase* BisonCSSParser::createSupportsRule(bool conditionIsSupported, Rul
eList* rules) |
| 1694 { | 1693 { |
| 1695 m_allowImportRules = m_allowNamespaceDeclarations = false; | 1694 m_allowImportRules = m_allowNamespaceDeclarations = false; |
| 1696 | 1695 |
| 1697 RefPtr<CSSRuleSourceData> data = popSupportsRuleData(); | 1696 RefPtrWillBeRawPtr<CSSRuleSourceData> data = popSupportsRuleData(); |
| 1698 RefPtrWillBeRawPtr<StyleRuleSupports> rule = nullptr; | 1697 RefPtrWillBeRawPtr<StyleRuleSupports> rule = nullptr; |
| 1699 String conditionText; | 1698 String conditionText; |
| 1700 unsigned conditionOffset = data->ruleHeaderRange.start + 9; | 1699 unsigned conditionOffset = data->ruleHeaderRange.start + 9; |
| 1701 unsigned conditionLength = data->ruleHeaderRange.length() - 9; | 1700 unsigned conditionLength = data->ruleHeaderRange.length() - 9; |
| 1702 | 1701 |
| 1703 if (m_tokenizer.is8BitSource()) | 1702 if (m_tokenizer.is8BitSource()) |
| 1704 conditionText = String(m_tokenizer.m_dataStart8.get() + conditionOffset,
conditionLength).stripWhiteSpace(); | 1703 conditionText = String(m_tokenizer.m_dataStart8.get() + conditionOffset,
conditionLength).stripWhiteSpace(); |
| 1705 else | 1704 else |
| 1706 conditionText = String(m_tokenizer.m_dataStart16.get() + conditionOffset
, conditionLength).stripWhiteSpace(); | 1705 conditionText = String(m_tokenizer.m_dataStart16.get() + conditionOffset
, conditionLength).stripWhiteSpace(); |
| 1707 | 1706 |
| 1708 if (rules) { | 1707 if (rules) { |
| 1709 rule = StyleRuleSupports::create(conditionText, conditionIsSupported, *r
ules); | 1708 rule = StyleRuleSupports::create(conditionText, conditionIsSupported, *r
ules); |
| 1710 } else { | 1709 } else { |
| 1711 RuleList emptyRules; | 1710 RuleList emptyRules; |
| 1712 rule = StyleRuleSupports::create(conditionText, conditionIsSupported, em
ptyRules); | 1711 rule = StyleRuleSupports::create(conditionText, conditionIsSupported, em
ptyRules); |
| 1713 } | 1712 } |
| 1714 | 1713 |
| 1715 StyleRuleSupports* result = rule.get(); | 1714 StyleRuleSupports* result = rule.get(); |
| 1716 m_parsedRules.append(rule.release()); | 1715 m_parsedRules.append(rule.release()); |
| 1717 | 1716 |
| 1718 return result; | 1717 return result; |
| 1719 } | 1718 } |
| 1720 | 1719 |
| 1721 void BisonCSSParser::markSupportsRuleHeaderStart() | 1720 void BisonCSSParser::markSupportsRuleHeaderStart() |
| 1722 { | 1721 { |
| 1723 if (!m_supportsRuleDataStack) | 1722 if (!m_supportsRuleDataStack) |
| 1724 m_supportsRuleDataStack = adoptPtr(new RuleSourceDataList()); | 1723 m_supportsRuleDataStack = adoptPtrWillBeNoop(new RuleSourceDataList()); |
| 1725 | 1724 |
| 1726 RefPtr<CSSRuleSourceData> data = CSSRuleSourceData::create(CSSRuleSourceData
::SUPPORTS_RULE); | 1725 RefPtrWillBeRawPtr<CSSRuleSourceData> data = CSSRuleSourceData::create(CSSRu
leSourceData::SUPPORTS_RULE); |
| 1727 data->ruleHeaderRange.start = m_tokenizer.tokenStartOffset(); | 1726 data->ruleHeaderRange.start = m_tokenizer.tokenStartOffset(); |
| 1728 m_supportsRuleDataStack->append(data); | 1727 m_supportsRuleDataStack->append(data); |
| 1729 } | 1728 } |
| 1730 | 1729 |
| 1731 void BisonCSSParser::markSupportsRuleHeaderEnd() | 1730 void BisonCSSParser::markSupportsRuleHeaderEnd() |
| 1732 { | 1731 { |
| 1733 ASSERT(m_supportsRuleDataStack && !m_supportsRuleDataStack->isEmpty()); | 1732 ASSERT(m_supportsRuleDataStack && !m_supportsRuleDataStack->isEmpty()); |
| 1734 | 1733 |
| 1735 if (m_tokenizer.is8BitSource()) | 1734 if (m_tokenizer.is8BitSource()) |
| 1736 m_supportsRuleDataStack->last()->ruleHeaderRange.end = m_tokenizer.token
Start<LChar>() - m_tokenizer.m_dataStart8.get(); | 1735 m_supportsRuleDataStack->last()->ruleHeaderRange.end = m_tokenizer.token
Start<LChar>() - m_tokenizer.m_dataStart8.get(); |
| 1737 else | 1736 else |
| 1738 m_supportsRuleDataStack->last()->ruleHeaderRange.end = m_tokenizer.token
Start<UChar>() - m_tokenizer.m_dataStart16.get(); | 1737 m_supportsRuleDataStack->last()->ruleHeaderRange.end = m_tokenizer.token
Start<UChar>() - m_tokenizer.m_dataStart16.get(); |
| 1739 } | 1738 } |
| 1740 | 1739 |
| 1741 PassRefPtr<CSSRuleSourceData> BisonCSSParser::popSupportsRuleData() | 1740 PassRefPtrWillBeRawPtr<CSSRuleSourceData> BisonCSSParser::popSupportsRuleData() |
| 1742 { | 1741 { |
| 1743 ASSERT(m_supportsRuleDataStack && !m_supportsRuleDataStack->isEmpty()); | 1742 ASSERT(m_supportsRuleDataStack && !m_supportsRuleDataStack->isEmpty()); |
| 1744 RefPtr<CSSRuleSourceData> data = m_supportsRuleDataStack->last(); | 1743 RefPtrWillBeRawPtr<CSSRuleSourceData> data = m_supportsRuleDataStack->last()
; |
| 1745 m_supportsRuleDataStack->removeLast(); | 1744 m_supportsRuleDataStack->removeLast(); |
| 1746 return data.release(); | 1745 return data.release(); |
| 1747 } | 1746 } |
| 1748 | 1747 |
| 1749 BisonCSSParser::RuleList* BisonCSSParser::createRuleList() | 1748 BisonCSSParser::RuleList* BisonCSSParser::createRuleList() |
| 1750 { | 1749 { |
| 1751 OwnPtrWillBeRawPtr<RuleList> list = adoptPtrWillBeNoop(new RuleList); | 1750 OwnPtrWillBeRawPtr<RuleList> list = adoptPtrWillBeNoop(new RuleList); |
| 1752 RuleList* listPtr = list.get(); | 1751 RuleList* listPtr = list.get(); |
| 1753 | 1752 |
| 1754 m_parsedRuleLists.append(list.release()); | 1753 m_parsedRuleLists.append(list.release()); |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2184 rule->setProperties(createStylePropertySet()); | 2183 rule->setProperties(createStylePropertySet()); |
| 2185 clearProperties(); | 2184 clearProperties(); |
| 2186 | 2185 |
| 2187 StyleRuleViewport* result = rule.get(); | 2186 StyleRuleViewport* result = rule.get(); |
| 2188 m_parsedRules.append(rule.release()); | 2187 m_parsedRules.append(rule.release()); |
| 2189 | 2188 |
| 2190 return result; | 2189 return result; |
| 2191 } | 2190 } |
| 2192 | 2191 |
| 2193 } | 2192 } |
| OLD | NEW |