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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 // When beforeAfterParent is not equal to child (e.g. in tables), | 424 // When beforeAfterParent is not equal to child (e.g. in tables), |
425 // we need to create new styles inheriting from pseudoElementStyle | 425 // we need to create new styles inheriting from pseudoElementStyle |
426 // on all the intermediate parents (leaving their display same). | 426 // on all the intermediate parents (leaving their display same). |
427 if (beforeAfterParent != child) { | 427 if (beforeAfterParent != child) { |
428 RenderObject* curr = beforeAfterParent; | 428 RenderObject* curr = beforeAfterParent; |
429 while (curr && curr != child) { | 429 while (curr && curr != child) { |
430 ASSERT(curr->isAnonymous()); | 430 ASSERT(curr->isAnonymous()); |
431 RefPtr<RenderStyle> newStyle = RenderStyle::create(); | 431 RefPtr<RenderStyle> newStyle = RenderStyle::create(); |
432 newStyle->inheritFrom(pseudoElementStyle); | 432 newStyle->inheritFrom(pseudoElementStyle); |
433 newStyle->setDisplay(curr->style()->display()); | 433 newStyle->setDisplay(curr->style()->display()); |
| 434 newStyle->setStyleType(curr->style()->styleType()); |
434 curr->setStyle(newStyle); | 435 curr->setStyle(newStyle); |
435 curr = curr->parent(); | 436 curr = curr->parent(); |
436 } | 437 } |
437 } | 438 } |
438 | 439 |
439 // Note that if we ever support additional types of generated conten
t (which should be way off | 440 // Note that if we ever support additional types of generated conten
t (which should be way off |
440 // in the future), this code will need to be patched. | 441 // in the future), this code will need to be patched. |
441 for (RenderObject* genChild = beforeAfterParent->firstChild(); genCh
ild; genChild = genChild->nextSibling()) { | 442 for (RenderObject* genChild = beforeAfterParent->firstChild(); genCh
ild; genChild = genChild->nextSibling()) { |
442 if (genChild->isText()) | 443 if (genChild->isText()) |
443 // Generated text content is a child whose style also needs
to be set to the pseudo-element style. | 444 // Generated text content is a child whose style also needs
to be set to the pseudo-element style. |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 } | 522 } |
522 if (generatedContentContainer->isChildAllowed(renderer, pseudoElemen
tStyle)) | 523 if (generatedContentContainer->isChildAllowed(renderer, pseudoElemen
tStyle)) |
523 generatedContentContainer->addChild(renderer); | 524 generatedContentContainer->addChild(renderer); |
524 else | 525 else |
525 renderer->destroy(); | 526 renderer->destroy(); |
526 } | 527 } |
527 } | 528 } |
528 } | 529 } |
529 | 530 |
530 } // namespace WebCore | 531 } // namespace WebCore |
OLD | NEW |