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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp

Issue 1614343002: Implement CSS4 pseudo-class :dir() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated layout tests Created 4 years, 11 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/parser/CSSSelectorParser.h" 5 #include "core/css/parser/CSSSelectorParser.h"
6 6
7 #include "core/css/CSSSelectorList.h" 7 #include "core/css/CSSSelectorList.h"
8 #include "core/css/StyleSheetContents.h" 8 #include "core/css/StyleSheetContents.h"
9 #include "core/frame/UseCounter.h" 9 #include "core/frame/UseCounter.h"
10 #include "platform/RuntimeEnabledFeatures.h" 10 #include "platform/RuntimeEnabledFeatures.h"
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 } 517 }
518 case CSSSelector::PseudoLang: 518 case CSSSelector::PseudoLang:
519 { 519 {
520 // FIXME: CSS Selectors Level 4 allows :lang(*-foo) 520 // FIXME: CSS Selectors Level 4 allows :lang(*-foo)
521 const CSSParserToken& ident = block.consumeIncludingWhitespace(); 521 const CSSParserToken& ident = block.consumeIncludingWhitespace();
522 if (ident.type() != IdentToken || !block.atEnd()) 522 if (ident.type() != IdentToken || !block.atEnd())
523 return nullptr; 523 return nullptr;
524 selector->setArgument(ident.value()); 524 selector->setArgument(ident.value());
525 return selector.release(); 525 return selector.release();
526 } 526 }
527 case CSSSelector::PseudoDir:
528 {
529 const CSSParserToken& ident = block.consumeIncludingWhitespace();
530 if (ident.type() != IdentToken || !block.atEnd())
531 return nullptr;
532 selector->setArgument(ident.value());
533 return selector.release();
534 }
527 case CSSSelector::PseudoNthChild: 535 case CSSSelector::PseudoNthChild:
528 case CSSSelector::PseudoNthLastChild: 536 case CSSSelector::PseudoNthLastChild:
529 case CSSSelector::PseudoNthOfType: 537 case CSSSelector::PseudoNthOfType:
530 case CSSSelector::PseudoNthLastOfType: 538 case CSSSelector::PseudoNthLastOfType:
531 { 539 {
532 std::pair<int, int> ab; 540 std::pair<int, int> ab;
533 if (!consumeANPlusB(block, ab)) 541 if (!consumeANPlusB(block, ab))
534 return nullptr; 542 return nullptr;
535 block.consumeWhitespace(); 543 block.consumeWhitespace();
536 if (!block.atEnd()) 544 if (!block.atEnd())
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 771
764 if (!splitAfter || !splitAfter->tagHistory()) 772 if (!splitAfter || !splitAfter->tagHistory())
765 return compoundSelector; 773 return compoundSelector;
766 774
767 OwnPtr<CSSParserSelector> secondCompound = splitAfter->releaseTagHistory(); 775 OwnPtr<CSSParserSelector> secondCompound = splitAfter->releaseTagHistory();
768 secondCompound->appendTagHistory(secondCompound->pseudoType() == CSSSelector ::PseudoSlotted ? CSSSelector::ShadowSlot : CSSSelector::ShadowPseudo, compoundS elector); 776 secondCompound->appendTagHistory(secondCompound->pseudoType() == CSSSelector ::PseudoSlotted ? CSSSelector::ShadowSlot : CSSSelector::ShadowPseudo, compoundS elector);
769 return secondCompound.release(); 777 return secondCompound.release();
770 } 778 }
771 779
772 } // namespace blink 780 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698