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

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

Issue 2727853002: [css-display] Support display: contents pseudo-elements.
Patch Set: [css-display] Support display: contents pseudos. Created 3 years, 8 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) 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 unsigned remainingLength = oldText.length() - length; 293 unsigned remainingLength = oldText.length() - length;
294 294
295 // Construct a text fragment for the text after the first letter. 295 // Construct a text fragment for the text after the first letter.
296 // This text fragment might be empty. 296 // This text fragment might be empty.
297 LayoutTextFragment* remainingText; 297 LayoutTextFragment* remainingText;
298 298
299 if (nextLayoutObject->node()) { 299 if (nextLayoutObject->node()) {
300 remainingText = new LayoutTextFragment( 300 remainingText = new LayoutTextFragment(
301 nextLayoutObject->node(), oldText.impl(), length, remainingLength); 301 nextLayoutObject->node(), oldText.impl(), length, remainingLength);
302 } else { 302 } else {
303 PseudoElement* owningPseudo = nextLayoutObject->ownerPseudoElement();
303 remainingText = LayoutTextFragment::createAnonymous( 304 remainingText = LayoutTextFragment::createAnonymous(
304 *this, oldText.impl(), length, remainingLength); 305 owningPseudo ? *owningPseudo : *this, oldText.impl(), length,
306 remainingLength);
rune 2017/04/04 14:23:41 I don't understand this. What is an ownerPseudoEle
emilio 2017/04/04 15:09:18 So this is specific to first-letter because first-
305 } 307 }
306 308
307 remainingText->setFirstLetterPseudoElement(this); 309 remainingText->setFirstLetterPseudoElement(this);
308 remainingText->setIsRemainingTextLayoutObject(true); 310 remainingText->setIsRemainingTextLayoutObject(true);
309 remainingText->setStyle(nextLayoutObject->mutableStyle()); 311 remainingText->setStyle(nextLayoutObject->mutableStyle());
310 312
311 if (remainingText->node()) 313 if (remainingText->node())
312 remainingText->node()->setLayoutObject(remainingText); 314 remainingText->node()->setLayoutObject(remainingText);
313 315
314 m_remainingTextLayoutObject = remainingText; 316 m_remainingTextLayoutObject = remainingText;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 351
350 // We only manage the style for the generated content items. 352 // We only manage the style for the generated content items.
351 if (!child->isText() && !child->isQuote() && !child->isImage()) 353 if (!child->isText() && !child->isQuote() && !child->isImage())
352 continue; 354 continue;
353 355
354 child->setPseudoStyle(layoutObject->mutableStyle()); 356 child->setPseudoStyle(layoutObject->mutableStyle());
355 } 357 }
356 } 358 }
357 359
358 } // namespace blink 360 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698