Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: Source/core/rendering/RenderTextFragment.cpp

Issue 660413002: Detach first letter pseudo element during RenderTextFragment destruction. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git/+/master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/rendering/RenderTextFragment.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Dirk Mueller (mueller@kde.org) 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 , m_start(0) 46 , m_start(0)
47 , m_end(str ? str->length() : 0) 47 , m_end(str ? str->length() : 0)
48 , m_isRemainingTextRenderer(false) 48 , m_isRemainingTextRenderer(false)
49 , m_contentString(str) 49 , m_contentString(str)
50 , m_firstLetterPseudoElement(nullptr) 50 , m_firstLetterPseudoElement(nullptr)
51 { 51 {
52 } 52 }
53 53
54 RenderTextFragment::~RenderTextFragment() 54 RenderTextFragment::~RenderTextFragment()
55 { 55 {
56 #if !ENABLE(OILPAN) 56 ASSERT(!m_firstLetterPseudoElement);
57 }
58
59 void RenderTextFragment::destroy()
60 {
57 if (m_isRemainingTextRenderer && m_firstLetterPseudoElement) 61 if (m_isRemainingTextRenderer && m_firstLetterPseudoElement)
58 m_firstLetterPseudoElement->setRemainingTextRenderer(nullptr); 62 m_firstLetterPseudoElement->setRemainingTextRenderer(nullptr);
59 m_firstLetterPseudoElement = nullptr; 63 m_firstLetterPseudoElement = nullptr;
60 #endif 64 RenderText::destroy();
61 } 65 }
62 66
63 void RenderTextFragment::trace(Visitor* visitor) 67 void RenderTextFragment::trace(Visitor* visitor)
64 { 68 {
65 visitor->trace(m_firstLetterPseudoElement); 69 visitor->trace(m_firstLetterPseudoElement);
66 RenderText::trace(visitor); 70 RenderText::trace(visitor);
67 } 71 }
68 72
69 PassRefPtr<StringImpl> RenderTextFragment::completeText() const 73 PassRefPtr<StringImpl> RenderTextFragment::completeText() const
70 { 74 {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 FirstLetterPseudoElement* pseudo = toFirstLetterPseudoElement(node); 137 FirstLetterPseudoElement* pseudo = toFirstLetterPseudoElement(node);
134 RenderObject* nextRenderer = FirstLetterPseudoElement::firstLetterTextRe nderer(*pseudo); 138 RenderObject* nextRenderer = FirstLetterPseudoElement::firstLetterTextRe nderer(*pseudo);
135 if (!nextRenderer) 139 if (!nextRenderer)
136 return nullptr; 140 return nullptr;
137 node = nextRenderer->node(); 141 node = nextRenderer->node();
138 } 142 }
139 return (node && node->isTextNode()) ? toText(node) : nullptr; 143 return (node && node->isTextNode()) ? toText(node) : nullptr;
140 } 144 }
141 145
142 } // namespace blink 146 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderTextFragment.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698