| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 107 } |
| 108 | 108 |
| 109 void ShadowRoot::hostChildrenChanged() | 109 void ShadowRoot::hostChildrenChanged() |
| 110 { | 110 { |
| 111 if (!hasContentElement()) | 111 if (!hasContentElement()) |
| 112 return; | 112 return; |
| 113 // This results in forced detaching/attaching of the shadow render tree. See
ShadowRoot::recalcStyle(). | 113 // This results in forced detaching/attaching of the shadow render tree. See
ShadowRoot::recalcStyle(). |
| 114 setNeedsStyleRecalc(); | 114 setNeedsStyleRecalc(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 bool ShadowRoot::isInclusionSelectorActive() const |
| 118 { |
| 119 return m_inclusions && m_inclusions->hasCandidates(); |
| 120 } |
| 121 |
| 117 bool ShadowRoot::hasContentElement() const | 122 bool ShadowRoot::hasContentElement() const |
| 118 { | 123 { |
| 119 for (Node* n = firstChild(); n; n = n->traverseNextNode(this)) { | 124 for (Node* n = firstChild(); n; n = n->traverseNextNode(this)) { |
| 120 if (n->isContentElement()) | 125 if (n->isContentElement()) |
| 121 return true; | 126 return true; |
| 122 } | 127 } |
| 123 | 128 |
| 124 return false; | 129 return false; |
| 125 } | 130 } |
| 126 | 131 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 153 ShadowInclusionSelector* ShadowRoot::ensureInclusions() | 158 ShadowInclusionSelector* ShadowRoot::ensureInclusions() |
| 154 { | 159 { |
| 155 if (!m_inclusions) | 160 if (!m_inclusions) |
| 156 m_inclusions = adoptPtr(new ShadowInclusionSelector()); | 161 m_inclusions = adoptPtr(new ShadowInclusionSelector()); |
| 157 m_inclusions->willSelectOver(this); | 162 m_inclusions->willSelectOver(this); |
| 158 return m_inclusions.get(); | 163 return m_inclusions.get(); |
| 159 } | 164 } |
| 160 | 165 |
| 161 | 166 |
| 162 } | 167 } |
| OLD | NEW |