Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: Source/core/css/parser/BisonCSSParser-in.cpp

Issue 751023002: Use SubSelector as relation on left-most selector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: SubSelector is not a combinator Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/css/RuleSet.cpp ('k') | Source/core/css/parser/CSSParserValues.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 if (last->tagHistory()) { 958 if (last->tagHistory()) {
959 if (tag != anyQName()) 959 if (tag != anyQName())
960 last->tagHistory()->prependTagSelector(tag, tagIsForNamespaceRule); 960 last->tagHistory()->prependTagSelector(tag, tagIsForNamespaceRule);
961 return specifiers; 961 return specifiers;
962 } 962 }
963 963
964 // For shadow-ID pseudo-elements to be correctly matched, the ShadowPseudo c ombinator has to be used. 964 // For shadow-ID pseudo-elements to be correctly matched, the ShadowPseudo c ombinator has to be used.
965 // We therefore create a new Selector with that combinator here in any case, even if matching any (host) element in any namespace (i.e. '*'). 965 // We therefore create a new Selector with that combinator here in any case, even if matching any (host) element in any namespace (i.e. '*').
966 OwnPtr<CSSParserSelector> elementNameSelector = adoptPtr(new CSSParserSelect or(tag)); 966 OwnPtr<CSSParserSelector> elementNameSelector = adoptPtr(new CSSParserSelect or(tag));
967 last->setTagHistory(elementNameSelector.release()); 967 last->setTagHistory(elementNameSelector.release());
968 last->setRelation(CSSSelector::SubSelector);
969 return specifiers; 968 return specifiers;
970 } 969 }
971 970
972 CSSParserSelector* BisonCSSParser::rewriteSpecifiers(CSSParserSelector* specifie rs, CSSParserSelector* newSpecifier) 971 CSSParserSelector* BisonCSSParser::rewriteSpecifiers(CSSParserSelector* specifie rs, CSSParserSelector* newSpecifier)
973 { 972 {
974 if (newSpecifier->crossesTreeScopes()) { 973 if (newSpecifier->crossesTreeScopes()) {
975 // Unknown pseudo element always goes at the top of selector chain. 974 // Unknown pseudo element always goes at the top of selector chain.
976 newSpecifier->appendTagHistory(CSSSelector::ShadowPseudo, sinkFloatingSe lector(specifiers)); 975 newSpecifier->appendTagHistory(CSSSelector::ShadowPseudo, sinkFloatingSe lector(specifiers));
977 return newSpecifier; 976 return newSpecifier;
978 } 977 }
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 rule->setProperties(createStylePropertySet()); 1142 rule->setProperties(createStylePropertySet());
1144 clearProperties(); 1143 clearProperties();
1145 1144
1146 StyleRuleViewport* result = rule.get(); 1145 StyleRuleViewport* result = rule.get();
1147 m_parsedRules.append(rule.release()); 1146 m_parsedRules.append(rule.release());
1148 1147
1149 return result; 1148 return result;
1150 } 1149 }
1151 1150
1152 } 1151 }
OLDNEW
« no previous file with comments | « Source/core/css/RuleSet.cpp ('k') | Source/core/css/parser/CSSParserValues.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698