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

Side by Side Diff: Source/WebCore/rendering/RenderText.cpp

Issue 10983086: Merge 129814 - REGRESSION(r129186): Pressing enter at the end of a line deletes the line (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1271/
Patch Set: Created 8 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 | « 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 * 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 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1249 } 1249 }
1250 1250
1251 // The containing block can be null in case of an orphaned tree. 1251 // The containing block can be null in case of an orphaned tree.
1252 RenderBlock* containingBlock = this->containingBlock(); 1252 RenderBlock* containingBlock = this->containingBlock();
1253 if (containingBlock && !containingBlock->isRenderView()) 1253 if (containingBlock && !containingBlock->isRenderView())
1254 containingBlock->setSelectionState(state); 1254 containingBlock->setSelectionState(state);
1255 } 1255 }
1256 1256
1257 void RenderText::setTextWithOffset(PassRefPtr<StringImpl> text, unsigned offset, unsigned len, bool force) 1257 void RenderText::setTextWithOffset(PassRefPtr<StringImpl> text, unsigned offset, unsigned len, bool force)
1258 { 1258 {
1259 if (!force && equal(m_text.impl(), text.get()))
1260 return;
1261
1259 unsigned oldLen = textLength(); 1262 unsigned oldLen = textLength();
1260 unsigned newLen = text->length(); 1263 unsigned newLen = text->length();
1261 int delta = newLen - oldLen; 1264 int delta = newLen - oldLen;
1262 unsigned end = len ? offset + len - 1 : offset; 1265 unsigned end = len ? offset + len - 1 : offset;
1263 1266
1264 RootInlineBox* firstRootBox = 0; 1267 RootInlineBox* firstRootBox = 0;
1265 RootInlineBox* lastRootBox = 0; 1268 RootInlineBox* lastRootBox = 0;
1266 1269
1267 bool dirtiedLines = false; 1270 bool dirtiedLines = false;
1268 1271
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1320 curr->setLineBreakPos(curr->lineBreakPos() + delta); 1323 curr->setLineBreakPos(curr->lineBreakPos() + delta);
1321 } 1324 }
1322 1325
1323 // If the text node is empty, dirty the line where new text will be inserted . 1326 // If the text node is empty, dirty the line where new text will be inserted .
1324 if (!firstTextBox() && parent()) { 1327 if (!firstTextBox() && parent()) {
1325 parent()->dirtyLinesFromChangedChild(this); 1328 parent()->dirtyLinesFromChangedChild(this);
1326 dirtiedLines = true; 1329 dirtiedLines = true;
1327 } 1330 }
1328 1331
1329 m_linesDirty = dirtiedLines; 1332 m_linesDirty = dirtiedLines;
1330 setText(text, force); 1333 setText(text, force || dirtiedLines);
1331 } 1334 }
1332 1335
1333 void RenderText::transformText() 1336 void RenderText::transformText()
1334 { 1337 {
1335 if (RefPtr<StringImpl> textToTransform = originalText()) 1338 if (RefPtr<StringImpl> textToTransform = originalText())
1336 setText(textToTransform.release(), true); 1339 setText(textToTransform.release(), true);
1337 } 1340 }
1338 1341
1339 static inline bool isInlineFlowOrEmptyText(const RenderObject* o) 1342 static inline bool isInlineFlowOrEmptyText(const RenderObject* o)
1340 { 1343 {
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
1911 1914
1912 SecureTextTimer* secureTextTimer = gSecureTextTimers->get(this); 1915 SecureTextTimer* secureTextTimer = gSecureTextTimers->get(this);
1913 if (!secureTextTimer) { 1916 if (!secureTextTimer) {
1914 secureTextTimer = new SecureTextTimer(this); 1917 secureTextTimer = new SecureTextTimer(this);
1915 gSecureTextTimers->add(this, secureTextTimer); 1918 gSecureTextTimers->add(this, secureTextTimer);
1916 } 1919 }
1917 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); 1920 secureTextTimer->restartWithNewText(lastTypedCharacterOffset);
1918 } 1921 }
1919 1922
1920 } // namespace WebCore 1923 } // namespace WebCore
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