| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 void PseudoElement::attach(const AttachContext& context) | 113 void PseudoElement::attach(const AttachContext& context) |
| 114 { | 114 { |
| 115 ASSERT(!renderer()); | 115 ASSERT(!renderer()); |
| 116 | 116 |
| 117 Element::attach(context); | 117 Element::attach(context); |
| 118 | 118 |
| 119 RenderObject* renderer = this->renderer(); | 119 RenderObject* renderer = this->renderer(); |
| 120 if (!renderer) | 120 if (!renderer) |
| 121 return; | 121 return; |
| 122 | 122 |
| 123 RenderStyle* style = renderer->style(); | 123 RenderStyle* style = renderer->deprecatedMutableStyle(); |
| 124 if (style->styleType() != BEFORE && style->styleType() != AFTER) | 124 if (style->styleType() != BEFORE && style->styleType() != AFTER) |
| 125 return; | 125 return; |
| 126 ASSERT(style->contentData()); | 126 ASSERT(style->contentData()); |
| 127 | 127 |
| 128 for (const ContentData* content = style->contentData(); content; content = c
ontent->next()) { | 128 for (const ContentData* content = style->contentData(); content; content = c
ontent->next()) { |
| 129 RenderObject* child = content->createRenderer(document(), style); | 129 RenderObject* child = content->createRenderer(document(), style); |
| 130 if (renderer->isChildAllowed(child, style)) { | 130 if (renderer->isChildAllowed(child, style)) { |
| 131 renderer->addChild(child); | 131 renderer->addChild(child); |
| 132 if (child->isQuote()) | 132 if (child->isQuote()) |
| 133 toRenderQuote(child)->attachQuote(); | 133 toRenderQuote(child)->attachQuote(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 147 return; | 147 return; |
| 148 | 148 |
| 149 // The renderers inside pseudo elements are anonymous so they don't get noti
fied of recalcStyle and must have | 149 // The renderers inside pseudo elements are anonymous so they don't get noti
fied of recalcStyle and must have |
| 150 // the style propagated downward manually similar to RenderObject::propagate
StyleToAnonymousChildren. | 150 // the style propagated downward manually similar to RenderObject::propagate
StyleToAnonymousChildren. |
| 151 RenderObject* renderer = this->renderer(); | 151 RenderObject* renderer = this->renderer(); |
| 152 for (RenderObject* child = renderer->nextInPreOrder(renderer); child; child
= child->nextInPreOrder(renderer)) { | 152 for (RenderObject* child = renderer->nextInPreOrder(renderer); child; child
= child->nextInPreOrder(renderer)) { |
| 153 // We only manage the style for the generated content items. | 153 // We only manage the style for the generated content items. |
| 154 if (!child->isText() && !child->isQuote() && !child->isImage()) | 154 if (!child->isText() && !child->isQuote() && !child->isImage()) |
| 155 continue; | 155 continue; |
| 156 | 156 |
| 157 child->setPseudoStyle(renderer->style()); | 157 child->setPseudoStyle(renderer->deprecatedMutableStyle()); |
| 158 } | 158 } |
| 159 } | 159 } |
| 160 | 160 |
| 161 } // namespace | 161 } // namespace |
| OLD | NEW |