| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "config.h" | 27 #include "config.h" |
| 28 #include "PseudoElement.h" | 28 #include "PseudoElement.h" |
| 29 | 29 |
| 30 #include "ContentData.h" | 30 #include "ContentData.h" |
| 31 #include "NodeRenderingContext.h" | 31 #include "NodeRenderingContext.h" |
| 32 #include "RenderObject.h" | 32 #include "RenderObject.h" |
| 33 #include "RenderQuote.h" |
| 33 | 34 |
| 34 namespace WebCore { | 35 namespace WebCore { |
| 35 | 36 |
| 36 const QualifiedName& pseudoElementTagName() | 37 const QualifiedName& pseudoElementTagName() |
| 37 { | 38 { |
| 38 DEFINE_STATIC_LOCAL(QualifiedName, name, (nullAtom, "<pseudo>", nullAtom)); | 39 DEFINE_STATIC_LOCAL(QualifiedName, name, (nullAtom, "<pseudo>", nullAtom)); |
| 39 return name; | 40 return name; |
| 40 } | 41 } |
| 41 | 42 |
| 42 PseudoElement::PseudoElement(Element* parent, PseudoId pseudoId) | 43 PseudoElement::PseudoElement(Element* parent, PseudoId pseudoId) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 62 | 63 |
| 63 RenderObject* renderer = this->renderer(); | 64 RenderObject* renderer = this->renderer(); |
| 64 if (!renderer || !renderer->style()->regionThread().isEmpty()) | 65 if (!renderer || !renderer->style()->regionThread().isEmpty()) |
| 65 return; | 66 return; |
| 66 | 67 |
| 67 RenderStyle* style = renderer->style(); | 68 RenderStyle* style = renderer->style(); |
| 68 ASSERT(style->contentData()); | 69 ASSERT(style->contentData()); |
| 69 | 70 |
| 70 for (const ContentData* content = style->contentData(); content; content = c
ontent->next()) { | 71 for (const ContentData* content = style->contentData(); content; content = c
ontent->next()) { |
| 71 RenderObject* child = content->createRenderer(document(), style); | 72 RenderObject* child = content->createRenderer(document(), style); |
| 72 if (renderer->isChildAllowed(child, style)) | 73 if (renderer->isChildAllowed(child, style)) { |
| 73 renderer->addChild(child); | 74 renderer->addChild(child); |
| 74 else | 75 if (child->isQuote()) |
| 76 toRenderQuote(child)->attachQuote(); |
| 77 } else |
| 75 child->destroy(); | 78 child->destroy(); |
| 76 } | 79 } |
| 77 } | 80 } |
| 78 | 81 |
| 79 bool PseudoElement::rendererIsNeeded(const NodeRenderingContext& context) | 82 bool PseudoElement::rendererIsNeeded(const NodeRenderingContext& context) |
| 80 { | 83 { |
| 81 return pseudoElementRendererIsNeeded(context.style()); | 84 return pseudoElementRendererIsNeeded(context.style()); |
| 82 } | 85 } |
| 83 | 86 |
| 84 void PseudoElement::didRecalcStyle(StyleChange) | 87 void PseudoElement::didRecalcStyle(StyleChange) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 96 | 99 |
| 97 // The style for the RenderTextFragment for first letter is managed by a
n enclosing block, not by us. | 100 // The style for the RenderTextFragment for first letter is managed by a
n enclosing block, not by us. |
| 98 if (child->style()->styleType() == FIRST_LETTER) | 101 if (child->style()->styleType() == FIRST_LETTER) |
| 99 continue; | 102 continue; |
| 100 | 103 |
| 101 child->setPseudoStyle(renderer->style()); | 104 child->setPseudoStyle(renderer->style()); |
| 102 } | 105 } |
| 103 } | 106 } |
| 104 | 107 |
| 105 } // namespace | 108 } // namespace |
| OLD | NEW |