| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 default: | 79 default: |
| 80 return emptyString(); | 80 return emptyString(); |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 | 83 |
| 84 PseudoElement::PseudoElement(Element* parent, PseudoId pseudoId) | 84 PseudoElement::PseudoElement(Element* parent, PseudoId pseudoId) |
| 85 : Element(pseudoElementTagName(pseudoId), &parent->document(), CreateElement
) | 85 : Element(pseudoElementTagName(pseudoId), &parent->document(), CreateElement
) |
| 86 , m_pseudoId(pseudoId) | 86 , m_pseudoId(pseudoId) |
| 87 { | 87 { |
| 88 DCHECK_NE(pseudoId, PseudoIdNone); | 88 DCHECK_NE(pseudoId, PseudoIdNone); |
| 89 parent->treeScope().adoptIfNeeded(*this); | 89 parent->treeScopeOrDocument().adoptIfNeeded(*this); |
| 90 setParentOrShadowHostNode(parent); | 90 setParentOrShadowHostNode(parent); |
| 91 setHasCustomStyleCallbacks(); | 91 setHasCustomStyleCallbacks(); |
| 92 if ((pseudoId == PseudoIdBefore || pseudoId == PseudoIdAfter) && parent->has
TagName(HTMLNames::inputTag)) | 92 if ((pseudoId == PseudoIdBefore || pseudoId == PseudoIdAfter) && parent->has
TagName(HTMLNames::inputTag)) |
| 93 UseCounter::count(parent->document(), UseCounter::PseudoBeforeAfterForIn
putElement); | 93 UseCounter::count(parent->document(), UseCounter::PseudoBeforeAfterForIn
putElement); |
| 94 } | 94 } |
| 95 | 95 |
| 96 PassRefPtr<ComputedStyle> PseudoElement::customStyleForLayoutObject() | 96 PassRefPtr<ComputedStyle> PseudoElement::customStyleForLayoutObject() |
| 97 { | 97 { |
| 98 return parentOrShadowHostElement()->layoutObject()->getCachedPseudoStyle(m_p
seudoId); | 98 return parentOrShadowHostElement()->layoutObject()->getCachedPseudoStyle(m_p
seudoId); |
| 99 } | 99 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 // us and our parent so make sure we skip over them. | 187 // us and our parent so make sure we skip over them. |
| 188 LayoutObject* ancestor = layoutObject()->parent(); | 188 LayoutObject* ancestor = layoutObject()->parent(); |
| 189 while (ancestor->isAnonymous() || (ancestor->node() && ancestor->node()->isP
seudoElement())) { | 189 while (ancestor->isAnonymous() || (ancestor->node() && ancestor->node()->isP
seudoElement())) { |
| 190 DCHECK(ancestor->parent()); | 190 DCHECK(ancestor->parent()); |
| 191 ancestor = ancestor->parent(); | 191 ancestor = ancestor->parent(); |
| 192 } | 192 } |
| 193 return ancestor->node(); | 193 return ancestor->node(); |
| 194 } | 194 } |
| 195 | 195 |
| 196 } // namespace blink | 196 } // namespace blink |
| OLD | NEW |