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

Side by Side Diff: Source/core/rendering/RenderTextFragment.cpp

Issue 899163003: Move rendering/RenderObject to layout/LayoutObject. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « Source/core/rendering/RenderTextFragment.h ('k') | Source/core/rendering/RenderVTTCue.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Dirk Mueller (mueller@kde.org) 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 void RenderTextFragment::setText(PassRefPtr<StringImpl> text, bool force) 88 void RenderTextFragment::setText(PassRefPtr<StringImpl> text, bool force)
89 { 89 {
90 RenderText::setText(text, force); 90 RenderText::setText(text, force);
91 91
92 m_start = 0; 92 m_start = 0;
93 m_end = textLength(); 93 m_end = textLength();
94 94
95 // If we're the remaining text from a first letter then we have to tell the 95 // If we're the remaining text from a first letter then we have to tell the
96 // first letter pseudo element to reattach itself so it can re-calculate the 96 // first letter pseudo element to reattach itself so it can re-calculate the
97 // correct first-letter settings. 97 // correct first-letter settings.
98 if (RenderObject* previous = previousSibling()) { 98 if (LayoutObject* previous = previousSibling()) {
99 if (!previous->isPseudoElement() || !previous->node()->isFirstLetterPseu doElement()) 99 if (!previous->isPseudoElement() || !previous->node()->isFirstLetterPseu doElement())
100 return; 100 return;
101 101
102 // Tell the first letter container node, and the first-letter node 102 // Tell the first letter container node, and the first-letter node
103 // that their text content changed. 103 // that their text content changed.
104 toFirstLetterPseudoElement(previous->node())->updateTextFragments(); 104 toFirstLetterPseudoElement(previous->node())->updateTextFragments();
105 } 105 }
106 } 106 }
107 107
108 void RenderTextFragment::setTextFragment(PassRefPtr<StringImpl> text, unsigned s tart, unsigned length) 108 void RenderTextFragment::setTextFragment(PassRefPtr<StringImpl> text, unsigned s tart, unsigned length)
(...skipping 27 matching lines...) Expand all
136 // If this is the renderer for a first-letter pseudoNode then we have to look 136 // If this is the renderer for a first-letter pseudoNode then we have to look
137 // at the node for the remaining text to find our content. 137 // at the node for the remaining text to find our content.
138 Text* RenderTextFragment::associatedTextNode() const 138 Text* RenderTextFragment::associatedTextNode() const
139 { 139 {
140 Node* node = m_isRemainingTextRenderer ? this->node() : this->firstLetterPse udoElement(); 140 Node* node = m_isRemainingTextRenderer ? this->node() : this->firstLetterPse udoElement();
141 if (!node) 141 if (!node)
142 return nullptr; 142 return nullptr;
143 143
144 if (node->isFirstLetterPseudoElement()) { 144 if (node->isFirstLetterPseudoElement()) {
145 FirstLetterPseudoElement* pseudo = toFirstLetterPseudoElement(node); 145 FirstLetterPseudoElement* pseudo = toFirstLetterPseudoElement(node);
146 RenderObject* nextRenderer = FirstLetterPseudoElement::firstLetterTextRe nderer(*pseudo); 146 LayoutObject* nextRenderer = FirstLetterPseudoElement::firstLetterTextRe nderer(*pseudo);
147 if (!nextRenderer) 147 if (!nextRenderer)
148 return nullptr; 148 return nullptr;
149 node = nextRenderer->node(); 149 node = nextRenderer->node();
150 } 150 }
151 return (node && node->isTextNode()) ? toText(node) : nullptr; 151 return (node && node->isTextNode()) ? toText(node) : nullptr;
152 } 152 }
153 153
154 } // namespace blink 154 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderTextFragment.h ('k') | Source/core/rendering/RenderVTTCue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698