| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 } | 97 } |
| 98 | 98 |
| 99 void ShadowRoot::recalcStyle(StyleRecalcChange change) | 99 void ShadowRoot::recalcStyle(StyleRecalcChange change) |
| 100 { | 100 { |
| 101 if (styleChangeType() >= SubtreeStyleChange) | 101 if (styleChangeType() >= SubtreeStyleChange) |
| 102 change = Force; | 102 change = Force; |
| 103 | 103 |
| 104 // There's no style to update so just calling recalcStyle means we're update
d. | 104 // There's no style to update so just calling recalcStyle means we're update
d. |
| 105 clearNeedsStyleRecalc(); | 105 clearNeedsStyleRecalc(); |
| 106 | 106 |
| 107 // FIXME: This doesn't handle :hover + div properly like Element::recalcStyl
e does. | |
| 108 Text* lastTextNode = 0; | |
| 109 for (Node* child = lastChild(); child; child = child->previousSibling()) { | 107 for (Node* child = lastChild(); child; child = child->previousSibling()) { |
| 110 if (child->isTextNode()) { | 108 if (child->isTextNode()) { |
| 111 toText(child)->recalcTextStyle(change, lastTextNode); | 109 toText(child)->recalcTextStyle(change); |
| 112 lastTextNode = toText(child); | |
| 113 } else if (child->isElementNode()) { | 110 } else if (child->isElementNode()) { |
| 114 if (child->shouldCallRecalcStyle(change)) | 111 if (child->shouldCallRecalcStyle(change)) |
| 115 toElement(child)->recalcStyle(change, lastTextNode); | 112 toElement(child)->recalcStyle(change); |
| 116 if (child->renderer()) | |
| 117 lastTextNode = 0; | |
| 118 } | 113 } |
| 119 } | 114 } |
| 120 | 115 |
| 121 clearChildNeedsStyleRecalc(); | 116 clearChildNeedsStyleRecalc(); |
| 122 } | 117 } |
| 123 | 118 |
| 124 void ShadowRoot::insertedInto(ContainerNode* insertionPoint) | 119 void ShadowRoot::insertedInto(ContainerNode* insertionPoint) |
| 125 { | 120 { |
| 126 DocumentFragment::insertedInto(insertionPoint); | 121 DocumentFragment::insertedInto(insertionPoint); |
| 127 | 122 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 Vector<RefPtr<InsertionPoint> > insertionPoints; | 195 Vector<RefPtr<InsertionPoint> > insertionPoints; |
| 201 for (InsertionPoint* insertionPoint = Traversal<InsertionPoint>::firstWithin
(*this); insertionPoint; insertionPoint = Traversal<InsertionPoint>::next(*inser
tionPoint, this)) | 196 for (InsertionPoint* insertionPoint = Traversal<InsertionPoint>::firstWithin
(*this); insertionPoint; insertionPoint = Traversal<InsertionPoint>::next(*inser
tionPoint, this)) |
| 202 insertionPoints.append(insertionPoint); | 197 insertionPoints.append(insertionPoint); |
| 203 | 198 |
| 204 m_descendantInsertionPoints.swap(insertionPoints); | 199 m_descendantInsertionPoints.swap(insertionPoints); |
| 205 | 200 |
| 206 return m_descendantInsertionPoints; | 201 return m_descendantInsertionPoints; |
| 207 } | 202 } |
| 208 | 203 |
| 209 } | 204 } |
| OLD | NEW |