OLD | NEW |
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 2201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2212 if (needsLayout()) | 2212 if (needsLayout()) |
2213 return; | 2213 return; |
2214 | 2214 |
2215 if (view()->layoutState()->pageLogicalHeightChanged() || (view()->layoutStat
e()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(logicalTop(
)) != pageLogicalOffset())) | 2215 if (view()->layoutState()->pageLogicalHeightChanged() || (view()->layoutStat
e()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(logicalTop(
)) != pageLogicalOffset())) |
2216 setChildNeedsLayout(true, false); | 2216 setChildNeedsLayout(true, false); |
2217 } | 2217 } |
2218 | 2218 |
2219 void RenderBlock::repaintOverhangingFloats(bool paintAllDescendants) | 2219 void RenderBlock::repaintOverhangingFloats(bool paintAllDescendants) |
2220 { | 2220 { |
2221 // Repaint any overhanging floats (if we know we're the one to paint them). | 2221 // Repaint any overhanging floats (if we know we're the one to paint them). |
2222 if (hasOverhangingFloats()) { | 2222 // Otherwise, bail out. |
2223 // We think that we must be in a bad state if m_floatingObjects is nil a
t this point, so | 2223 if (!hasOverhangingFloats()) |
2224 // we assert on Debug builds and nil-check Release builds. | 2224 return; |
2225 ASSERT(m_floatingObjects); | |
2226 if (!m_floatingObjects) | |
2227 return; | |
2228 | 2225 |
2229 // FIXME: Avoid disabling LayoutState. At the very least, don't disable
it for floats originating | 2226 // FIXME: Avoid disabling LayoutState. At the very least, don't disable it f
or floats originating |
2230 // in this block. Better yet would be to push extra state for the contai
ners of other floats. | 2227 // in this block. Better yet would be to push extra state for the containers
of other floats. |
2231 view()->disableLayoutState(); | 2228 view()->disableLayoutState(); |
2232 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); | 2229 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); |
2233 FloatingObjectSetIterator end = floatingObjectSet.end(); | 2230 FloatingObjectSetIterator end = floatingObjectSet.end(); |
2234 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end
; ++it) { | 2231 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++
it) { |
2235 FloatingObject* r = *it; | 2232 FloatingObject* r = *it; |
2236 // Only repaint the object if it is overhanging, is not in its own l
ayer, and | 2233 // Only repaint the object if it is overhanging, is not in its own layer
, and |
2237 // is our responsibility to paint (m_shouldPaint is set). When paint
AllDescendants is true, the latter | 2234 // is our responsibility to paint (m_shouldPaint is set). When paintAllD
escendants is true, the latter |
2238 // condition is replaced with being a descendant of us. | 2235 // condition is replaced with being a descendant of us. |
2239 if (logicalBottomForFloat(r) > logicalHeight() && ((paintAllDescenda
nts && r->m_renderer->isDescendantOf(this)) || r->m_shouldPaint) && !r->m_render
er->hasSelfPaintingLayer()) { | 2236 if (logicalBottomForFloat(r) > logicalHeight() && ((paintAllDescendants
&& r->m_renderer->isDescendantOf(this)) || r->m_shouldPaint) && !r->m_renderer->
hasSelfPaintingLayer()) { |
2240 r->m_renderer->repaint(); | 2237 r->m_renderer->repaint(); |
2241 r->m_renderer->repaintOverhangingFloats(); | 2238 r->m_renderer->repaintOverhangingFloats(); |
2242 } | |
2243 } | 2239 } |
2244 view()->enableLayoutState(); | |
2245 } | 2240 } |
| 2241 view()->enableLayoutState(); |
2246 } | 2242 } |
2247 | 2243 |
2248 void RenderBlock::paint(PaintInfo& paintInfo, int tx, int ty) | 2244 void RenderBlock::paint(PaintInfo& paintInfo, int tx, int ty) |
2249 { | 2245 { |
2250 tx += x(); | 2246 tx += x(); |
2251 ty += y(); | 2247 ty += y(); |
2252 | 2248 |
2253 PaintPhase phase = paintInfo.phase; | 2249 PaintPhase phase = paintInfo.phase; |
2254 | 2250 |
2255 // Check if we need to do anything at all. | 2251 // Check if we need to do anything at all. |
(...skipping 4057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6313 | 6309 |
6314 inline void RenderBlock::FloatingObjects::decreaseObjectsCount(FloatingObject::T
ype type) | 6310 inline void RenderBlock::FloatingObjects::decreaseObjectsCount(FloatingObject::T
ype type) |
6315 { | 6311 { |
6316 if (type == FloatingObject::FloatLeft) | 6312 if (type == FloatingObject::FloatLeft) |
6317 m_leftObjectsCount--; | 6313 m_leftObjectsCount--; |
6318 else | 6314 else |
6319 m_rightObjectsCount--; | 6315 m_rightObjectsCount--; |
6320 } | 6316 } |
6321 | 6317 |
6322 } // namespace WebCore | 6318 } // namespace WebCore |
OLD | NEW |