OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 251 |
252 static RenderObject* findBeforeAfterParent(RenderObject* object) | 252 static RenderObject* findBeforeAfterParent(RenderObject* object) |
253 { | 253 { |
254 // Only table parts need to search for the :before or :after parent | 254 // Only table parts need to search for the :before or :after parent |
255 if (!(object->isTable() || object->isTableSection() || object->isTableRow())
) | 255 if (!(object->isTable() || object->isTableSection() || object->isTableRow())
) |
256 return object; | 256 return object; |
257 | 257 |
258 RenderObject* beforeAfterParent = object; | 258 RenderObject* beforeAfterParent = object; |
259 while (beforeAfterParent && !(beforeAfterParent->isText() || beforeAfterPare
nt->isImage())) | 259 while (beforeAfterParent && !(beforeAfterParent->isText() || beforeAfterPare
nt->isImage())) |
260 beforeAfterParent = beforeAfterParent->firstChild(); | 260 beforeAfterParent = beforeAfterParent->firstChild(); |
261 return beforeAfterParent; | 261 return beforeAfterParent ? beforeAfterParent->parent() : 0; |
262 } | 262 } |
263 | 263 |
264 RenderObject* RenderObjectChildList::beforePseudoElementRenderer(const RenderObj
ect* owner) const | 264 RenderObject* RenderObjectChildList::beforePseudoElementRenderer(const RenderObj
ect* owner) const |
265 { | 265 { |
266 // An anonymous (generated) inline run-in that has PseudoId BEFORE must come
from a grandparent. | 266 // An anonymous (generated) inline run-in that has PseudoId BEFORE must come
from a grandparent. |
267 // Therefore we should skip these generated run-ins when checking our immedi
ate children. | 267 // Therefore we should skip these generated run-ins when checking our immedi
ate children. |
268 // If we don't find our :before child immediately, then we should check if w
e own a | 268 // If we don't find our :before child immediately, then we should check if w
e own a |
269 // generated inline run-in in the next level of children. | 269 // generated inline run-in in the next level of children. |
270 RenderObject* first = const_cast<RenderObject*>(owner); | 270 RenderObject* first = const_cast<RenderObject*>(owner); |
271 do { | 271 do { |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 } | 465 } |
466 if (generatedContentContainer->isChildAllowed(renderer, pseudoElemen
tStyle)) | 466 if (generatedContentContainer->isChildAllowed(renderer, pseudoElemen
tStyle)) |
467 generatedContentContainer->addChild(renderer); | 467 generatedContentContainer->addChild(renderer); |
468 else | 468 else |
469 renderer->destroy(); | 469 renderer->destroy(); |
470 } | 470 } |
471 } | 471 } |
472 } | 472 } |
473 | 473 |
474 } // namespace WebCore | 474 } // namespace WebCore |
OLD | NEW |