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

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

Issue 2795143004: [selectors4] Implement :focus-within pseudo-class (Closed)
Patch Set: Rebased patch Created 3 years, 8 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 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 kChildrenOrSiblingsAffectedByActive = 1 << 2, 50 kChildrenOrSiblingsAffectedByActive = 1 << 2,
51 kChildrenOrSiblingsAffectedByDrag = 1 << 3, 51 kChildrenOrSiblingsAffectedByDrag = 1 << 3,
52 kChildrenAffectedByFirstChildRules = 1 << 4, 52 kChildrenAffectedByFirstChildRules = 1 << 4,
53 kChildrenAffectedByLastChildRules = 1 << 5, 53 kChildrenAffectedByLastChildRules = 1 << 5,
54 kChildrenAffectedByDirectAdjacentRules = 1 << 6, 54 kChildrenAffectedByDirectAdjacentRules = 1 << 6,
55 kChildrenAffectedByIndirectAdjacentRules = 1 << 7, 55 kChildrenAffectedByIndirectAdjacentRules = 1 << 7,
56 kChildrenAffectedByForwardPositionalRules = 1 << 8, 56 kChildrenAffectedByForwardPositionalRules = 1 << 8,
57 kChildrenAffectedByBackwardPositionalRules = 1 << 9, 57 kChildrenAffectedByBackwardPositionalRules = 1 << 9,
58 kAffectedByFirstChildRules = 1 << 10, 58 kAffectedByFirstChildRules = 1 << 10,
59 kAffectedByLastChildRules = 1 << 11, 59 kAffectedByLastChildRules = 1 << 11,
60 kChildrenOrSiblingsAffectedByFocusWithin = 1 << 12,
60 61
61 kNumberOfDynamicRestyleFlags = 12, 62 kNumberOfDynamicRestyleFlags = 13,
62 63
63 kChildrenAffectedByStructuralRules = 64 kChildrenAffectedByStructuralRules =
64 kChildrenAffectedByFirstChildRules | kChildrenAffectedByLastChildRules | 65 kChildrenAffectedByFirstChildRules | kChildrenAffectedByLastChildRules |
65 kChildrenAffectedByDirectAdjacentRules | 66 kChildrenAffectedByDirectAdjacentRules |
66 kChildrenAffectedByIndirectAdjacentRules | 67 kChildrenAffectedByIndirectAdjacentRules |
67 kChildrenAffectedByForwardPositionalRules | 68 kChildrenAffectedByForwardPositionalRules |
68 kChildrenAffectedByBackwardPositionalRules 69 kChildrenAffectedByBackwardPositionalRules
69 }; 70 };
70 71
71 enum SubtreeModificationAction { 72 enum SubtreeModificationAction {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 void RemoveChildren( 133 void RemoveChildren(
133 SubtreeModificationAction = kDispatchSubtreeModifiedEvent); 134 SubtreeModificationAction = kDispatchSubtreeModifiedEvent);
134 135
135 void CloneChildNodes(ContainerNode* clone); 136 void CloneChildNodes(ContainerNode* clone);
136 137
137 void AttachLayoutTree(const AttachContext& = AttachContext()) override; 138 void AttachLayoutTree(const AttachContext& = AttachContext()) override;
138 void DetachLayoutTree(const AttachContext& = AttachContext()) override; 139 void DetachLayoutTree(const AttachContext& = AttachContext()) override;
139 LayoutRect BoundingBox() const final; 140 LayoutRect BoundingBox() const final;
140 void SetFocused(bool, WebFocusType) override; 141 void SetFocused(bool, WebFocusType) override;
141 void FocusStateChanged(); 142 void FocusStateChanged();
143 void FocusWithinStateChanged();
142 void SetActive(bool = true) override; 144 void SetActive(bool = true) override;
143 void SetDragged(bool) override; 145 void SetDragged(bool) override;
144 void SetHovered(bool = true) override; 146 void SetHovered(bool = true) override;
145 147
146 bool ChildrenOrSiblingsAffectedByFocus() const { 148 bool ChildrenOrSiblingsAffectedByFocus() const {
147 return HasRestyleFlag(kChildrenOrSiblingsAffectedByFocus); 149 return HasRestyleFlag(kChildrenOrSiblingsAffectedByFocus);
148 } 150 }
149 void SetChildrenOrSiblingsAffectedByFocus() { 151 void SetChildrenOrSiblingsAffectedByFocus() {
150 SetRestyleFlag(kChildrenOrSiblingsAffectedByFocus); 152 SetRestyleFlag(kChildrenOrSiblingsAffectedByFocus);
151 } 153 }
152 154
155 bool ChildrenOrSiblingsAffectedByFocusWithin() const {
156 return HasRestyleFlag(kChildrenOrSiblingsAffectedByFocusWithin);
157 }
158 void SetChildrenOrSiblingsAffectedByFocusWithin() {
159 SetRestyleFlag(kChildrenOrSiblingsAffectedByFocusWithin);
160 }
161
153 bool ChildrenOrSiblingsAffectedByHover() const { 162 bool ChildrenOrSiblingsAffectedByHover() const {
154 return HasRestyleFlag(kChildrenOrSiblingsAffectedByHover); 163 return HasRestyleFlag(kChildrenOrSiblingsAffectedByHover);
155 } 164 }
156 void SetChildrenOrSiblingsAffectedByHover() { 165 void SetChildrenOrSiblingsAffectedByHover() {
157 SetRestyleFlag(kChildrenOrSiblingsAffectedByHover); 166 SetRestyleFlag(kChildrenOrSiblingsAffectedByHover);
158 } 167 }
159 168
160 bool ChildrenOrSiblingsAffectedByActive() const { 169 bool ChildrenOrSiblingsAffectedByActive() const {
161 return HasRestyleFlag(kChildrenOrSiblingsAffectedByActive); 170 return HasRestyleFlag(kChildrenOrSiblingsAffectedByActive);
162 } 171 }
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 484
476 inline void GetChildNodes(ContainerNode& node, NodeVector& nodes) { 485 inline void GetChildNodes(ContainerNode& node, NodeVector& nodes) {
477 DCHECK(!nodes.size()); 486 DCHECK(!nodes.size());
478 for (Node* child = node.FirstChild(); child; child = child->nextSibling()) 487 for (Node* child = node.FirstChild(); child; child = child->nextSibling())
479 nodes.push_back(child); 488 nodes.push_back(child);
480 } 489 }
481 490
482 } // namespace blink 491 } // namespace blink
483 492
484 #endif // ContainerNode_h 493 #endif // ContainerNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698