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

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

Issue 14846002: Implement the Custom Elements :unresolved pseudoclass (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Adds a test and fixes style sharing. Created 7 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 14 matching lines...) Expand all
25 * Boston, MA 02110-1301, USA. 25 * Boston, MA 02110-1301, USA.
26 */ 26 */
27 27
28 #include "config.h" 28 #include "config.h"
29 #include "core/css/SelectorChecker.h" 29 #include "core/css/SelectorChecker.h"
30 30
31 #include "HTMLNames.h" 31 #include "HTMLNames.h"
32 #include "core/css/CSSSelector.h" 32 #include "core/css/CSSSelector.h"
33 #include "core/css/CSSSelectorList.h" 33 #include "core/css/CSSSelectorList.h"
34 #include "core/css/SiblingTraversalStrategies.h" 34 #include "core/css/SiblingTraversalStrategies.h"
35 #include "core/dom/CustomElementRegistry.h"
35 #include "core/dom/Document.h" 36 #include "core/dom/Document.h"
36 #include "core/dom/NodeRenderStyle.h" 37 #include "core/dom/NodeRenderStyle.h"
37 #include "core/dom/ShadowRoot.h" 38 #include "core/dom/ShadowRoot.h"
38 #include "core/dom/StyledElement.h" 39 #include "core/dom/StyledElement.h"
39 #include "core/dom/Text.h" 40 #include "core/dom/Text.h"
40 #include "core/editing/FrameSelection.h" 41 #include "core/editing/FrameSelection.h"
41 #include "core/html/HTMLDocument.h" 42 #include "core/html/HTMLDocument.h"
42 #include "core/html/HTMLFrameElementBase.h" 43 #include "core/html/HTMLFrameElementBase.h"
43 #include "core/html/HTMLInputElement.h" 44 #include "core/html/HTMLInputElement.h"
44 #include "core/html/HTMLOptionElement.h" 45 #include "core/html/HTMLOptionElement.h"
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 return (element->isWebVTTElement() && toWebVTTElement(element)->isPa stNode()); 709 return (element->isWebVTTElement() && toWebVTTElement(element)->isPa stNode());
709 710
710 case CSSSelector::PseudoScope: 711 case CSSSelector::PseudoScope:
711 { 712 {
712 const Node* contextualReferenceNode = !context.scope || (context .behaviorAtBoundary & BoundaryBehaviorMask) == CrossesBoundary ? element->docume nt()->documentElement() : context.scope; 713 const Node* contextualReferenceNode = !context.scope || (context .behaviorAtBoundary & BoundaryBehaviorMask) == CrossesBoundary ? element->docume nt()->documentElement() : context.scope;
713 if (element == contextualReferenceNode) 714 if (element == contextualReferenceNode)
714 return true; 715 return true;
715 break; 716 break;
716 } 717 }
717 718
719 case CSSSelector::PseudoUnresolved:
720 if (element->isUnresolvedCustomElement())
721 return true;
722 break;
723
718 case CSSSelector::PseudoHorizontal: 724 case CSSSelector::PseudoHorizontal:
719 case CSSSelector::PseudoVertical: 725 case CSSSelector::PseudoVertical:
720 case CSSSelector::PseudoDecrement: 726 case CSSSelector::PseudoDecrement:
721 case CSSSelector::PseudoIncrement: 727 case CSSSelector::PseudoIncrement:
722 case CSSSelector::PseudoStart: 728 case CSSSelector::PseudoStart:
723 case CSSSelector::PseudoEnd: 729 case CSSSelector::PseudoEnd:
724 case CSSSelector::PseudoDoubleButton: 730 case CSSSelector::PseudoDoubleButton:
725 case CSSSelector::PseudoSingleButton: 731 case CSSSelector::PseudoSingleButton:
726 case CSSSelector::PseudoNoButton: 732 case CSSSelector::PseudoNoButton:
727 case CSSSelector::PseudoCornerPresent: 733 case CSSSelector::PseudoCornerPresent:
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 return element->focused() && isFrameFocused(element); 895 return element->focused() && isFrameFocused(element);
890 } 896 }
891 897
892 template 898 template
893 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps eudoId&, const DOMSiblingTraversalStrategy&) const; 899 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps eudoId&, const DOMSiblingTraversalStrategy&) const;
894 900
895 template 901 template
896 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps eudoId&, const ShadowDOMSiblingTraversalStrategy&) const; 902 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps eudoId&, const ShadowDOMSiblingTraversalStrategy&) const;
897 903
898 } 904 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698