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

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

Issue 9695005: Merge 110323 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 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 | « Source/WebCore/rendering/RenderText.cpp ('k') | Source/WebCore/rendering/RenderWidget.cpp » ('j') | 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 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 } 480 }
481 } 481 }
482 } 482 }
483 483
484 os = os->nextInPreOrder(); 484 os = os->nextInPreOrder();
485 } 485 }
486 486
487 // Now clear the selection. 487 // Now clear the selection.
488 SelectedObjectMap::iterator oldObjectsEnd = oldSelectedObjects.end(); 488 SelectedObjectMap::iterator oldObjectsEnd = oldSelectedObjects.end();
489 for (SelectedObjectMap::iterator i = oldSelectedObjects.begin(); i != oldObj ectsEnd; ++i) 489 for (SelectedObjectMap::iterator i = oldSelectedObjects.begin(); i != oldObj ectsEnd; ++i)
490 i->first->setSelectionState(SelectionNone); 490 i->first->setSelectionStateIfNeeded(SelectionNone);
491 491
492 // set selection start and end 492 // set selection start and end
493 m_selectionStart = start; 493 m_selectionStart = start;
494 m_selectionStartPos = startPos; 494 m_selectionStartPos = startPos;
495 m_selectionEnd = end; 495 m_selectionEnd = end;
496 m_selectionEndPos = endPos; 496 m_selectionEndPos = endPos;
497 497
498 // Update the selection status of all objects between m_selectionStart and m _selectionEnd 498 // Update the selection status of all objects between m_selectionStart and m _selectionEnd
499 if (start && start == end) 499 if (start && start == end)
500 start->setSelectionState(SelectionBoth); 500 start->setSelectionStateIfNeeded(SelectionBoth);
501 else { 501 else {
502 if (start) 502 if (start)
503 start->setSelectionState(SelectionStart); 503 start->setSelectionStateIfNeeded(SelectionStart);
504 if (end) 504 if (end)
505 end->setSelectionState(SelectionEnd); 505 end->setSelectionStateIfNeeded(SelectionEnd);
506 } 506 }
507 507
508 RenderObject* o = start; 508 RenderObject* o = start;
509 stop = rendererAfterPosition(end, endPos); 509 stop = rendererAfterPosition(end, endPos);
510 510
511 while (o && o != stop) { 511 while (o && o != stop) {
512 if (o != start && o != end && o->canBeSelectionLeaf()) 512 if (o != start && o != end && o->canBeSelectionLeaf())
513 o->setSelectionState(SelectionInside); 513 o->setSelectionStateIfNeeded(SelectionInside);
514 o = o->nextInPreOrder(); 514 o = o->nextInPreOrder();
515 } 515 }
516 516
517 if (blockRepaintMode != RepaintNothing) 517 if (blockRepaintMode != RepaintNothing)
518 m_layer->clearBlockSelectionGapsBounds(); 518 m_layer->clearBlockSelectionGapsBounds();
519 519
520 // Now that the selection state has been updated for the new objects, walk t hem again and 520 // Now that the selection state has been updated for the new objects, walk t hem again and
521 // put them in the new objects list. 521 // put them in the new objects list.
522 o = start; 522 o = start;
523 while (o && o != stop) { 523 while (o && o != stop) {
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 } 925 }
926 926
927 RenderBlock::IntervalArena* RenderView::intervalArena() 927 RenderBlock::IntervalArena* RenderView::intervalArena()
928 { 928 {
929 if (!m_intervalArena) 929 if (!m_intervalArena)
930 m_intervalArena = IntervalArena::create(); 930 m_intervalArena = IntervalArena::create();
931 return m_intervalArena.get(); 931 return m_intervalArena.get();
932 } 932 }
933 933
934 } // namespace WebCore 934 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/RenderText.cpp ('k') | Source/WebCore/rendering/RenderWidget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698