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

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

Issue 2473743003: Call Element::rebuildLayoutTree from Document::updateStyle directly (Closed)
Patch Set: Commit the renames Created 4 years 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 break; 217 break;
218 } 218 }
219 } 219 }
220 220
221 void FirstLetterPseudoElement::setRemainingTextLayoutObject( 221 void FirstLetterPseudoElement::setRemainingTextLayoutObject(
222 LayoutTextFragment* fragment) { 222 LayoutTextFragment* fragment) {
223 // The text fragment we get our content from is being destroyed. We need 223 // The text fragment we get our content from is being destroyed. We need
224 // to tell our parent element to recalcStyle so we can get cleaned up 224 // to tell our parent element to recalcStyle so we can get cleaned up
225 // as well. 225 // as well.
226 if (!fragment) 226 if (!fragment)
227 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create( 227 parentNode()->markAncestorsWithChildNeedsReattachLayoutTree();
228 StyleChangeReason::PseudoClass));
229
230 m_remainingTextLayoutObject = fragment; 228 m_remainingTextLayoutObject = fragment;
231 } 229 }
232 230
233 void FirstLetterPseudoElement::attachLayoutTree(const AttachContext& context) { 231 void FirstLetterPseudoElement::attachLayoutTree(const AttachContext& context) {
234 PseudoElement::attachLayoutTree(context); 232 PseudoElement::attachLayoutTree(context);
235 attachFirstLetterTextLayoutObjects(); 233 attachFirstLetterTextLayoutObjects();
236 } 234 }
237 235
238 void FirstLetterPseudoElement::detachLayoutTree(const AttachContext& context) { 236 void FirstLetterPseudoElement::detachLayoutTree(const AttachContext& context) {
239 if (m_remainingTextLayoutObject) { 237 if (m_remainingTextLayoutObject) {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 340
343 // We only manage the style for the generated content items. 341 // We only manage the style for the generated content items.
344 if (!child->isText() && !child->isQuote() && !child->isImage()) 342 if (!child->isText() && !child->isQuote() && !child->isImage())
345 continue; 343 continue;
346 344
347 child->setPseudoStyle(layoutObject->mutableStyle()); 345 child->setPseudoStyle(layoutObject->mutableStyle());
348 } 346 }
349 } 347 }
350 348
351 } // namespace blink 349 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698