| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |