| 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 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 if (m_context.useCounter()) | 892 if (m_context.useCounter()) |
| 893 m_context.useCounter()->count(m_context, propertyID); | 893 m_context.useCounter()->count(m_context, propertyID); |
| 894 | 894 |
| 895 setStyleSheet(contextStyleSheet); | 895 setStyleSheet(contextStyleSheet); |
| 896 | 896 |
| 897 setupParser("@-internal-value ", string, ""); | 897 setupParser("@-internal-value ", string, ""); |
| 898 | 898 |
| 899 m_id = propertyID; | 899 m_id = propertyID; |
| 900 m_important = important; | 900 m_important = important; |
| 901 | 901 |
| 902 { | 902 cssyyparse(this); |
| 903 StyleDeclarationScope scope(this, declaration); | |
| 904 cssyyparse(this); | |
| 905 } | |
| 906 | 903 |
| 907 m_rule = nullptr; | 904 m_rule = nullptr; |
| 908 m_id = CSSPropertyInvalid; | 905 m_id = CSSPropertyInvalid; |
| 909 | 906 |
| 910 bool ok = false; | 907 bool ok = false; |
| 911 if (!m_parsedProperties.isEmpty()) { | 908 if (!m_parsedProperties.isEmpty()) { |
| 912 ok = true; | 909 ok = true; |
| 913 declaration->addParsedProperties(m_parsedProperties); | 910 declaration->addParsedProperties(m_parsedProperties); |
| 914 clearProperties(); | 911 clearProperties(); |
| 915 } | 912 } |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 | 1010 |
| 1014 TemporaryChange<CSSParserObserver*> scopedObsever(m_observer, observer); | 1011 TemporaryChange<CSSParserObserver*> scopedObsever(m_observer, observer); |
| 1015 | 1012 |
| 1016 setupParser("@-internal-decls ", string, ""); | 1013 setupParser("@-internal-decls ", string, ""); |
| 1017 if (m_observer) { | 1014 if (m_observer) { |
| 1018 m_observer->startRuleHeader(CSSRuleSourceData::STYLE_RULE, 0); | 1015 m_observer->startRuleHeader(CSSRuleSourceData::STYLE_RULE, 0); |
| 1019 m_observer->endRuleHeader(1); | 1016 m_observer->endRuleHeader(1); |
| 1020 m_observer->startRuleBody(0); | 1017 m_observer->startRuleBody(0); |
| 1021 } | 1018 } |
| 1022 | 1019 |
| 1023 { | 1020 cssyyparse(this); |
| 1024 StyleDeclarationScope scope(this, declaration); | |
| 1025 cssyyparse(this); | |
| 1026 } | |
| 1027 | 1021 |
| 1028 m_rule = nullptr; | 1022 m_rule = nullptr; |
| 1029 | 1023 |
| 1030 bool ok = false; | 1024 bool ok = false; |
| 1031 if (!m_parsedProperties.isEmpty()) { | 1025 if (!m_parsedProperties.isEmpty()) { |
| 1032 ok = true; | 1026 ok = true; |
| 1033 declaration->addParsedProperties(m_parsedProperties); | 1027 declaration->addParsedProperties(m_parsedProperties); |
| 1034 clearProperties(); | 1028 clearProperties(); |
| 1035 } | 1029 } |
| 1036 | 1030 |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1874 if (m_observer) | 1868 if (m_observer) |
| 1875 m_observer->endProperty(isImportantFound, isPropertyParsed, m_tokenizer.
safeUserStringTokenOffset(), errorType); | 1869 m_observer->endProperty(isImportantFound, isPropertyParsed, m_tokenizer.
safeUserStringTokenOffset(), errorType); |
| 1876 } | 1870 } |
| 1877 | 1871 |
| 1878 void BisonCSSParser::startEndUnknownRule() | 1872 void BisonCSSParser::startEndUnknownRule() |
| 1879 { | 1873 { |
| 1880 if (m_observer) | 1874 if (m_observer) |
| 1881 m_observer->startEndUnknownRule(); | 1875 m_observer->startEndUnknownRule(); |
| 1882 } | 1876 } |
| 1883 | 1877 |
| 1884 StyleRuleBase* BisonCSSParser::createViewportRule() | |
| 1885 { | |
| 1886 // Allow @viewport rules from UA stylesheets even if the feature is disabled
. | |
| 1887 if (!RuntimeEnabledFeatures::cssViewportEnabled() && !isUASheetBehavior(m_co
ntext.mode())) | |
| 1888 return 0; | |
| 1889 | |
| 1890 m_allowImportRules = m_allowNamespaceDeclarations = false; | |
| 1891 | |
| 1892 RefPtrWillBeRawPtr<StyleRuleViewport> rule = StyleRuleViewport::create(); | |
| 1893 | |
| 1894 rule->setProperties(createStylePropertySet()); | |
| 1895 clearProperties(); | |
| 1896 | |
| 1897 StyleRuleViewport* result = rule.get(); | |
| 1898 m_parsedRules.append(rule.release()); | |
| 1899 | |
| 1900 return result; | |
| 1901 } | 1878 } |
| 1902 | |
| 1903 } | |
| OLD | NEW |