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

Side by Side Diff: sky/engine/core/rendering/RenderText.cpp

Issue 1070233002: Remove dead code around anonymous renderers. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 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 | « sky/engine/core/rendering/RenderParagraph.cpp ('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 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 struct SameSizeAsRenderText : public RenderObject { 57 struct SameSizeAsRenderText : public RenderObject {
58 uint32_t bitfields : 16; 58 uint32_t bitfields : 16;
59 float widths[4]; 59 float widths[4];
60 String text; 60 String text;
61 void* pointers[2]; 61 void* pointers[2];
62 }; 62 };
63 63
64 COMPILE_ASSERT(sizeof(RenderText) == sizeof(SameSizeAsRenderText), RenderText_sh ould_stay_small); 64 COMPILE_ASSERT(sizeof(RenderText) == sizeof(SameSizeAsRenderText), RenderText_sh ould_stay_small);
65 65
66 RenderText::RenderText(Node* node, PassRefPtr<StringImpl> str) 66 RenderText::RenderText(Node* node, PassRefPtr<StringImpl> str)
67 : RenderObject(!node || node->isDocumentNode() ? 0 : node) 67 : RenderObject(node)
68 , m_hasTab(false) 68 , m_hasTab(false)
69 , m_linesDirty(false) 69 , m_linesDirty(false)
70 , m_containsReversedText(false) 70 , m_containsReversedText(false)
71 , m_knownToHaveNoOverflowAndNoFallbackFonts(false) 71 , m_knownToHaveNoOverflowAndNoFallbackFonts(false)
72 , m_minWidth(-1) 72 , m_minWidth(-1)
73 , m_maxWidth(-1) 73 , m_maxWidth(-1)
74 , m_firstLineMinWidth(0) 74 , m_firstLineMinWidth(0)
75 , m_lastLineLineMinWidth(0) 75 , m_lastLineLineMinWidth(0)
76 , m_text(str) 76 , m_text(str)
77 , m_firstTextBox(0) 77 , m_firstTextBox(0)
78 , m_lastTextBox(0) 78 , m_lastTextBox(0)
79 { 79 {
80 ASSERT(m_text); 80 ASSERT(m_text);
81 // FIXME: Some clients of RenderText (and subclasses) pass Document as node to create anonymous renderer. 81 ASSERT(node && !node->isDocumentNode());
82 // They should be switched to passing null and using setDocumentForAnonymous .
83 if (node && node->isDocumentNode())
84 setDocumentForAnonymous(toDocument(node));
85 82
86 m_isAllASCII = m_text.containsOnlyASCII(); 83 m_isAllASCII = m_text.containsOnlyASCII();
87 m_canUseSimpleFontCodePath = computeCanUseSimpleFontCodePath(); 84 m_canUseSimpleFontCodePath = computeCanUseSimpleFontCodePath();
88 setIsText(); 85 setIsText();
89 } 86 }
90 87
91 #if ENABLE(ASSERT) 88 #if ENABLE(ASSERT)
92 89
93 RenderText::~RenderText() 90 RenderText::~RenderText()
94 { 91 {
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after
1577 ASSERT(child->prevTextBox() == prev); 1574 ASSERT(child->prevTextBox() == prev);
1578 prev = child; 1575 prev = child;
1579 } 1576 }
1580 ASSERT(prev == m_lastTextBox); 1577 ASSERT(prev == m_lastTextBox);
1581 #endif 1578 #endif
1582 } 1579 }
1583 1580
1584 #endif 1581 #endif
1585 1582
1586 } // namespace blink 1583 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderParagraph.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698