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

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

Issue 2272683002: Consider pseudo classes as matching for shared style rejection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handle negated selectors Created 4 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
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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 void setArgument(const AtomicString&); 253 void setArgument(const AtomicString&);
254 void setSelectorList(std::unique_ptr<CSSSelectorList>); 254 void setSelectorList(std::unique_ptr<CSSSelectorList>);
255 255
256 void setNth(int a, int b); 256 void setNth(int a, int b);
257 bool matchNth(int count) const; 257 bool matchNth(int count) const;
258 258
259 bool isAdjacentSelector() const { return m_relation == DirectAdjacent || m_r elation == IndirectAdjacent; } 259 bool isAdjacentSelector() const { return m_relation == DirectAdjacent || m_r elation == IndirectAdjacent; }
260 bool isShadowSelector() const { return m_relation == ShadowPseudo || m_relat ion == ShadowDeep; } 260 bool isShadowSelector() const { return m_relation == ShadowPseudo || m_relat ion == ShadowDeep; }
261 bool isAttributeSelector() const { return m_match >= FirstAttributeSelectorM atch; } 261 bool isAttributeSelector() const { return m_match >= FirstAttributeSelectorM atch; }
262 bool isHostPseudoClass() const { return m_pseudoType == PseudoHost || m_pseu doType == PseudoHostContext; } 262 bool isHostPseudoClass() const { return m_pseudoType == PseudoHost || m_pseu doType == PseudoHostContext; }
263 bool isUserActionPseudoClass() const;
263 bool isInsertionPointCrossing() const { return m_pseudoType == PseudoHostCon text || m_pseudoType == PseudoContent; } 264 bool isInsertionPointCrossing() const { return m_pseudoType == PseudoHostCon text || m_pseudoType == PseudoContent; }
264 265
265 RelationType relation() const { return static_cast<RelationType>(m_relation) ; } 266 RelationType relation() const { return static_cast<RelationType>(m_relation) ; }
266 void setRelation(RelationType relation) 267 void setRelation(RelationType relation)
267 { 268 {
268 m_relation = relation; 269 m_relation = relation;
269 ASSERT(static_cast<RelationType>(m_relation) == relation); // using a bi tfield. 270 ASSERT(static_cast<RelationType>(m_relation) == relation); // using a bi tfield.
270 } 271 }
271 272
272 MatchType match() const { return static_cast<MatchType>(m_match); } 273 MatchType match() const { return static_cast<MatchType>(m_match); }
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 inline const AtomicString& CSSSelector::serializingValue() const 477 inline const AtomicString& CSSSelector::serializingValue() const
477 { 478 {
478 ASSERT(m_match != Tag); 479 ASSERT(m_match != Tag);
479 if (m_hasRareData) 480 if (m_hasRareData)
480 return m_data.m_rareData->m_serializingValue; 481 return m_data.m_rareData->m_serializingValue;
481 // AtomicString is really just a StringImpl* so the cast below is safe. 482 // AtomicString is really just a StringImpl* so the cast below is safe.
482 // FIXME: Perhaps call sites could be changed to accept StringImpl? 483 // FIXME: Perhaps call sites could be changed to accept StringImpl?
483 return *reinterpret_cast<const AtomicString*>(&m_data.m_value); 484 return *reinterpret_cast<const AtomicString*>(&m_data.m_value);
484 } 485 }
485 486
487 inline bool CSSSelector::isUserActionPseudoClass() const
488 {
489 return m_pseudoType == PseudoHover
490 || m_pseudoType == PseudoActive
491 || m_pseudoType == PseudoFocus
492 || m_pseudoType == PseudoDrag;
493 }
494
486 } // namespace blink 495 } // namespace blink
487 496
488 #endif // CSSSelector_h 497 #endif // CSSSelector_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/css/SelectorChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698