OLD | NEW |
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) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
7 * Copyright (C) 2011 Google Inc. All rights reserved. | 7 * Copyright (C) 2011 Google Inc. 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 251 |
252 moveToFlowThreadIfNeeded(); | 252 moveToFlowThreadIfNeeded(); |
253 | 253 |
254 if (!element->rendererIsNeeded(*this)) | 254 if (!element->rendererIsNeeded(*this)) |
255 return; | 255 return; |
256 | 256 |
257 RenderObject* parentRenderer = this->parentRenderer(); | 257 RenderObject* parentRenderer = this->parentRenderer(); |
258 RenderObject* nextRenderer = this->nextRenderer(); | 258 RenderObject* nextRenderer = this->nextRenderer(); |
259 | 259 |
260 Document* document = element->document(); | 260 Document* document = element->document(); |
261 RenderObject* newRenderer = element->createRenderer(document->renderArena(),
m_style.get()); | 261 RenderObject* newRenderer = element->createRenderer(m_style.get()); |
262 if (!newRenderer) | 262 if (!newRenderer) |
263 return; | 263 return; |
264 | 264 |
265 if (!parentRenderer->isChildAllowed(newRenderer, m_style.get())) { | 265 if (!parentRenderer->isChildAllowed(newRenderer, m_style.get())) { |
266 newRenderer->destroy(); | 266 newRenderer->destroy(); |
267 return; | 267 return; |
268 } | 268 } |
269 | 269 |
270 // Make sure the RenderObject already knows it is going to be added to a Ren
derFlowThread before we set the style | 270 // Make sure the RenderObject already knows it is going to be added to a Ren
derFlowThread before we set the style |
271 // for the first time. Otherwise code using inRenderFlowThread() in the styl
eWillChange and styleDidChange will fail. | 271 // for the first time. Otherwise code using inRenderFlowThread() in the styl
eWillChange and styleDidChange will fail. |
(...skipping 25 matching lines...) Expand all Loading... |
297 ASSERT(parentRenderer); | 297 ASSERT(parentRenderer); |
298 Document* document = textNode->document(); | 298 Document* document = textNode->document(); |
299 | 299 |
300 if (resetStyleInheritance()) | 300 if (resetStyleInheritance()) |
301 m_style = document->styleResolver()->defaultStyleForElement(); | 301 m_style = document->styleResolver()->defaultStyleForElement(); |
302 else | 302 else |
303 m_style = parentRenderer->style(); | 303 m_style = parentRenderer->style(); |
304 | 304 |
305 if (!textNode->textRendererIsNeeded(*this)) | 305 if (!textNode->textRendererIsNeeded(*this)) |
306 return; | 306 return; |
307 RenderText* newRenderer = textNode->createTextRenderer(document->renderArena
(), m_style.get()); | 307 RenderText* newRenderer = textNode->createTextRenderer(m_style.get()); |
308 if (!newRenderer) | 308 if (!newRenderer) |
309 return; | 309 return; |
310 if (!parentRenderer->isChildAllowed(newRenderer, m_style.get())) { | 310 if (!parentRenderer->isChildAllowed(newRenderer, m_style.get())) { |
311 newRenderer->destroy(); | 311 newRenderer->destroy(); |
312 return; | 312 return; |
313 } | 313 } |
314 | 314 |
315 // Make sure the RenderObject already knows it is going to be added to a Ren
derFlowThread before we set the style | 315 // Make sure the RenderObject already knows it is going to be added to a Ren
derFlowThread before we set the style |
316 // for the first time. Otherwise code using inRenderFlowThread() in the styl
eWillChange and styleDidChange will fail. | 316 // for the first time. Otherwise code using inRenderFlowThread() in the styl
eWillChange and styleDidChange will fail. |
317 newRenderer->setFlowThreadState(parentRenderer->flowThreadState()); | 317 newRenderer->setFlowThreadState(parentRenderer->flowThreadState()); |
318 | 318 |
319 RenderObject* nextRenderer = this->nextRenderer(); | 319 RenderObject* nextRenderer = this->nextRenderer(); |
320 textNode->setRenderer(newRenderer); | 320 textNode->setRenderer(newRenderer); |
321 // Parent takes care of the animations, no need to call setAnimatableStyle. | 321 // Parent takes care of the animations, no need to call setAnimatableStyle. |
322 newRenderer->setStyle(m_style.release()); | 322 newRenderer->setStyle(m_style.release()); |
323 parentRenderer->addChild(newRenderer, nextRenderer); | 323 parentRenderer->addChild(newRenderer, nextRenderer); |
324 } | 324 } |
325 | 325 |
326 } | 326 } |
OLD | NEW |