Chromium Code Reviews| 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 11109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11120 ASSERT(!specifiers->isDistributedPseudoElement()); | 11120 ASSERT(!specifiers->isDistributedPseudoElement()); |
| 11121 for (CSSParserSelector* end = specifiers; end->tagHistory(); end = end->tagH istory()) { | 11121 for (CSSParserSelector* end = specifiers; end->tagHistory(); end = end->tagH istory()) { |
| 11122 if (end->tagHistory()->isDistributedPseudoElement()) { | 11122 if (end->tagHistory()->isDistributedPseudoElement()) { |
| 11123 end->clearTagHistory(); | 11123 end->clearTagHistory(); |
| 11124 break; | 11124 break; |
| 11125 } | 11125 } |
| 11126 } | 11126 } |
| 11127 CSSParserSelector* end = argumentSelector; | 11127 CSSParserSelector* end = argumentSelector; |
| 11128 while (end->tagHistory()) | 11128 while (end->tagHistory()) |
| 11129 end = end->tagHistory(); | 11129 end = end->tagHistory(); |
| 11130 end->setTagHistory(sinkFloatingSelector(specifiers)); | 11130 |
| 11131 end->setRelation(CSSSelector::ShadowDistributed); | 11131 switch (end->relation()) { |
| 11132 return argumentSelector; | 11132 case CSSSelector::Child: |
| 11133 end->setTagHistory(sinkFloatingSelector(specifiers)); | |
| 11134 end->setRelation(CSSSelector::ShadowVirtualChild); | |
|
dglazkov
2013/05/22 17:43:43
This is where it's fairly clear that we're just ov
| |
| 11135 return argumentSelector; | |
| 11136 case CSSSelector::Descendant: | |
| 11137 end->setTagHistory(sinkFloatingSelector(specifiers)); | |
| 11138 end->setRelation(CSSSelector::ShadowVirtualDescendant); | |
| 11139 return argumentSelector; | |
| 11140 default: | |
| 11141 return 0; | |
| 11142 } | |
| 11133 } | 11143 } |
| 11134 | 11144 |
| 11135 CSSParserSelector* CSSParser::rewriteSpecifiers(CSSParserSelector* specifiers, C SSParserSelector* newSpecifier) | 11145 CSSParserSelector* CSSParser::rewriteSpecifiers(CSSParserSelector* specifiers, C SSParserSelector* newSpecifier) |
| 11136 { | 11146 { |
| 11137 if (newSpecifier->isCustomPseudoElement() || newSpecifier->pseudoType() == C SSSelector::PseudoCue) { | 11147 if (newSpecifier->isCustomPseudoElement() || newSpecifier->pseudoType() == C SSSelector::PseudoCue) { |
| 11138 // Unknown pseudo element always goes at the top of selector chain. | 11148 // Unknown pseudo element always goes at the top of selector chain. |
| 11139 newSpecifier->appendTagHistory(CSSSelector::ShadowPseudo, sinkFloatingSe lector(specifiers)); | 11149 newSpecifier->appendTagHistory(CSSSelector::ShadowPseudo, sinkFloatingSe lector(specifiers)); |
| 11140 return newSpecifier; | 11150 return newSpecifier; |
| 11141 } | 11151 } |
| 11142 if (specifiers->isCustomPseudoElement()) { | 11152 if (specifiers->isCustomPseudoElement()) { |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11700 result.lineNumber = lineNumber; | 11710 result.lineNumber = lineNumber; |
| 11701 result.content = content; | 11711 result.content = content; |
| 11702 size_t newLength = content.length(); | 11712 size_t newLength = content.length(); |
| 11703 while (newLength > 0 && isHTMLSpace(result.content[newLength - 1])) | 11713 while (newLength > 0 && isHTMLSpace(result.content[newLength - 1])) |
| 11704 --newLength; | 11714 --newLength; |
| 11705 result.content.setLength(newLength); | 11715 result.content.setLength(newLength); |
| 11706 return result; | 11716 return result; |
| 11707 } | 11717 } |
| 11708 | 11718 |
| 11709 } | 11719 } |
| OLD | NEW |