| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 } | 143 } |
| 144 | 144 |
| 145 bool PseudoElement::layoutObjectIsNeeded(const ComputedStyle& style) { | 145 bool PseudoElement::layoutObjectIsNeeded(const ComputedStyle& style) { |
| 146 return pseudoElementLayoutObjectIsNeeded(&style); | 146 return pseudoElementLayoutObjectIsNeeded(&style); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void PseudoElement::didRecalcStyle(StyleRecalcChange) { | 149 void PseudoElement::didRecalcStyle(StyleRecalcChange) { |
| 150 if (!layoutObject()) | 150 if (!layoutObject()) |
| 151 return; | 151 return; |
| 152 | 152 |
| 153 // The layoutObjects inside pseudo elements are anonymous so they don't get no
tified of recalcStyle and must have | 153 // The layoutObjects inside pseudo elements are anonymous so they don't get |
| 154 // the style propagated downward manually similar to LayoutObject::propagateSt
yleToAnonymousChildren. | 154 // notified of recalcStyle and must have the style propagated downward |
| 155 // manually similar to LayoutObject::propagateStyleToAnonymousChildren. |
| 155 LayoutObject* layoutObject = this->layoutObject(); | 156 LayoutObject* layoutObject = this->layoutObject(); |
| 156 for (LayoutObject* child = layoutObject->nextInPreOrder(layoutObject); child; | 157 for (LayoutObject* child = layoutObject->nextInPreOrder(layoutObject); child; |
| 157 child = child->nextInPreOrder(layoutObject)) { | 158 child = child->nextInPreOrder(layoutObject)) { |
| 158 // We only manage the style for the generated content items. | 159 // We only manage the style for the generated content items. |
| 159 if (!child->isText() && !child->isQuote() && !child->isImage()) | 160 if (!child->isText() && !child->isQuote() && !child->isImage()) |
| 160 continue; | 161 continue; |
| 161 | 162 |
| 162 child->setPseudoStyle(layoutObject->mutableStyle()); | 163 child->setPseudoStyle(layoutObject->mutableStyle()); |
| 163 } | 164 } |
| 164 } | 165 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 187 LayoutObject* ancestor = layoutObject()->parent(); | 188 LayoutObject* ancestor = layoutObject()->parent(); |
| 188 while (ancestor->isAnonymous() || | 189 while (ancestor->isAnonymous() || |
| 189 (ancestor->node() && ancestor->node()->isPseudoElement())) { | 190 (ancestor->node() && ancestor->node()->isPseudoElement())) { |
| 190 DCHECK(ancestor->parent()); | 191 DCHECK(ancestor->parent()); |
| 191 ancestor = ancestor->parent(); | 192 ancestor = ancestor->parent(); |
| 192 } | 193 } |
| 193 return ancestor->node(); | 194 return ancestor->node(); |
| 194 } | 195 } |
| 195 | 196 |
| 196 } // namespace blink | 197 } // namespace blink |
| OLD | NEW |