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

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

Issue 23710067: :-webkit-any pseudo with escaped '(' should not crash. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed workaround code for :not() Created 7 years, 3 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
« no previous file with comments | « Source/core/css/CSSParserValues.h ('k') | Source/core/css/SelectorChecker.cpp » ('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) 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 case Exact: 96 case Exact:
97 case Class: 97 case Class:
98 case Set: 98 case Set:
99 case List: 99 case List:
100 case Hyphen: 100 case Hyphen:
101 case PseudoClass: 101 case PseudoClass:
102 case PseudoElement: 102 case PseudoElement:
103 case Contain: 103 case Contain:
104 case Begin: 104 case Begin:
105 case End: 105 case End:
106 // FIXME: PsuedoAny should base the specificity on the sub-selectors. 106 // FIXME: PseudoAny should base the specificity on the sub-selectors.
107 // See http://lists.w3.org/Archives/Public/www-style/2010Sep/0530.html 107 // See http://lists.w3.org/Archives/Public/www-style/2010Sep/0530.html
108 if (pseudoType() == PseudoNot && selectorList()) 108 if (pseudoType() == PseudoNot) {
109 ASSERT(selectorList());
109 return selectorList()->first()->specificityForOneSelector(); 110 return selectorList()->first()->specificityForOneSelector();
111 }
110 return 0x100; 112 return 0x100;
111 case Tag: 113 case Tag:
112 return (tagQName().localName() != starAtom) ? 1 : 0; 114 return (tagQName().localName() != starAtom) ? 1 : 0;
113 case Unknown: 115 case Unknown:
114 return 0; 116 return 0;
115 } 117 }
116 ASSERT_NOT_REACHED(); 118 ASSERT_NOT_REACHED();
117 return 0; 119 return 0;
118 } 120 }
119 121
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 serializeIdentifier(cs->value(), str); 622 serializeIdentifier(cs->value(), str);
621 } else if (cs->m_match == CSSSelector::Class) { 623 } else if (cs->m_match == CSSSelector::Class) {
622 str.append('.'); 624 str.append('.');
623 serializeIdentifier(cs->value(), str); 625 serializeIdentifier(cs->value(), str);
624 } else if (cs->m_match == CSSSelector::PseudoClass || cs->m_match == CSS Selector::PagePseudoClass) { 626 } else if (cs->m_match == CSSSelector::PseudoClass || cs->m_match == CSS Selector::PagePseudoClass) {
625 str.append(':'); 627 str.append(':');
626 str.append(cs->value()); 628 str.append(cs->value());
627 629
628 switch (cs->pseudoType()) { 630 switch (cs->pseudoType()) {
629 case PseudoNot: 631 case PseudoNot:
630 if (const CSSSelectorList* selectorList = cs->selectorList()) 632 ASSERT(cs->selectorList());
631 str.append(selectorList->first()->selectorText()); 633 str.append(cs->selectorList()->first()->selectorText());
632 str.append(')'); 634 str.append(')');
633 break; 635 break;
634 case PseudoLang: 636 case PseudoLang:
635 case PseudoNthChild: 637 case PseudoNthChild:
636 case PseudoNthLastChild: 638 case PseudoNthLastChild:
637 case PseudoNthOfType: 639 case PseudoNthOfType:
638 case PseudoNthLastOfType: 640 case PseudoNthLastOfType:
639 str.append(cs->argument()); 641 str.append(cs->argument());
640 str.append(')'); 642 str.append(')');
641 break; 643 break;
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 return false; 924 return false;
923 return (count - m_b) % m_a == 0; 925 return (count - m_b) % m_a == 0;
924 } else { 926 } else {
925 if (count > m_b) 927 if (count > m_b)
926 return false; 928 return false;
927 return (m_b - count) % (-m_a) == 0; 929 return (m_b - count) % (-m_a) == 0;
928 } 930 }
929 } 931 }
930 932
931 } // namespace WebCore 933 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSParserValues.h ('k') | Source/core/css/SelectorChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698