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

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

Issue 2754653002: Cleanup anonymous text objects that pass the document as a node. (Closed)
Patch Set: Cleanup anonymous text objects that pass the document as a node. Created 3 years, 9 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
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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 if (!layoutObject) 125 if (!layoutObject)
126 return; 126 return;
127 127
128 ComputedStyle& style = layoutObject->mutableStyleRef(); 128 ComputedStyle& style = layoutObject->mutableStyleRef();
129 if (style.styleType() != PseudoIdBefore && style.styleType() != PseudoIdAfter) 129 if (style.styleType() != PseudoIdBefore && style.styleType() != PseudoIdAfter)
130 return; 130 return;
131 DCHECK(style.contentData()); 131 DCHECK(style.contentData());
132 132
133 for (const ContentData* content = style.contentData(); content; 133 for (const ContentData* content = style.contentData(); content;
134 content = content->next()) { 134 content = content->next()) {
135 LayoutObject* child = content->createLayoutObject(document(), style); 135 LayoutObject* child = content->createLayoutObject(*this, style);
136 if (layoutObject->isChildAllowed(child, style)) { 136 if (layoutObject->isChildAllowed(child, style)) {
137 layoutObject->addChild(child); 137 layoutObject->addChild(child);
138 if (child->isQuote()) 138 if (child->isQuote())
139 toLayoutQuote(child)->attachQuote(); 139 toLayoutQuote(child)->attachQuote();
140 } else { 140 } else {
141 child->destroy(); 141 child->destroy();
142 } 142 }
143 } 143 }
144 } 144 }
145 145
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 LayoutObject* ancestor = layoutObject()->parent(); 189 LayoutObject* ancestor = layoutObject()->parent();
190 while (ancestor->isAnonymous() || 190 while (ancestor->isAnonymous() ||
191 (ancestor->node() && ancestor->node()->isPseudoElement())) { 191 (ancestor->node() && ancestor->node()->isPseudoElement())) {
192 DCHECK(ancestor->parent()); 192 DCHECK(ancestor->parent());
193 ancestor = ancestor->parent(); 193 ancestor = ancestor->parent();
194 } 194 }
195 return ancestor->node(); 195 return ancestor->node();
196 } 196 }
197 197
198 } // namespace blink 198 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/FirstLetterPseudoElement.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698