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

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

Issue 208933006: Only :host and :ancestor should ever match the host in a ShadowRoot (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add a test for :first-child too 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/CSSParserValues.cpp ('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 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 return m_match == PseudoElement && m_pseudoType == PseudoUnknown; 379 return m_match == PseudoElement && m_pseudoType == PseudoUnknown;
380 } 380 }
381 381
382 inline bool CSSSelector::isCustomPseudoElement() const 382 inline bool CSSSelector::isCustomPseudoElement() const
383 { 383 {
384 return m_match == PseudoElement && (m_pseudoType == PseudoUserAgentCustomEle ment || m_pseudoType == PseudoWebKitCustomElement); 384 return m_match == PseudoElement && (m_pseudoType == PseudoUserAgentCustomEle ment || m_pseudoType == PseudoWebKitCustomElement);
385 } 385 }
386 386
387 inline bool CSSSelector::isHostPseudoClass() const 387 inline bool CSSSelector::isHostPseudoClass() const
388 { 388 {
389 return m_match == PseudoClass && m_pseudoType == PseudoHost; 389 return m_match == PseudoClass && (m_pseudoType == PseudoHost || m_pseudoType == PseudoAncestor);
390 } 390 }
391 391
392 inline bool CSSSelector::isSiblingSelector() const 392 inline bool CSSSelector::isSiblingSelector() const
393 { 393 {
394 PseudoType type = pseudoType(); 394 PseudoType type = pseudoType();
395 return m_relation == DirectAdjacent 395 return m_relation == DirectAdjacent
396 || m_relation == IndirectAdjacent 396 || m_relation == IndirectAdjacent
397 || type == PseudoEmpty 397 || type == PseudoEmpty
398 || type == PseudoFirstChild 398 || type == PseudoFirstChild
399 || type == PseudoFirstOfType 399 || type == PseudoFirstOfType
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 if (m_hasRareData) 514 if (m_hasRareData)
515 return m_data.m_rareData->m_value; 515 return m_data.m_rareData->m_value;
516 // AtomicString is really just a StringImpl* so the cast below is safe. 516 // AtomicString is really just a StringImpl* so the cast below is safe.
517 // FIXME: Perhaps call sites could be changed to accept StringImpl? 517 // FIXME: Perhaps call sites could be changed to accept StringImpl?
518 return *reinterpret_cast<const AtomicString*>(&m_data.m_value); 518 return *reinterpret_cast<const AtomicString*>(&m_data.m_value);
519 } 519 }
520 520
521 } // namespace WebCore 521 } // namespace WebCore
522 522
523 #endif // CSSSelector_h 523 #endif // CSSSelector_h
OLDNEW
« no previous file with comments | « Source/core/css/CSSParserValues.cpp ('k') | Source/core/css/SelectorChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698