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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 return before; | 50 return before; |
51 default: | 51 default: |
52 return emptyString(); | 52 return emptyString(); |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 PseudoElement::PseudoElement(Element* parent, PseudoId pseudoId) | 56 PseudoElement::PseudoElement(Element* parent, PseudoId pseudoId) |
57 : Element(pseudoElementTagName(), &parent->document(), CreatePseudoElement) | 57 : Element(pseudoElementTagName(), &parent->document(), CreatePseudoElement) |
58 , m_pseudoId(pseudoId) | 58 , m_pseudoId(pseudoId) |
59 { | 59 { |
| 60 ScriptWrappable::init(this); |
| 61 |
60 ASSERT(pseudoId != NOPSEUDO); | 62 ASSERT(pseudoId != NOPSEUDO); |
61 setParentOrShadowHostNode(parent); | 63 setParentOrShadowHostNode(parent); |
62 setHasCustomStyleCallbacks(); | 64 setHasCustomStyleCallbacks(); |
63 } | 65 } |
64 | 66 |
65 PassRefPtr<RenderStyle> PseudoElement::customStyleForRenderer() | 67 PassRefPtr<RenderStyle> PseudoElement::customStyleForRenderer() |
66 { | 68 { |
67 return parentOrShadowHostElement()->renderer()->getCachedPseudoStyle(m_pseud
oId); | 69 return parentOrShadowHostElement()->renderer()->getCachedPseudoStyle(m_pseud
oId); |
68 } | 70 } |
69 | 71 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 116 |
115 // The style for the RenderTextFragment for first letter is managed by a
n enclosing block, not by us. | 117 // The style for the RenderTextFragment for first letter is managed by a
n enclosing block, not by us. |
116 if (child->style()->styleType() == FIRST_LETTER) | 118 if (child->style()->styleType() == FIRST_LETTER) |
117 continue; | 119 continue; |
118 | 120 |
119 child->setPseudoStyle(renderer->style()); | 121 child->setPseudoStyle(renderer->style()); |
120 } | 122 } |
121 } | 123 } |
122 | 124 |
123 } // namespace | 125 } // namespace |
OLD | NEW |