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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 generatedContentContainer = RenderObject::createObject(owner->do
cument(), pseudoElementStyle); | 510 generatedContentContainer = RenderObject::createObject(owner->do
cument(), pseudoElementStyle); |
511 ASSERT(styledObject->node()); // The styled object cannot be ano
nymous or else it could not have ':before' or ':after' pseudo elements. | 511 ASSERT(styledObject->node()); // The styled object cannot be ano
nymous or else it could not have ':before' or ':after' pseudo elements. |
512 generatedContentContainer->setNode(styledObject->node()); // Thi
s allows access to the generatingNode. | 512 generatedContentContainer->setNode(styledObject->node()); // Thi
s allows access to the generatingNode. |
513 generatedContentContainer->setStyle(pseudoElementStyle); | 513 generatedContentContainer->setStyle(pseudoElementStyle); |
514 if (!owner->isChildAllowed(generatedContentContainer, pseudoElem
entStyle)) { | 514 if (!owner->isChildAllowed(generatedContentContainer, pseudoElem
entStyle)) { |
515 // The generated content container is not allowed here -> ab
ort. | 515 // The generated content container is not allowed here -> ab
ort. |
516 generatedContentContainer->destroy(); | 516 generatedContentContainer->destroy(); |
517 renderer->destroy(); | 517 renderer->destroy(); |
518 return; | 518 return; |
519 } | 519 } |
520 owner->addChild(generatedContentContainer, insertBefore); | 520 |
| 521 // When we don't have a first child and are part of a continuati
on chain, |
| 522 // insertBefore is incorrectly set to zero above, which causes t
he :before |
| 523 // child to end up at the end of continuation chain. |
| 524 // See https://bugs.webkit.org/show_bug.cgi?id=78380. |
| 525 if (!insertBefore && type == BEFORE && owner->virtualContinuatio
n()) |
| 526 owner->addChildIgnoringContinuation(generatedContentContaine
r, 0); |
| 527 else |
| 528 owner->addChild(generatedContentContainer, insertBefore); |
521 } | 529 } |
522 if (generatedContentContainer->isChildAllowed(renderer, pseudoElemen
tStyle)) | 530 if (generatedContentContainer->isChildAllowed(renderer, pseudoElemen
tStyle)) |
523 generatedContentContainer->addChild(renderer); | 531 generatedContentContainer->addChild(renderer); |
524 else | 532 else |
525 renderer->destroy(); | 533 renderer->destroy(); |
526 } | 534 } |
527 } | 535 } |
528 } | 536 } |
529 | 537 |
530 } // namespace WebCore | 538 } // namespace WebCore |
OLD | NEW |