Chromium Code Reviews

Side by Side Diff: third_party/WebKit/Source/core/dom/ContainerNode.h

Issue 2795143004: [selectors4] Implement :focus-within pseudo-class (Closed)
Patch Set: Now passing all the tests from WPT Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2013 Apple Inc. All 5 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2013 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 38 matching lines...)
49 kChildrenOrSiblingsAffectedByActive = 1 << 2, 49 kChildrenOrSiblingsAffectedByActive = 1 << 2,
50 kChildrenOrSiblingsAffectedByDrag = 1 << 3, 50 kChildrenOrSiblingsAffectedByDrag = 1 << 3,
51 kChildrenAffectedByFirstChildRules = 1 << 4, 51 kChildrenAffectedByFirstChildRules = 1 << 4,
52 kChildrenAffectedByLastChildRules = 1 << 5, 52 kChildrenAffectedByLastChildRules = 1 << 5,
53 kChildrenAffectedByDirectAdjacentRules = 1 << 6, 53 kChildrenAffectedByDirectAdjacentRules = 1 << 6,
54 kChildrenAffectedByIndirectAdjacentRules = 1 << 7, 54 kChildrenAffectedByIndirectAdjacentRules = 1 << 7,
55 kChildrenAffectedByForwardPositionalRules = 1 << 8, 55 kChildrenAffectedByForwardPositionalRules = 1 << 8,
56 kChildrenAffectedByBackwardPositionalRules = 1 << 9, 56 kChildrenAffectedByBackwardPositionalRules = 1 << 9,
57 kAffectedByFirstChildRules = 1 << 10, 57 kAffectedByFirstChildRules = 1 << 10,
58 kAffectedByLastChildRules = 1 << 11, 58 kAffectedByLastChildRules = 1 << 11,
59 kChildrenOrSiblingsAffectedByFocusWithin = 1 << 12,
59 60
60 kNumberOfDynamicRestyleFlags = 12, 61 kNumberOfDynamicRestyleFlags = 13,
61 62
62 kChildrenAffectedByStructuralRules = 63 kChildrenAffectedByStructuralRules =
63 kChildrenAffectedByFirstChildRules | kChildrenAffectedByLastChildRules | 64 kChildrenAffectedByFirstChildRules | kChildrenAffectedByLastChildRules |
64 kChildrenAffectedByDirectAdjacentRules | 65 kChildrenAffectedByDirectAdjacentRules |
65 kChildrenAffectedByIndirectAdjacentRules | 66 kChildrenAffectedByIndirectAdjacentRules |
66 kChildrenAffectedByForwardPositionalRules | 67 kChildrenAffectedByForwardPositionalRules |
67 kChildrenAffectedByBackwardPositionalRules 68 kChildrenAffectedByBackwardPositionalRules
68 }; 69 };
69 70
70 enum SubtreeModificationAction { 71 enum SubtreeModificationAction {
(...skipping 60 matching lines...)
131 void RemoveChildren( 132 void RemoveChildren(
132 SubtreeModificationAction = kDispatchSubtreeModifiedEvent); 133 SubtreeModificationAction = kDispatchSubtreeModifiedEvent);
133 134
134 void CloneChildNodes(ContainerNode* clone); 135 void CloneChildNodes(ContainerNode* clone);
135 136
136 void AttachLayoutTree(const AttachContext& = AttachContext()) override; 137 void AttachLayoutTree(const AttachContext& = AttachContext()) override;
137 void DetachLayoutTree(const AttachContext& = AttachContext()) override; 138 void DetachLayoutTree(const AttachContext& = AttachContext()) override;
138 LayoutRect BoundingBox() const final; 139 LayoutRect BoundingBox() const final;
139 void SetFocused(bool) override; 140 void SetFocused(bool) override;
140 void FocusStateChanged(); 141 void FocusStateChanged();
142 void FocusWithinStateChanged();
141 void SetActive(bool = true) override; 143 void SetActive(bool = true) override;
142 void SetDragged(bool) override; 144 void SetDragged(bool) override;
143 void SetHovered(bool = true) override; 145 void SetHovered(bool = true) override;
144 146
145 bool ChildrenOrSiblingsAffectedByFocus() const { 147 bool ChildrenOrSiblingsAffectedByFocus() const {
146 return HasRestyleFlag(kChildrenOrSiblingsAffectedByFocus); 148 return HasRestyleFlag(kChildrenOrSiblingsAffectedByFocus);
147 } 149 }
148 void SetChildrenOrSiblingsAffectedByFocus() { 150 void SetChildrenOrSiblingsAffectedByFocus() {
149 SetRestyleFlag(kChildrenOrSiblingsAffectedByFocus); 151 SetRestyleFlag(kChildrenOrSiblingsAffectedByFocus);
150 } 152 }
151 153
154 bool ChildrenOrSiblingsAffectedByFocusWithin() const {
155 return HasRestyleFlag(kChildrenOrSiblingsAffectedByFocusWithin);
156 }
157 void SetChildrenOrSiblingsAffectedByFocusWithin() {
158 SetRestyleFlag(kChildrenOrSiblingsAffectedByFocusWithin);
159 }
160
152 bool ChildrenOrSiblingsAffectedByHover() const { 161 bool ChildrenOrSiblingsAffectedByHover() const {
153 return HasRestyleFlag(kChildrenOrSiblingsAffectedByHover); 162 return HasRestyleFlag(kChildrenOrSiblingsAffectedByHover);
154 } 163 }
155 void SetChildrenOrSiblingsAffectedByHover() { 164 void SetChildrenOrSiblingsAffectedByHover() {
156 SetRestyleFlag(kChildrenOrSiblingsAffectedByHover); 165 SetRestyleFlag(kChildrenOrSiblingsAffectedByHover);
157 } 166 }
158 167
159 bool ChildrenOrSiblingsAffectedByActive() const { 168 bool ChildrenOrSiblingsAffectedByActive() const {
160 return HasRestyleFlag(kChildrenOrSiblingsAffectedByActive); 169 return HasRestyleFlag(kChildrenOrSiblingsAffectedByActive);
161 } 170 }
(...skipping 312 matching lines...)
474 483
475 inline void GetChildNodes(ContainerNode& node, NodeVector& nodes) { 484 inline void GetChildNodes(ContainerNode& node, NodeVector& nodes) {
476 DCHECK(!nodes.size()); 485 DCHECK(!nodes.size());
477 for (Node* child = node.FirstChild(); child; child = child->nextSibling()) 486 for (Node* child = node.FirstChild(); child; child = child->nextSibling())
478 nodes.push_back(child); 487 nodes.push_back(child);
479 } 488 }
480 489
481 } // namespace blink 490 } // namespace blink
482 491
483 #endif // ContainerNode_h 492 #endif // ContainerNode_h
OLDNEW

Powered by Google App Engine