| 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 RenderObject* RenderObjectChildList::beforePseudoElementRenderer(const RenderObj
ect* owner) const | 292 RenderObject* RenderObjectChildList::beforePseudoElementRenderer(const RenderObj
ect* owner) const |
| 293 { | 293 { |
| 294 // An anonymous (generated) inline run-in that has PseudoId BEFORE must come
from a grandparent. | 294 // An anonymous (generated) inline run-in that has PseudoId BEFORE must come
from a grandparent. |
| 295 // Therefore we should skip these generated run-ins when checking our immedi
ate children. | 295 // Therefore we should skip these generated run-ins when checking our immedi
ate children. |
| 296 // If we don't find our :before child immediately, then we should check if w
e own a | 296 // If we don't find our :before child immediately, then we should check if w
e own a |
| 297 // generated inline run-in in the next level of children. | 297 // generated inline run-in in the next level of children. |
| 298 RenderObject* first = const_cast<RenderObject*>(owner); | 298 RenderObject* first = const_cast<RenderObject*>(owner); |
| 299 do { | 299 do { |
| 300 // Skip list markers and generated run-ins | 300 // Skip list markers and generated run-ins |
| 301 first = first->firstChild(); | 301 first = first->firstChild(); |
| 302 while (first && (first->isListMarker() || (first->isRenderInline() && fi
rst->isRunIn() && first->isAnonymous()))) | 302 while (first && first->isListMarker()) { |
| 303 if (first->parent() != owner && first->parent()->isAnonymousBlock()) |
| 304 first = first->parent(); |
| 305 first = first->nextSibling(); |
| 306 } |
| 307 while (first && first->isRenderInline() && first->isRunIn()) |
| 303 first = first->nextSibling(); | 308 first = first->nextSibling(); |
| 304 } while (first && first->isAnonymous() && first->style()->styleType() == NOP
SEUDO); | 309 } while (first && first->isAnonymous() && first->style()->styleType() == NOP
SEUDO); |
| 305 | 310 |
| 306 if (!first) | 311 if (!first) |
| 307 return 0; | 312 return 0; |
| 308 | 313 |
| 309 if (first->style()->styleType() == BEFORE) | 314 if (first->style()->styleType() == BEFORE) |
| 310 return first; | 315 return first; |
| 311 | 316 |
| 312 // Check for a possible generated run-in, using run-in positioning rules. | 317 // Check for a possible generated run-in, using run-in positioning rules. |
| 313 // Skip inlines and floating / positioned blocks, and place as the first chi
ld. | 318 // Skip inlines and floating / positioned blocks, and place as the first chi
ld. |
| 314 first = owner->firstChild(); | 319 first = owner->firstChild(); |
| 315 if (!first->isRenderBlock()) | 320 if (!first->isRenderBlock()) |
| 316 return 0; | 321 return 0; |
| 317 while (first && first->isFloatingOrPositioned()) | 322 while (first && first->isFloatingOrPositioned()) |
| 318 first = first->nextSibling(); | 323 first = first->nextSibling(); |
| 319 if (first) { | 324 if (first) { |
| 320 first = first->firstChild(); | 325 first = first->firstChild(); |
| 321 // We still need to skip any list markers that could exist before the ru
n-in. | 326 // We still need to skip any list markers that could exist before the ru
n-in. |
| 322 while (first && first->isListMarker()) | 327 while (first && first->isListMarker()) |
| 323 first = first->nextSibling(); | 328 first = first->nextSibling(); |
| 324 if (first && first->style()->styleType() == BEFORE && first->isRenderInl
ine() && first->isRunIn() && first->isAnonymous()) | 329 if (first && first->style()->styleType() == BEFORE && first->isRenderInl
ine() && first->isRunIn()) |
| 325 return first; | 330 return first; |
| 326 } | 331 } |
| 327 return 0; | 332 return 0; |
| 328 } | 333 } |
| 329 | 334 |
| 330 RenderObject* RenderObjectChildList::afterPseudoElementRenderer(const RenderObje
ct* owner) const | 335 RenderObject* RenderObjectChildList::afterPseudoElementRenderer(const RenderObje
ct* owner) const |
| 331 { | 336 { |
| 332 RenderObject* last = const_cast<RenderObject*>(owner); | 337 RenderObject* last = const_cast<RenderObject*>(owner); |
| 333 do { | 338 do { |
| 334 last = last->lastChild(); | 339 last = last->lastChild(); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 } | 521 } |
| 517 if (generatedContentContainer->isChildAllowed(renderer, pseudoElemen
tStyle)) | 522 if (generatedContentContainer->isChildAllowed(renderer, pseudoElemen
tStyle)) |
| 518 generatedContentContainer->addChild(renderer); | 523 generatedContentContainer->addChild(renderer); |
| 519 else | 524 else |
| 520 renderer->destroy(); | 525 renderer->destroy(); |
| 521 } | 526 } |
| 522 } | 527 } |
| 523 } | 528 } |
| 524 | 529 |
| 525 } // namespace WebCore | 530 } // namespace WebCore |
| OLD | NEW |