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

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

Issue 1574323003: Split compound selector after consume finished. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@upload-base
Patch Set: Removed obsolete serialization hack and fixed unit 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 /* 1 /*
2 * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * 1999 Waldo Bastian (bastian@kde.org) 3 * 1999 Waldo Bastian (bastian@kde.org)
4 * 2001 Andreas Schlapbach (schlpbch@iam.unibe.ch) 4 * 2001 Andreas Schlapbach (schlpbch@iam.unibe.ch)
5 * 2001-2003 Dirk Mueller (mueller@kde.org) 5 * 2001-2003 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2002, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2002, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2008 David Smith (catfish.man@gmail.com) 7 * Copyright (C) 2008 David Smith (catfish.man@gmail.com)
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 case PseudoHost: 645 case PseudoHost:
646 case PseudoHostContext: 646 case PseudoHostContext:
647 case PseudoAny: 647 case PseudoAny:
648 break; 648 break;
649 default: 649 default:
650 break; 650 break;
651 } 651 }
652 } else if (cs->m_match == PseudoElement) { 652 } else if (cs->m_match == PseudoElement) {
653 str.appendLiteral("::"); 653 str.appendLiteral("::");
654 str.append(cs->serializingValue()); 654 str.append(cs->serializingValue());
655 // ::content is always stored at the end of the compound.
656 if (cs->pseudoType() == PseudoContent && cs->relation() == SubSelect or && cs->tagHistory()) {
657 return cs->tagHistory()->selectorText() + str.toString() + right Side;
658 }
659 } else if (cs->isAttributeSelector()) { 655 } else if (cs->isAttributeSelector()) {
660 str.append('['); 656 str.append('[');
661 const AtomicString& prefix = cs->attribute().prefix(); 657 const AtomicString& prefix = cs->attribute().prefix();
662 if (!prefix.isNull()) { 658 if (!prefix.isNull()) {
663 str.append(prefix); 659 str.append(prefix);
664 str.append('|'); 660 str.append('|');
665 } 661 }
666 str.append(cs->attribute().localName()); 662 str.append(cs->attribute().localName());
667 switch (cs->m_match) { 663 switch (cs->m_match) {
668 case AttributeExact: 664 case AttributeExact:
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 if (count < nthBValue()) 899 if (count < nthBValue())
904 return false; 900 return false;
905 return (count - nthBValue()) % nthAValue() == 0; 901 return (count - nthBValue()) % nthAValue() == 0;
906 } 902 }
907 if (count > nthBValue()) 903 if (count > nthBValue())
908 return false; 904 return false;
909 return (nthBValue() - count) % (-nthAValue()) == 0; 905 return (nthBValue() - count) % (-nthAValue()) == 0;
910 } 906 }
911 907
912 } // namespace blink 908 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698