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

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

Issue 1695393002: Don't add to siblingRules for features left of ::slotted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | third_party/WebKit/Source/core/css/RuleFeature.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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 void setValue(const AtomicString&, bool matchLowerCase); 246 void setValue(const AtomicString&, bool matchLowerCase);
247 void setAttribute(const QualifiedName&, AttributeMatchType); 247 void setAttribute(const QualifiedName&, AttributeMatchType);
248 void setArgument(const AtomicString&); 248 void setArgument(const AtomicString&);
249 void setSelectorList(PassOwnPtr<CSSSelectorList>); 249 void setSelectorList(PassOwnPtr<CSSSelectorList>);
250 250
251 void setNth(int a, int b); 251 void setNth(int a, int b);
252 bool matchNth(int count) const; 252 bool matchNth(int count) const;
253 253
254 bool isAdjacentSelector() const { return m_relation == DirectAdjacent || m_r elation == IndirectAdjacent; } 254 bool isAdjacentSelector() const { return m_relation == DirectAdjacent || m_r elation == IndirectAdjacent; }
255 bool isShadowSelector() const { return m_relation == ShadowPseudo || m_relat ion == ShadowDeep; } 255 bool isShadowSelector() const { return m_relation == ShadowPseudo || m_relat ion == ShadowDeep; }
256 bool isSiblingSelector() const; 256 bool isSiblingPseudo() const;
257 bool isAttributeSelector() const { return m_match >= FirstAttributeSelectorM atch; } 257 bool isAttributeSelector() const { return m_match >= FirstAttributeSelectorM atch; }
258 bool isHostPseudoClass() const { return m_pseudoType == PseudoHost || m_pseu doType == PseudoHostContext; } 258 bool isHostPseudoClass() const { return m_pseudoType == PseudoHost || m_pseu doType == PseudoHostContext; }
259 bool isInsertionPointCrossing() const { return m_pseudoType == PseudoHostCon text || m_pseudoType == PseudoContent || m_pseudoType == PseudoSlotted; } 259 bool isInsertionPointCrossing() const { return m_pseudoType == PseudoHostCon text || m_pseudoType == PseudoContent || m_pseudoType == PseudoSlotted; }
260 260
261 Relation relation() const { return static_cast<Relation>(m_relation); } 261 Relation relation() const { return static_cast<Relation>(m_relation); }
262 void setRelation(Relation relation) 262 void setRelation(Relation relation)
263 { 263 {
264 m_relation = relation; 264 m_relation = relation;
265 ASSERT(static_cast<Relation>(m_relation) == relation); // using a bitfie ld. 265 ASSERT(static_cast<Relation>(m_relation) == relation); // using a bitfie ld.
266 } 266 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 return m_data.m_rareData->m_attribute; 358 return m_data.m_rareData->m_attribute;
359 } 359 }
360 360
361 inline CSSSelector::AttributeMatchType CSSSelector::attributeMatchType() const 361 inline CSSSelector::AttributeMatchType CSSSelector::attributeMatchType() const
362 { 362 {
363 ASSERT(isAttributeSelector()); 363 ASSERT(isAttributeSelector());
364 ASSERT(m_hasRareData); 364 ASSERT(m_hasRareData);
365 return m_data.m_rareData->m_bits.m_attributeMatchType; 365 return m_data.m_rareData->m_bits.m_attributeMatchType;
366 } 366 }
367 367
368 inline bool CSSSelector::isSiblingSelector() const 368 inline bool CSSSelector::isSiblingPseudo() const
369 { 369 {
370 PseudoType type = pseudoType(); 370 PseudoType type = pseudoType();
371 return m_relation == DirectAdjacent 371 return type == PseudoEmpty
372 || m_relation == IndirectAdjacent
373 || type == PseudoEmpty
374 || type == PseudoFirstChild 372 || type == PseudoFirstChild
375 || type == PseudoFirstOfType 373 || type == PseudoFirstOfType
376 || type == PseudoLastChild 374 || type == PseudoLastChild
377 || type == PseudoLastOfType 375 || type == PseudoLastOfType
378 || type == PseudoOnlyChild 376 || type == PseudoOnlyChild
379 || type == PseudoOnlyOfType 377 || type == PseudoOnlyOfType
380 || type == PseudoNthChild 378 || type == PseudoNthChild
381 || type == PseudoNthOfType 379 || type == PseudoNthOfType
382 || type == PseudoNthLastChild 380 || type == PseudoNthLastChild
383 || type == PseudoNthLastOfType; 381 || type == PseudoNthLastOfType;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 if (m_hasRareData) 491 if (m_hasRareData)
494 return m_data.m_rareData->m_serializingValue; 492 return m_data.m_rareData->m_serializingValue;
495 // AtomicString is really just a StringImpl* so the cast below is safe. 493 // AtomicString is really just a StringImpl* so the cast below is safe.
496 // FIXME: Perhaps call sites could be changed to accept StringImpl? 494 // FIXME: Perhaps call sites could be changed to accept StringImpl?
497 return *reinterpret_cast<const AtomicString*>(&m_data.m_value); 495 return *reinterpret_cast<const AtomicString*>(&m_data.m_value);
498 } 496 }
499 497
500 } // namespace blink 498 } // namespace blink
501 499
502 #endif // CSSSelector_h 500 #endif // CSSSelector_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698