OLD | NEW |
1 /** | 1 /** |
2 * Copyright (C) 2011 Nokia Inc. All rights reserved. | 2 * Copyright (C) 2011 Nokia Inc. All rights reserved. |
3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 247 matching lines...) Loading... |
258 void LayoutQuote::updateText() | 258 void LayoutQuote::updateText() |
259 { | 259 { |
260 String text = computeText(); | 260 String text = computeText(); |
261 if (m_text == text) | 261 if (m_text == text) |
262 return; | 262 return; |
263 | 263 |
264 m_text = text; | 264 m_text = text; |
265 | 265 |
266 LayoutTextFragment* fragment = findFragmentChild(); | 266 LayoutTextFragment* fragment = findFragmentChild(); |
267 if (fragment) { | 267 if (fragment) { |
268 fragment->setStyle(mutableStyle()); | 268 fragment->setStyle(ComputedStyle::createWithInheritableProperties(styleR
ef())); |
269 fragment->setContentString(m_text.impl()); | 269 fragment->setContentString(m_text.impl()); |
270 } else { | 270 } else { |
271 fragment = new LayoutTextFragment(&document(), m_text.impl()); | 271 fragment = new LayoutTextFragment(&document(), m_text.impl()); |
272 fragment->setStyle(mutableStyle()); | 272 fragment->setStyle(ComputedStyle::createWithInheritableProperties(styleR
ef())); |
273 addChild(fragment); | 273 addChild(fragment); |
274 } | 274 } |
275 } | 275 } |
276 | 276 |
277 LayoutTextFragment* LayoutQuote::findFragmentChild() const | 277 LayoutTextFragment* LayoutQuote::findFragmentChild() const |
278 { | 278 { |
279 // We walk from the end of the child list because, if we've had a first-lett
er | 279 // We walk from the end of the child list because, if we've had a first-lett
er |
280 // LayoutObject inserted then the remaining text will be at the end. | 280 // LayoutObject inserted then the remaining text will be at the end. |
281 while (LayoutObject* child = lastChild()) { | 281 while (LayoutObject* child = lastChild()) { |
282 if (child->isText() && toLayoutText(child)->isTextFragment()) | 282 if (child->isText() && toLayoutText(child)->isTextFragment()) |
(...skipping 116 matching lines...) Loading... |
399 if (m_depth) | 399 if (m_depth) |
400 m_depth--; | 400 m_depth--; |
401 break; | 401 break; |
402 } | 402 } |
403 } | 403 } |
404 if (oldDepth != m_depth) | 404 if (oldDepth != m_depth) |
405 updateText(); | 405 updateText(); |
406 } | 406 } |
407 | 407 |
408 } // namespace blink | 408 } // namespace blink |
OLD | NEW |