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

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

Issue 9250021: Merge 105120 - Heap-use-after-free in WebCore::RenderBlock::selectionGaps (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/912/
Patch Set: Created 8 years, 11 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/RenderBlock.h ('k') | Source/WebCore/rendering/RenderBox.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 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
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 4003 matching lines...) Expand 10 before | Expand all | Expand 10 after
4014 for (RenderObject* child = firstChild(); child; child = child->nextSibli ng()) { 4014 for (RenderObject* child = firstChild(); child; child = child->nextSibli ng()) {
4015 if ((!floatToRemove && child->isFloatingOrPositioned()) || !child->i sRenderBlock()) 4015 if ((!floatToRemove && child->isFloatingOrPositioned()) || !child->i sRenderBlock())
4016 continue; 4016 continue;
4017 RenderBlock* childBlock = toRenderBlock(child); 4017 RenderBlock* childBlock = toRenderBlock(child);
4018 if ((floatToRemove ? childBlock->containsFloat(floatToRemove) : chil dBlock->containsFloats()) || childBlock->shrinkToAvoidFloats()) 4018 if ((floatToRemove ? childBlock->containsFloat(floatToRemove) : chil dBlock->containsFloats()) || childBlock->shrinkToAvoidFloats())
4019 childBlock->markAllDescendantsWithFloatsForLayout(floatToRemove, inLayout); 4019 childBlock->markAllDescendantsWithFloatsForLayout(floatToRemove, inLayout);
4020 } 4020 }
4021 } 4021 }
4022 } 4022 }
4023 4023
4024 void RenderBlock::markSiblingsWithFloatsForLayout() 4024 void RenderBlock::markSiblingsWithFloatsForLayout(RenderBox* floatToRemove)
4025 { 4025 {
4026 if (!m_floatingObjects)
4027 return;
4026 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 4028 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
4027 FloatingObjectSetIterator end = floatingObjectSet.end(); 4029 FloatingObjectSetIterator end = floatingObjectSet.end();
4028 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++ it) { 4030 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++ it) {
4029 if (logicalBottomForFloat(*it) > logicalHeight()) { 4031 if (logicalBottomForFloat(*it) > logicalHeight()) {
4030 RenderBox* floatingBox = (*it)->renderer(); 4032 RenderBox* floatingBox = (*it)->renderer();
4033 if (floatToRemove && floatingBox != floatToRemove)
4034 continue;
4031 4035
4032 RenderObject* next = nextSibling(); 4036 RenderObject* next = nextSibling();
4033 while (next) { 4037 while (next) {
4034 if (next->isRenderBlock() && !next->isFloatingOrPositioned() && !toRenderBlock(next)->avoidsFloats()) { 4038 if (next->isRenderBlock() && !next->isFloatingOrPositioned() && !toRenderBlock(next)->avoidsFloats()) {
4035 RenderBlock* nextBlock = toRenderBlock(next); 4039 RenderBlock* nextBlock = toRenderBlock(next);
4036 if (nextBlock->containsFloat(floatingBox)) 4040 if (nextBlock->containsFloat(floatingBox))
4037 nextBlock->markAllDescendantsWithFloatsForLayout(floatin gBox); 4041 nextBlock->markAllDescendantsWithFloatsForLayout(floatin gBox);
4038 else 4042 else
4039 break; 4043 break;
4040 } 4044 }
(...skipping 2894 matching lines...) Expand 10 before | Expand all | Expand 10 after
6935 } 6939 }
6936 6940
6937 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject) 6941 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject)
6938 { 6942 {
6939 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); 6943 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY());
6940 } 6944 }
6941 6945
6942 #endif 6946 #endif
6943 6947
6944 } // namespace WebCore 6948 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/RenderBlock.h ('k') | Source/WebCore/rendering/RenderBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698