Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: Source/core/dom/PseudoElement.cpp

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix a crashers (everything is building!) Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698