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

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

Issue 2017053003: Remove StringBuilder::appendLiteral. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase. Created 4 years, 6 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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 ASSERT(cs->selectorList()); 664 ASSERT(cs->selectorList());
665 break; 665 break;
666 case PseudoHost: 666 case PseudoHost:
667 case PseudoHostContext: 667 case PseudoHostContext:
668 case PseudoAny: 668 case PseudoAny:
669 break; 669 break;
670 default: 670 default:
671 break; 671 break;
672 } 672 }
673 } else if (cs->m_match == PseudoElement) { 673 } else if (cs->m_match == PseudoElement) {
674 str.appendLiteral("::"); 674 str.append("::");
675 str.append(cs->serializingValue()); 675 str.append(cs->serializingValue());
676 } else if (cs->isAttributeSelector()) { 676 } else if (cs->isAttributeSelector()) {
677 str.append('['); 677 str.append('[');
678 const AtomicString& prefix = cs->attribute().prefix(); 678 const AtomicString& prefix = cs->attribute().prefix();
679 if (!prefix.isNull()) { 679 if (!prefix.isNull()) {
680 str.append(prefix); 680 str.append(prefix);
681 str.append('|'); 681 str.append('|');
682 } 682 }
683 str.append(cs->attribute().localName()); 683 str.append(cs->attribute().localName());
684 switch (cs->m_match) { 684 switch (cs->m_match) {
685 case AttributeExact: 685 case AttributeExact:
686 str.append('='); 686 str.append('=');
687 break; 687 break;
688 case AttributeSet: 688 case AttributeSet:
689 // set has no operator or value, just the attrName 689 // set has no operator or value, just the attrName
690 str.append(']'); 690 str.append(']');
691 break; 691 break;
692 case AttributeList: 692 case AttributeList:
693 str.appendLiteral("~="); 693 str.append("~=");
694 break; 694 break;
695 case AttributeHyphen: 695 case AttributeHyphen:
696 str.appendLiteral("|="); 696 str.append("|=");
697 break; 697 break;
698 case AttributeBegin: 698 case AttributeBegin:
699 str.appendLiteral("^="); 699 str.append("^=");
700 break; 700 break;
701 case AttributeEnd: 701 case AttributeEnd:
702 str.appendLiteral("$="); 702 str.append("$=");
703 break; 703 break;
704 case AttributeContain: 704 case AttributeContain:
705 str.appendLiteral("*="); 705 str.append("*=");
706 break; 706 break;
707 default: 707 default:
708 break; 708 break;
709 } 709 }
710 if (cs->m_match != AttributeSet) { 710 if (cs->m_match != AttributeSet) {
711 serializeString(cs->serializingValue(), str); 711 serializeString(cs->serializingValue(), str);
712 if (cs->attributeMatch() == CaseInsensitive) 712 if (cs->attributeMatch() == CaseInsensitive)
713 str.appendLiteral(" i"); 713 str.append(" i");
714 str.append(']'); 714 str.append(']');
715 } 715 }
716 } 716 }
717 717
718 if (cs->selectorList()) { 718 if (cs->selectorList()) {
719 str.append('('); 719 str.append('(');
720 const CSSSelector* firstSubSelector = cs->selectorList()->first(); 720 const CSSSelector* firstSubSelector = cs->selectorList()->first();
721 for (const CSSSelector* subSelector = firstSubSelector; subSelector; subSelector = CSSSelectorList::next(*subSelector)) { 721 for (const CSSSelector* subSelector = firstSubSelector; subSelector; subSelector = CSSSelectorList::next(*subSelector)) {
722 if (subSelector != firstSubSelector) 722 if (subSelector != firstSubSelector)
723 str.append(','); 723 str.append(',');
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 if (count < nthBValue()) 933 if (count < nthBValue())
934 return false; 934 return false;
935 return (count - nthBValue()) % nthAValue() == 0; 935 return (count - nthBValue()) % nthAValue() == 0;
936 } 936 }
937 if (count > nthBValue()) 937 if (count > nthBValue())
938 return false; 938 return false;
939 return (nthBValue() - count) % (-nthAValue()) == 0; 939 return (nthBValue() - count) % (-nthAValue()) == 0;
940 } 940 }
941 941
942 } // namespace blink 942 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSPaintValue.cpp ('k') | third_party/WebKit/Source/core/css/CSSSelectorList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698