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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTextFragment.cpp

Issue 2741143002: Simplify LayoutTextFragment constructor. (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | 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 26 matching lines...) Expand all
37 : LayoutText(node, 37 : LayoutText(node,
38 str ? str->substring(startOffset, length) 38 str ? str->substring(startOffset, length)
39 : PassRefPtr<StringImpl>(nullptr)), 39 : PassRefPtr<StringImpl>(nullptr)),
40 m_start(startOffset), 40 m_start(startOffset),
41 m_fragmentLength(length), 41 m_fragmentLength(length),
42 m_isRemainingTextLayoutObject(false), 42 m_isRemainingTextLayoutObject(false),
43 m_contentString(str), 43 m_contentString(str),
44 m_firstLetterPseudoElement(nullptr) {} 44 m_firstLetterPseudoElement(nullptr) {}
45 45
46 LayoutTextFragment::LayoutTextFragment(Node* node, StringImpl* str) 46 LayoutTextFragment::LayoutTextFragment(Node* node, StringImpl* str)
47 : LayoutText(node, str), 47 : LayoutTextFragment(node, str, 0, str ? str->length() : 0) {}
48 m_start(0),
49 m_fragmentLength(str ? str->length() : 0),
50 m_isRemainingTextLayoutObject(false),
51 m_contentString(str),
52 m_firstLetterPseudoElement(nullptr) {}
53 48
54 LayoutTextFragment::~LayoutTextFragment() { 49 LayoutTextFragment::~LayoutTextFragment() {
55 ASSERT(!m_firstLetterPseudoElement); 50 ASSERT(!m_firstLetterPseudoElement);
56 } 51 }
57 52
58 void LayoutTextFragment::willBeDestroyed() { 53 void LayoutTextFragment::willBeDestroyed() {
59 if (m_isRemainingTextLayoutObject && m_firstLetterPseudoElement) 54 if (m_isRemainingTextLayoutObject && m_firstLetterPseudoElement)
60 m_firstLetterPseudoElement->setRemainingTextLayoutObject(nullptr); 55 m_firstLetterPseudoElement->setRemainingTextLayoutObject(nullptr);
61 m_firstLetterPseudoElement = nullptr; 56 m_firstLetterPseudoElement = nullptr;
62 LayoutText::willBeDestroyed(); 57 LayoutText::willBeDestroyed();
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 LayoutObject::updateHitTestResult(result, point); 150 LayoutObject::updateHitTestResult(result, point);
156 151
157 // If we aren't part of a first-letter element, or if we 152 // If we aren't part of a first-letter element, or if we
158 // are part of first-letter but we're the remaining text then return. 153 // are part of first-letter but we're the remaining text then return.
159 if (m_isRemainingTextLayoutObject || !firstLetterPseudoElement()) 154 if (m_isRemainingTextLayoutObject || !firstLetterPseudoElement())
160 return; 155 return;
161 result.setInnerNode(firstLetterPseudoElement()); 156 result.setInnerNode(firstLetterPseudoElement());
162 } 157 }
163 158
164 } // namespace blink 159 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698