OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "core/dom/Node.h" | 30 #include "core/dom/Node.h" |
31 | 31 |
32 namespace blink { | 32 namespace blink { |
33 | 33 |
34 UserActionElementSet::UserActionElementSet() {} | 34 UserActionElementSet::UserActionElementSet() {} |
35 | 35 |
36 UserActionElementSet::~UserActionElementSet() {} | 36 UserActionElementSet::~UserActionElementSet() {} |
37 | 37 |
38 void UserActionElementSet::DidDetach(Element& element) { | 38 void UserActionElementSet::DidDetach(Element& element) { |
39 DCHECK(element.IsUserActionElement()); | 39 DCHECK(element.IsUserActionElement()); |
40 ClearFlags(&element, kIsActiveFlag | kInActiveChainFlag | kIsHoveredFlag); | 40 ClearFlags(&element, kIsActiveFlag | kInActiveChainFlag | kIsHoveredFlag | |
| 41 kHasFocusWithinFlag); |
41 } | 42 } |
42 | 43 |
43 bool UserActionElementSet::HasFlags(const Node* node, unsigned flags) const { | 44 bool UserActionElementSet::HasFlags(const Node* node, unsigned flags) const { |
44 DCHECK(node->IsUserActionElement() && node->IsElementNode()); | 45 DCHECK(node->IsUserActionElement() && node->IsElementNode()); |
45 return HasFlags(ToElement(node), flags); | 46 return HasFlags(ToElement(node), flags); |
46 } | 47 } |
47 | 48 |
48 void UserActionElementSet::SetFlags(Node* node, unsigned flags) { | 49 void UserActionElementSet::SetFlags(Node* node, unsigned flags) { |
49 if (!node->IsElementNode()) | 50 if (!node->IsElementNode()) |
50 return; | 51 return; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 100 |
100 element->SetUserActionElement(true); | 101 element->SetUserActionElement(true); |
101 elements_.insert(element, flags); | 102 elements_.insert(element, flags); |
102 } | 103 } |
103 | 104 |
104 DEFINE_TRACE(UserActionElementSet) { | 105 DEFINE_TRACE(UserActionElementSet) { |
105 visitor->Trace(elements_); | 106 visitor->Trace(elements_); |
106 } | 107 } |
107 | 108 |
108 } // namespace blink | 109 } // namespace blink |
OLD | NEW |