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

Side by Side Diff: Source/core/layout/LayoutText.cpp

Issue 1055683008: Rename variable name from renderText to layoutText (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.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
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "platform/text/TextRunIterator.h" 48 #include "platform/text/TextRunIterator.h"
49 #include "wtf/text/StringBuffer.h" 49 #include "wtf/text/StringBuffer.h"
50 #include "wtf/text/StringBuilder.h" 50 #include "wtf/text/StringBuilder.h"
51 #include "wtf/unicode/CharacterNames.h" 51 #include "wtf/unicode/CharacterNames.h"
52 52
53 using namespace WTF; 53 using namespace WTF;
54 using namespace Unicode; 54 using namespace Unicode;
55 55
56 namespace blink { 56 namespace blink {
57 57
58 struct SameSizeAsRenderText : public LayoutObject { 58 struct SameSizeAsLayoutText : public LayoutObject {
59 uint32_t bitfields : 16; 59 uint32_t bitfields : 16;
60 float widths[4]; 60 float widths[4];
61 String text; 61 String text;
62 void* pointers[2]; 62 void* pointers[2];
63 }; 63 };
64 64
65 static_assert(sizeof(LayoutText) == sizeof(SameSizeAsRenderText), "LayoutText sh ould stay small"); 65 static_assert(sizeof(LayoutText) == sizeof(SameSizeAsLayoutText), "LayoutText sh ould stay small");
66 66
67 class SecureTextTimer; 67 class SecureTextTimer;
68 typedef HashMap<LayoutText*, SecureTextTimer*> SecureTextTimerMap; 68 typedef HashMap<LayoutText*, SecureTextTimer*> SecureTextTimerMap;
69 static SecureTextTimerMap* gSecureTextTimers = 0; 69 static SecureTextTimerMap* gSecureTextTimers = 0;
70 70
71 class SecureTextTimer final : public TimerBase { 71 class SecureTextTimer final : public TimerBase {
72 public: 72 public:
73 SecureTextTimer(LayoutText* renderText) 73 SecureTextTimer(LayoutText* layoutText)
74 : m_renderText(renderText) 74 : m_layoutText(layoutText)
75 , m_lastTypedCharacterOffset(-1) 75 , m_lastTypedCharacterOffset(-1)
76 { 76 {
77 } 77 }
78 78
79 void restartWithNewText(unsigned lastTypedCharacterOffset) 79 void restartWithNewText(unsigned lastTypedCharacterOffset)
80 { 80 {
81 m_lastTypedCharacterOffset = lastTypedCharacterOffset; 81 m_lastTypedCharacterOffset = lastTypedCharacterOffset;
82 if (Settings* settings = m_renderText->document().settings()) 82 if (Settings* settings = m_layoutText->document().settings())
83 startOneShot(settings->passwordEchoDurationInSeconds(), FROM_HERE); 83 startOneShot(settings->passwordEchoDurationInSeconds(), FROM_HERE);
84 } 84 }
85 void invalidate() { m_lastTypedCharacterOffset = -1; } 85 void invalidate() { m_lastTypedCharacterOffset = -1; }
86 unsigned lastTypedCharacterOffset() { return m_lastTypedCharacterOffset; } 86 unsigned lastTypedCharacterOffset() { return m_lastTypedCharacterOffset; }
87 87
88 private: 88 private:
89 virtual void fired() override 89 virtual void fired() override
90 { 90 {
91 ASSERT(gSecureTextTimers->contains(m_renderText)); 91 ASSERT(gSecureTextTimers->contains(m_layoutText));
92 m_renderText->setText(m_renderText->text().impl(), true /* forcing setti ng text as it may be masked later */); 92 m_layoutText->setText(m_layoutText->text().impl(), true /* forcing setti ng text as it may be masked later */);
93 } 93 }
94 94
95 LayoutText* m_renderText; 95 LayoutText* m_layoutText;
96 int m_lastTypedCharacterOffset; 96 int m_lastTypedCharacterOffset;
97 }; 97 };
98 98
99 static void makeCapitalized(String* string, UChar previous) 99 static void makeCapitalized(String* string, UChar previous)
100 { 100 {
101 if (string->isNull()) 101 if (string->isNull())
102 return; 102 return;
103 103
104 unsigned length = string->length(); 104 unsigned length = string->length();
105 const StringImpl& input = *string->impl(); 105 const StringImpl& input = *string->impl();
(...skipping 1748 matching lines...) Expand 10 before | Expand all | Expand 10 after
1854 } 1854 }
1855 1855
1856 void LayoutText::invalidateDisplayItemClients(const LayoutBoxModelObject& paintI nvalidationContainer) const 1856 void LayoutText::invalidateDisplayItemClients(const LayoutBoxModelObject& paintI nvalidationContainer) const
1857 { 1857 {
1858 LayoutObject::invalidateDisplayItemClients(paintInvalidationContainer); 1858 LayoutObject::invalidateDisplayItemClients(paintInvalidationContainer);
1859 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) 1859 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
1860 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box); 1860 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box);
1861 } 1861 }
1862 1862
1863 } // namespace blink 1863 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutBlockFlowLine.cpp ('k') | Source/core/layout/line/AbstractInlineTextBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698