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

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

Issue 206033004: Unguard Shadow DOM features. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSGrammar.y ('k') | Source/core/dom/Element.idl » ('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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 static HashMap<StringImpl*, CSSSelector::PseudoType>* nameToPseudoType = 0; 365 static HashMap<StringImpl*, CSSSelector::PseudoType>* nameToPseudoType = 0;
366 if (!nameToPseudoType) { 366 if (!nameToPseudoType) {
367 nameToPseudoType = new HashMap<StringImpl*, CSSSelector::PseudoType>; 367 nameToPseudoType = new HashMap<StringImpl*, CSSSelector::PseudoType>;
368 368
369 size_t pseudoCount = WTF_ARRAY_LENGTH(pseudoTypeMap); 369 size_t pseudoCount = WTF_ARRAY_LENGTH(pseudoTypeMap);
370 for (size_t i = 0; i < pseudoCount; i++) { 370 for (size_t i = 0; i < pseudoCount; i++) {
371 if (pseudoTypeMap[i].requirement == CSSSelector::RequiresShadowDOM) { 371 if (pseudoTypeMap[i].requirement == CSSSelector::RequiresShadowDOM) {
372 if (!RuntimeEnabledFeatures::shadowDOMEnabled()) 372 if (!RuntimeEnabledFeatures::shadowDOMEnabled())
373 continue; 373 continue;
374 } 374 }
375
376 const char* str = pseudoTypeMap[i].string; 375 const char* str = pseudoTypeMap[i].string;
377 CSSSelector::PseudoType type; 376 CSSSelector::PseudoType type;
378 type = static_cast<CSSSelector::PseudoType>(pseudoTypeMap[i].type); 377 type = static_cast<CSSSelector::PseudoType>(pseudoTypeMap[i].type);
379 // This is a one-time leak. 378 // This is a one-time leak.
380 AtomicString* name = new AtomicString(str, strlen(str), AtomicString ::ConstructFromLiteral); 379 AtomicString* name = new AtomicString(str, strlen(str), AtomicString ::ConstructFromLiteral);
381 nameToPseudoType->set(name->impl(), type); 380 nameToPseudoType->set(name->impl(), type);
382 } 381 }
383 } 382 }
384 383
385 return nameToPseudoType; 384 return nameToPseudoType;
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 return false; 888 return false;
890 return (count - m_b) % m_a == 0; 889 return (count - m_b) % m_a == 0;
891 } else { 890 } else {
892 if (count > m_b) 891 if (count > m_b)
893 return false; 892 return false;
894 return (m_b - count) % (-m_a) == 0; 893 return (m_b - count) % (-m_a) == 0;
895 } 894 }
896 } 895 }
897 896
898 } // namespace WebCore 897 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSGrammar.y ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698