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

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

Issue 138643003: Simpler return value of HashTable::add/HashMap:add and others (Closed)
Patch Set: Daily master update (now with base url?) Created 6 years, 10 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/core/rendering/RenderRegion.cpp ('k') | Source/core/rendering/shapes/ShapeInfo.h » ('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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 SelectionMap selectedObjects; 597 SelectionMap selectedObjects;
598 598
599 RenderObject* os = m_selectionStart; 599 RenderObject* os = m_selectionStart;
600 RenderObject* stop = rendererAfterPosition(m_selectionEnd, m_selectionEndPos ); 600 RenderObject* stop = rendererAfterPosition(m_selectionEnd, m_selectionEndPos );
601 while (os && os != stop) { 601 while (os && os != stop) {
602 if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selec tionEnd) && os->selectionState() != SelectionNone) { 602 if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selec tionEnd) && os->selectionState() != SelectionNone) {
603 // Blocks are responsible for painting line gaps and margin gaps. Th ey must be examined as well. 603 // Blocks are responsible for painting line gaps and margin gaps. Th ey must be examined as well.
604 selectedObjects.set(os, adoptPtr(new RenderSelectionInfo(os, clipToV isibleContent))); 604 selectedObjects.set(os, adoptPtr(new RenderSelectionInfo(os, clipToV isibleContent)));
605 RenderBlock* cb = os->containingBlock(); 605 RenderBlock* cb = os->containingBlock();
606 while (cb && !cb->isRenderView()) { 606 while (cb && !cb->isRenderView()) {
607 OwnPtr<RenderSelectionInfo>& blockInfo = selectedObjects.add(cb, nullptr).iterator->value; 607 OwnPtr<RenderSelectionInfo>& blockInfo = selectedObjects.add(cb, nullptr).storedValue->value;
608 if (blockInfo) 608 if (blockInfo)
609 break; 609 break;
610 blockInfo = adoptPtr(new RenderSelectionInfo(cb, clipToVisibleCo ntent)); 610 blockInfo = adoptPtr(new RenderSelectionInfo(cb, clipToVisibleCo ntent));
611 cb = cb->containingBlock(); 611 cb = cb->containingBlock();
612 } 612 }
613 } 613 }
614 614
615 os = os->nextInPreOrder(); 615 os = os->nextInPreOrder();
616 } 616 }
617 617
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 RenderObject* stop = rendererAfterPosition(m_selectionEnd, m_selectionEndPos ); 725 RenderObject* stop = rendererAfterPosition(m_selectionEnd, m_selectionEndPos );
726 bool exploringBackwards = false; 726 bool exploringBackwards = false;
727 bool continueExploring = os && (os != stop); 727 bool continueExploring = os && (os != stop);
728 while (continueExploring) { 728 while (continueExploring) {
729 if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selec tionEnd) && os->selectionState() != SelectionNone) { 729 if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selec tionEnd) && os->selectionState() != SelectionNone) {
730 // Blocks are responsible for painting line gaps and margin gaps. T hey must be examined as well. 730 // Blocks are responsible for painting line gaps and margin gaps. T hey must be examined as well.
731 oldSelectedObjects.set(os, adoptPtr(new RenderSelectionInfo(os, true ))); 731 oldSelectedObjects.set(os, adoptPtr(new RenderSelectionInfo(os, true )));
732 if (blockRepaintMode == RepaintNewXOROld) { 732 if (blockRepaintMode == RepaintNewXOROld) {
733 RenderBlock* cb = os->containingBlock(); 733 RenderBlock* cb = os->containingBlock();
734 while (cb && !cb->isRenderView()) { 734 while (cb && !cb->isRenderView()) {
735 OwnPtr<RenderBlockSelectionInfo>& blockInfo = oldSelectedBlo cks.add(cb, nullptr).iterator->value; 735 OwnPtr<RenderBlockSelectionInfo>& blockInfo = oldSelectedBlo cks.add(cb, nullptr).storedValue->value;
736 if (blockInfo) 736 if (blockInfo)
737 break; 737 break;
738 blockInfo = adoptPtr(new RenderBlockSelectionInfo(cb)); 738 blockInfo = adoptPtr(new RenderBlockSelectionInfo(cb));
739 cb = cb->containingBlock(); 739 cb = cb->containingBlock();
740 } 740 }
741 } 741 }
742 } 742 }
743 743
744 os = getNextOrPrevRenderObjectBasedOnDirection(os, stop, continueExplori ng, exploringBackwards); 744 os = getNextOrPrevRenderObjectBasedOnDirection(os, stop, continueExplori ng, exploringBackwards);
745 } 745 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 // Now that the selection state has been updated for the new objects, walk t hem again and 780 // Now that the selection state has been updated for the new objects, walk t hem again and
781 // put them in the new objects list. 781 // put them in the new objects list.
782 o = start; 782 o = start;
783 exploringBackwards = false; 783 exploringBackwards = false;
784 continueExploring = o && (o != stop); 784 continueExploring = o && (o != stop);
785 while (continueExploring) { 785 while (continueExploring) {
786 if ((o->canBeSelectionLeaf() || o == start || o == end) && o->selectionS tate() != SelectionNone) { 786 if ((o->canBeSelectionLeaf() || o == start || o == end) && o->selectionS tate() != SelectionNone) {
787 newSelectedObjects.set(o, adoptPtr(new RenderSelectionInfo(o, true)) ); 787 newSelectedObjects.set(o, adoptPtr(new RenderSelectionInfo(o, true)) );
788 RenderBlock* cb = o->containingBlock(); 788 RenderBlock* cb = o->containingBlock();
789 while (cb && !cb->isRenderView()) { 789 while (cb && !cb->isRenderView()) {
790 OwnPtr<RenderBlockSelectionInfo>& blockInfo = newSelectedBlocks. add(cb, nullptr).iterator->value; 790 OwnPtr<RenderBlockSelectionInfo>& blockInfo = newSelectedBlocks. add(cb, nullptr).storedValue->value;
791 if (blockInfo) 791 if (blockInfo)
792 break; 792 break;
793 blockInfo = adoptPtr(new RenderBlockSelectionInfo(cb)); 793 blockInfo = adoptPtr(new RenderBlockSelectionInfo(cb));
794 cb = cb->containingBlock(); 794 cb = cb->containingBlock();
795 } 795 }
796 } 796 }
797 797
798 o = getNextOrPrevRenderObjectBasedOnDirection(o, stop, continueExploring , exploringBackwards); 798 o = getNextOrPrevRenderObjectBasedOnDirection(o, stop, continueExploring , exploringBackwards);
799 } 799 }
800 800
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 return true; 1136 return true;
1137 if (childStyle->top().isPercent() || childStyle->height().isPercent( ) || childStyle->minHeight().isPercent() || childStyle->maxHeight().isPercent() || !childStyle->bottom().isAuto()) 1137 if (childStyle->top().isPercent() || childStyle->height().isPercent( ) || childStyle->minHeight().isPercent() || childStyle->maxHeight().isPercent() || !childStyle->bottom().isAuto())
1138 return true; 1138 return true;
1139 } 1139 }
1140 } 1140 }
1141 1141
1142 return false; 1142 return false;
1143 } 1143 }
1144 1144
1145 } // namespace WebCore 1145 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderRegion.cpp ('k') | Source/core/rendering/shapes/ShapeInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698