| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 DCHECK(!nextSibling()); | 108 DCHECK(!nextSibling()); |
| 109 DCHECK(!previousSibling()); | 109 DCHECK(!previousSibling()); |
| 110 | 110 |
| 111 detach(); | 111 detach(); |
| 112 Element* parent = parentOrShadowHostElement(); | 112 Element* parent = parentOrShadowHostElement(); |
| 113 document().adoptIfNeeded(*this); | 113 document().adoptIfNeeded(*this); |
| 114 setParentOrShadowHostNode(0); | 114 setParentOrShadowHostNode(0); |
| 115 removedFrom(parent); | 115 removedFrom(parent); |
| 116 } | 116 } |
| 117 | 117 |
| 118 void PseudoElement::attach(const AttachContext& context) | 118 void PseudoElement::attachLayoutTree(const AttachContext& context) |
| 119 { | 119 { |
| 120 DCHECK(!layoutObject()); | 120 DCHECK(!layoutObject()); |
| 121 | 121 |
| 122 Element::attach(context); | 122 Element::attachLayoutTree(context); |
| 123 | 123 |
| 124 LayoutObject* layoutObject = this->layoutObject(); | 124 LayoutObject* layoutObject = this->layoutObject(); |
| 125 if (!layoutObject) | 125 if (!layoutObject) |
| 126 return; | 126 return; |
| 127 | 127 |
| 128 // This is to ensure that bypassing the canHaveGeneratedChildren check in | 128 // This is to ensure that bypassing the canHaveGeneratedChildren check in |
| 129 // StyleResolver::createPseudoElementIfNeeded does not result in the | 129 // StyleResolver::createPseudoElementIfNeeded does not result in the |
| 130 // backdrop pseudo element's layout object becoming the child of a layout | 130 // backdrop pseudo element's layout object becoming the child of a layout |
| 131 // object that doesn't allow children. | 131 // object that doesn't allow children. |
| 132 DCHECK(layoutObject->parent()); | 132 DCHECK(layoutObject->parent()); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 // us and our parent so make sure we skip over them. | 195 // us and our parent so make sure we skip over them. |
| 196 LayoutObject* ancestor = layoutObject()->parent(); | 196 LayoutObject* ancestor = layoutObject()->parent(); |
| 197 while (ancestor->isAnonymous() || (ancestor->node() && ancestor->node()->isP
seudoElement())) { | 197 while (ancestor->isAnonymous() || (ancestor->node() && ancestor->node()->isP
seudoElement())) { |
| 198 DCHECK(ancestor->parent()); | 198 DCHECK(ancestor->parent()); |
| 199 ancestor = ancestor->parent(); | 199 ancestor = ancestor->parent(); |
| 200 } | 200 } |
| 201 return ancestor->node(); | 201 return ancestor->node(); |
| 202 } | 202 } |
| 203 | 203 |
| 204 } // namespace blink | 204 } // namespace blink |
| OLD | NEW |