| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
| 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
| 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // No first letter text to display, we're done. | 149 // No first letter text to display, we're done. |
| 150 // FIXME: This black-list of disallowed RenderText subclasses is fragile. cr
bug.com/422336. | 150 // FIXME: This black-list of disallowed RenderText subclasses is fragile. cr
bug.com/422336. |
| 151 // Should counter be on this list? What about RenderTextFragment? | 151 // Should counter be on this list? What about RenderTextFragment? |
| 152 if (!firstLetterTextRenderer || !firstLetterTextRenderer->isText() | 152 if (!firstLetterTextRenderer || !firstLetterTextRenderer->isText() |
| 153 || firstLetterTextRenderer->isBR() || toRenderText(firstLetterTextRender
er)->isWordBreak()) | 153 || firstLetterTextRenderer->isBR() || toRenderText(firstLetterTextRender
er)->isWordBreak()) |
| 154 return nullptr; | 154 return nullptr; |
| 155 | 155 |
| 156 return firstLetterTextRenderer; | 156 return firstLetterTextRenderer; |
| 157 } | 157 } |
| 158 | 158 |
| 159 PassRefPtrWillBeRawPtr<FirstLetterPseudoElement> FirstLetterPseudoElement::creat
e(Element* parent) | |
| 160 { | |
| 161 return adoptRefWillBeNoop(new FirstLetterPseudoElement(parent)); | |
| 162 } | |
| 163 | |
| 164 FirstLetterPseudoElement::FirstLetterPseudoElement(Element* parent) | 159 FirstLetterPseudoElement::FirstLetterPseudoElement(Element* parent) |
| 165 : PseudoElement(parent, FIRST_LETTER) | 160 : PseudoElement(parent, FIRST_LETTER) |
| 166 , m_remainingTextRenderer(nullptr) | 161 , m_remainingTextRenderer(nullptr) |
| 167 , m_needsUpdate(false) | 162 , m_needsUpdate(false) |
| 168 { | 163 { |
| 169 } | 164 } |
| 170 | 165 |
| 166 FirstLetterPseudoElement::~FirstLetterPseudoElement() |
| 167 { |
| 168 } |
| 169 |
| 170 void FirstLetterPseudoElement::trace(Visitor* visitor) |
| 171 { |
| 172 visitor->trace(m_remainingTextRenderer); |
| 173 PseudoElement::trace(visitor); |
| 174 } |
| 175 |
| 171 void FirstLetterPseudoElement::setNeedsUpdate() | 176 void FirstLetterPseudoElement::setNeedsUpdate() |
| 172 { | 177 { |
| 173 m_needsUpdate = true; | 178 m_needsUpdate = true; |
| 174 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(St
yleChangeReason::PseudoClass)); | 179 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(St
yleChangeReason::PseudoClass)); |
| 175 } | 180 } |
| 176 | 181 |
| 177 void FirstLetterPseudoElement::attach(const AttachContext& context) | 182 void FirstLetterPseudoElement::attach(const AttachContext& context) |
| 178 { | 183 { |
| 179 PseudoElement::attach(context); | 184 PseudoElement::attach(context); |
| 180 attachFirstLetterTextRenderers(); | 185 attachFirstLetterTextRenderers(); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 286 |
| 282 // We only manage the style for the generated content items. | 287 // We only manage the style for the generated content items. |
| 283 if (!child->isText() && !child->isQuote() && !child->isImage()) | 288 if (!child->isText() && !child->isQuote() && !child->isImage()) |
| 284 continue; | 289 continue; |
| 285 | 290 |
| 286 child->setPseudoStyle(renderer->style()); | 291 child->setPseudoStyle(renderer->style()); |
| 287 } | 292 } |
| 288 } | 293 } |
| 289 | 294 |
| 290 } // namespace blink | 295 } // namespace blink |
| OLD | NEW |