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

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

Issue 6948015: Merge 85705 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 years, 7 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 * 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 3148 matching lines...) Expand 10 before | Expand all | Expand 10 after
3159 3159
3160 // Fix for https://bugs.webkit.org/show_bug.cgi?id=54995. 3160 // Fix for https://bugs.webkit.org/show_bug.cgi?id=54995.
3161 if (logicalBottom < 0 || logicalBottom < logicalTop || logicalTo p == numeric_limits<int>::max()) 3161 if (logicalBottom < 0 || logicalBottom < logicalTop || logicalTo p == numeric_limits<int>::max())
3162 logicalBottom = numeric_limits<int>::max(); 3162 logicalBottom = numeric_limits<int>::max();
3163 else { 3163 else {
3164 // Special-case zero- and less-than-zero-height floats: thos e don't touch 3164 // Special-case zero- and less-than-zero-height floats: thos e don't touch
3165 // the line that they're on, but it still needs to be dirtie d. This is 3165 // the line that they're on, but it still needs to be dirtie d. This is
3166 // accomplished by pretending they have a height of 1. 3166 // accomplished by pretending they have a height of 1.
3167 logicalBottom = max(logicalBottom, logicalTop + 1); 3167 logicalBottom = max(logicalBottom, logicalTop + 1);
3168 } 3168 }
3169 if (r->m_originatingLine) {
3170 ASSERT(r->m_originatingLine->renderer() == this);
3171 r->m_originatingLine->markDirty();
3172 #if !ASSERT_DISABLED
3173 r->m_originatingLine = 0;
3174 #endif
3175 }
3169 markLinesDirtyInBlockRange(0, logicalBottom); 3176 markLinesDirtyInBlockRange(0, logicalBottom);
3170 } 3177 }
3171 m_floatingObjects->decreaseObjectsCount(r->type()); 3178 m_floatingObjects->decreaseObjectsCount(r->type());
3172 floatingObjectSet.remove(it); 3179 floatingObjectSet.remove(it);
3180 ASSERT(!r->m_originatingLine);
3173 delete r; 3181 delete r;
3174 } 3182 }
3175 } 3183 }
3176 } 3184 }
3177 3185
3178 void RenderBlock::removeFloatingObjectsBelow(FloatingObject* lastFloat, int logi calOffset) 3186 void RenderBlock::removeFloatingObjectsBelow(FloatingObject* lastFloat, int logi calOffset)
3179 { 3187 {
3180 if (!m_floatingObjects) 3188 if (!m_floatingObjects)
3181 return; 3189 return;
3182 3190
3183 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3191 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
3184 FloatingObject* curr = floatingObjectSet.last(); 3192 FloatingObject* curr = floatingObjectSet.last();
3185 while (curr != lastFloat && (!curr->isPlaced() || logicalTopForFloat(curr) > = logicalOffset)) { 3193 while (curr != lastFloat && (!curr->isPlaced() || logicalTopForFloat(curr) > = logicalOffset)) {
3186 m_floatingObjects->decreaseObjectsCount(curr->type()); 3194 m_floatingObjects->decreaseObjectsCount(curr->type());
3187 floatingObjectSet.removeLast(); 3195 floatingObjectSet.removeLast();
3196 ASSERT(!curr->m_originatingLine);
3188 delete curr; 3197 delete curr;
3189 curr = floatingObjectSet.last(); 3198 curr = floatingObjectSet.last();
3190 } 3199 }
3191 } 3200 }
3192 3201
3193 bool RenderBlock::positionNewFloats() 3202 bool RenderBlock::positionNewFloats()
3194 { 3203 {
3195 if (!m_floatingObjects) 3204 if (!m_floatingObjects)
3196 return false; 3205 return false;
3197 3206
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
3615 int oldLogicalBottom = logicalBottomForFloat(oldFloatingObje ct); 3624 int oldLogicalBottom = logicalBottomForFloat(oldFloatingObje ct);
3616 if (logicalWidthForFloat(f) != logicalWidthForFloat(oldFloat ingObject) || logicalLeftForFloat(f) != logicalLeftForFloat(oldFloatingObject)) { 3625 if (logicalWidthForFloat(f) != logicalWidthForFloat(oldFloat ingObject) || logicalLeftForFloat(f) != logicalLeftForFloat(oldFloatingObject)) {
3617 changeLogicalTop = 0; 3626 changeLogicalTop = 0;
3618 changeLogicalBottom = max(changeLogicalBottom, max(logic alBottom, oldLogicalBottom)); 3627 changeLogicalBottom = max(changeLogicalBottom, max(logic alBottom, oldLogicalBottom));
3619 } else if (logicalBottom != oldLogicalBottom) { 3628 } else if (logicalBottom != oldLogicalBottom) {
3620 changeLogicalTop = min(changeLogicalTop, min(logicalBott om, oldLogicalBottom)); 3629 changeLogicalTop = min(changeLogicalTop, min(logicalBott om, oldLogicalBottom));
3621 changeLogicalBottom = max(changeLogicalBottom, max(logic alBottom, oldLogicalBottom)); 3630 changeLogicalBottom = max(changeLogicalBottom, max(logic alBottom, oldLogicalBottom));
3622 } 3631 }
3623 3632
3624 floatMap.remove(f->m_renderer); 3633 floatMap.remove(f->m_renderer);
3634 if (oldFloatingObject->m_originatingLine) {
3635 ASSERT(oldFloatingObject->m_originatingLine->renderer() == this);
3636 oldFloatingObject->m_originatingLine->markDirty();
3637 }
3625 delete oldFloatingObject; 3638 delete oldFloatingObject;
3626 } else { 3639 } else {
3627 changeLogicalTop = 0; 3640 changeLogicalTop = 0;
3628 changeLogicalBottom = max(changeLogicalBottom, logicalBottom ); 3641 changeLogicalBottom = max(changeLogicalBottom, logicalBottom );
3629 } 3642 }
3630 } 3643 }
3631 } 3644 }
3632 3645
3633 RendererToFloatInfoMap::iterator end = floatMap.end(); 3646 RendererToFloatInfoMap::iterator end = floatMap.end();
3634 for (RendererToFloatInfoMap::iterator it = floatMap.begin(); it != end; ++it) { 3647 for (RendererToFloatInfoMap::iterator it = floatMap.begin(); it != end; ++it) {
(...skipping 2628 matching lines...) Expand 10 before | Expand all | Expand 10 after
6263 6276
6264 inline void RenderBlock::FloatingObjects::decreaseObjectsCount(FloatingObject::T ype type) 6277 inline void RenderBlock::FloatingObjects::decreaseObjectsCount(FloatingObject::T ype type)
6265 { 6278 {
6266 if (type == FloatingObject::FloatLeft) 6279 if (type == FloatingObject::FloatLeft)
6267 m_leftObjectsCount--; 6280 m_leftObjectsCount--;
6268 else 6281 else
6269 m_rightObjectsCount--; 6282 m_rightObjectsCount--;
6270 } 6283 }
6271 6284
6272 } // namespace WebCore 6285 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/RenderBlock.h ('k') | Source/WebCore/rendering/RenderBlockLineLayout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698