| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 } | 112 } |
| 113 | 113 |
| 114 void ShadowRoot::hostChildrenChanged() | 114 void ShadowRoot::hostChildrenChanged() |
| 115 { | 115 { |
| 116 if (!hasContentElement()) | 116 if (!hasContentElement()) |
| 117 return; | 117 return; |
| 118 // This results in forced detaching/attaching of the shadow render tree. See
ShadowRoot::recalcStyle(). | 118 // This results in forced detaching/attaching of the shadow render tree. See
ShadowRoot::recalcStyle(). |
| 119 setNeedsStyleRecalc(); | 119 setNeedsStyleRecalc(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool ShadowRoot::isInclusionSelectorActive() const |
| 123 { |
| 124 return m_inclusions && m_inclusions->hasCandidates(); |
| 125 } |
| 126 |
| 122 bool ShadowRoot::hasContentElement() const | 127 bool ShadowRoot::hasContentElement() const |
| 123 { | 128 { |
| 124 for (Node* n = firstChild(); n; n = n->traverseNextNode(this)) { | 129 for (Node* n = firstChild(); n; n = n->traverseNextNode(this)) { |
| 125 if (n->isContentElement()) | 130 if (n->isContentElement()) |
| 126 return true; | 131 return true; |
| 127 } | 132 } |
| 128 | 133 |
| 129 return false; | 134 return false; |
| 130 } | 135 } |
| 131 | 136 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 158 ShadowInclusionSelector* ShadowRoot::ensureInclusions() | 163 ShadowInclusionSelector* ShadowRoot::ensureInclusions() |
| 159 { | 164 { |
| 160 if (!m_inclusions) | 165 if (!m_inclusions) |
| 161 m_inclusions = adoptPtr(new ShadowInclusionSelector()); | 166 m_inclusions = adoptPtr(new ShadowInclusionSelector()); |
| 162 m_inclusions->willSelectOver(this); | 167 m_inclusions->willSelectOver(this); |
| 163 return m_inclusions.get(); | 168 return m_inclusions.get(); |
| 164 } | 169 } |
| 165 | 170 |
| 166 | 171 |
| 167 } | 172 } |
| OLD | NEW |