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

Side by Side Diff: Source/core/css/CSSParser.cpp

Issue 15657003: Make a '::distributed' pseudo element the first-ever client who can accept a relative selector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Introduce m_relationIsForShadowDistributed Created 7 years, 7 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSGrammar.y.in ('k') | Source/core/css/CSSParserValues.h » ('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 11120 matching lines...) Expand 10 before | Expand all | Expand 10 after
11131 ASSERT(!specifiers->isDistributedPseudoElement()); 11131 ASSERT(!specifiers->isDistributedPseudoElement());
11132 for (CSSParserSelector* end = specifiers; end->tagHistory(); end = end->tagH istory()) { 11132 for (CSSParserSelector* end = specifiers; end->tagHistory(); end = end->tagH istory()) {
11133 if (end->tagHistory()->isDistributedPseudoElement()) { 11133 if (end->tagHistory()->isDistributedPseudoElement()) {
11134 end->clearTagHistory(); 11134 end->clearTagHistory();
11135 break; 11135 break;
11136 } 11136 }
11137 } 11137 }
11138 CSSParserSelector* end = argumentSelector; 11138 CSSParserSelector* end = argumentSelector;
11139 while (end->tagHistory()) 11139 while (end->tagHistory())
11140 end = end->tagHistory(); 11140 end = end->tagHistory();
11141 end->setTagHistory(sinkFloatingSelector(specifiers)); 11141
11142 end->setRelation(CSSSelector::ShadowDistributed); 11142 switch (end->relation()) {
11143 return argumentSelector; 11143 case CSSSelector::Child:
11144 case CSSSelector::Descendant:
11145 end->setTagHistory(sinkFloatingSelector(specifiers));
11146 end->setRelationIsForShadowDistributed();
11147 return argumentSelector;
11148 default:
11149 return 0;
11150 }
11144 } 11151 }
11145 11152
11146 CSSParserSelector* CSSParser::rewriteSpecifiers(CSSParserSelector* specifiers, C SSParserSelector* newSpecifier) 11153 CSSParserSelector* CSSParser::rewriteSpecifiers(CSSParserSelector* specifiers, C SSParserSelector* newSpecifier)
11147 { 11154 {
11148 if (newSpecifier->isCustomPseudoElement() || newSpecifier->pseudoType() == C SSSelector::PseudoCue) { 11155 if (newSpecifier->isCustomPseudoElement() || newSpecifier->pseudoType() == C SSSelector::PseudoCue) {
11149 // Unknown pseudo element always goes at the top of selector chain. 11156 // Unknown pseudo element always goes at the top of selector chain.
11150 newSpecifier->appendTagHistory(CSSSelector::ShadowPseudo, sinkFloatingSe lector(specifiers)); 11157 newSpecifier->appendTagHistory(CSSSelector::ShadowPseudo, sinkFloatingSe lector(specifiers));
11151 return newSpecifier; 11158 return newSpecifier;
11152 } 11159 }
11153 if (specifiers->isCustomPseudoElement()) { 11160 if (specifiers->isCustomPseudoElement()) {
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
11711 result.lineNumber = lineNumber; 11718 result.lineNumber = lineNumber;
11712 result.content = content; 11719 result.content = content;
11713 size_t newLength = content.length(); 11720 size_t newLength = content.length();
11714 while (newLength > 0 && isHTMLSpace(result.content[newLength - 1])) 11721 while (newLength > 0 && isHTMLSpace(result.content[newLength - 1]))
11715 --newLength; 11722 --newLength;
11716 result.content.setLength(newLength); 11723 result.content.setLength(newLength);
11717 return result; 11724 return result;
11718 } 11725 }
11719 11726
11720 } 11727 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSGrammar.y.in ('k') | Source/core/css/CSSParserValues.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698