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

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

Issue 1094213002: Refactored compound selector parsing methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addresses review issues Created 5 years, 8 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/CSSSelector.h ('k') | Source/core/css/parser/CSSParserValues.h » ('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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 if (sel1 || sel2) 585 if (sel1 || sel2)
586 return false; 586 return false;
587 587
588 return true; 588 return true;
589 } 589 }
590 590
591 String CSSSelector::selectorText(const String& rightSide) const 591 String CSSSelector::selectorText(const String& rightSide) const
592 { 592 {
593 StringBuilder str; 593 StringBuilder str;
594 594
595 if (m_match == Tag && !m_tagIsForNamespaceRule) { 595 if (m_match == Tag && !m_tagIsImplicit) {
596 if (tagQName().prefix().isNull()) 596 if (tagQName().prefix().isNull())
597 str.append(tagQName().localName()); 597 str.append(tagQName().localName());
598 else { 598 else {
599 str.append(tagQName().prefix().string()); 599 str.append(tagQName().prefix().string());
600 str.append('|'); 600 str.append('|');
601 str.append(tagQName().localName()); 601 str.append(tagQName().localName());
602 } 602 }
603 } 603 }
604 604
605 const CSSSelector* cs = this; 605 const CSSSelector* cs = this;
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 if (count < nthBValue()) 919 if (count < nthBValue())
920 return false; 920 return false;
921 return (count - nthBValue()) % nthAValue() == 0; 921 return (count - nthBValue()) % nthAValue() == 0;
922 } 922 }
923 if (count > nthBValue()) 923 if (count > nthBValue())
924 return false; 924 return false;
925 return (nthBValue() - count) % (-nthAValue()) == 0; 925 return (nthBValue() - count) % (-nthAValue()) == 0;
926 } 926 }
927 927
928 } // namespace blink 928 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/CSSSelector.h ('k') | Source/core/css/parser/CSSParserValues.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698