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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 // Images get an empty style that inherits from the pseudo. | 439 // Images get an empty style that inherits from the pseudo. |
440 RefPtr<RenderStyle> style = RenderStyle::create(); | 440 RefPtr<RenderStyle> style = RenderStyle::create(); |
441 style->inheritFrom(pseudoElementStyle); | 441 style->inheritFrom(pseudoElementStyle); |
442 genChild->setStyle(style.release()); | 442 genChild->setStyle(style.release()); |
443 } else { | 443 } else { |
444 // RenderListItem may insert a list marker here. We do not n
eed to care about this case. | 444 // RenderListItem may insert a list marker here. We do not n
eed to care about this case. |
445 // Otherwise, genChild must be a first-letter container. upd
ateFirstLetter() will take care of it. | 445 // Otherwise, genChild must be a first-letter container. upd
ateFirstLetter() will take care of it. |
446 ASSERT(genChild->isListMarker() || genChild->style()->styleT
ype() == FIRST_LETTER); | 446 ASSERT(genChild->isListMarker() || genChild->style()->styleT
ype() == FIRST_LETTER); |
447 } | 447 } |
448 } | 448 } |
| 449 |
| 450 // Update style on the remaining text fragment after the first-lette
r. |
| 451 if (beforeAfterParent->style()->styleType() == FIRST_LETTER) { |
| 452 if (RenderObject* nextSibling = beforeAfterParent->nextSibling()
) { |
| 453 if (nextSibling->isText() && nextSibling->style()->styleType
() == child->style()->styleType()) |
| 454 nextSibling->setStyle(pseudoElementStyle); |
| 455 } |
| 456 } |
449 } | 457 } |
450 return; // We've updated the generated content. That's all we needed to
do. | 458 return; // We've updated the generated content. That's all we needed to
do. |
451 } | 459 } |
452 | 460 |
453 RenderObject* insertBefore = (type == BEFORE) ? owner->virtualChildren()->fi
rstChild() : 0; | 461 RenderObject* insertBefore = (type == BEFORE) ? owner->virtualChildren()->fi
rstChild() : 0; |
454 if (insertBefore && insertBefore->isAnonymousBlock() && insertBefore->childr
enInline() && !insertBefore->isEmpty()) { | 462 if (insertBefore && insertBefore->isAnonymousBlock() && insertBefore->childr
enInline() && !insertBefore->isEmpty()) { |
455 // We are going to add the "before" element. We have to check whether th
e "insertBefore" element | 463 // We are going to add the "before" element. We have to check whether th
e "insertBefore" element |
456 // is an anonymous block with inline children. If it is, then we should
insert the "before" element | 464 // is an anonymous block with inline children. If it is, then we should
insert the "before" element |
457 // before the first inline child of the anonymous block, otherwise we wi
ll end up with the "before" | 465 // before the first inline child of the anonymous block, otherwise we wi
ll end up with the "before" |
458 // element in a different block. We do this only when the anonymous bloc
k has children, otherwise | 466 // element in a different block. We do this only when the anonymous bloc
k has children, otherwise |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 } | 522 } |
515 if (generatedContentContainer->isChildAllowed(renderer, pseudoElemen
tStyle)) | 523 if (generatedContentContainer->isChildAllowed(renderer, pseudoElemen
tStyle)) |
516 generatedContentContainer->addChild(renderer); | 524 generatedContentContainer->addChild(renderer); |
517 else | 525 else |
518 renderer->destroy(); | 526 renderer->destroy(); |
519 } | 527 } |
520 } | 528 } |
521 } | 529 } |
522 | 530 |
523 } // namespace WebCore | 531 } // namespace WebCore |
OLD | NEW |