| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 RenderBox* controlsRenderer = toRenderBox(m_children.firstChild()); | 58 RenderBox* controlsRenderer = toRenderBox(m_children.firstChild()); |
| 59 if (!controlsRenderer) | 59 if (!controlsRenderer) |
| 60 return; | 60 return; |
| 61 | 61 |
| 62 bool controlsNeedLayout = controlsRenderer->needsLayout(); | 62 bool controlsNeedLayout = controlsRenderer->needsLayout(); |
| 63 LayoutSize newSize = contentBoxRect().size(); | 63 LayoutSize newSize = contentBoxRect().size(); |
| 64 if (newSize == oldSize && !controlsNeedLayout) | 64 if (newSize == oldSize && !controlsNeedLayout) |
| 65 return; | 65 return; |
| 66 | 66 |
| 67 // When calling layout() on a child node, a parent must either push a Layout
StateMaintainter, or | |
| 68 // instantiate LayoutStateDisabler. Since using a LayoutStateMaintainer is s
lightly more efficient, | |
| 69 // and this method will be called many times per second during playback, use
a LayoutStateMaintainer: | |
| 70 LayoutStateMaintainer statePusher(this, locationOffset()); | 67 LayoutStateMaintainer statePusher(this, locationOffset()); |
| 71 | 68 |
| 72 controlsRenderer->setLocation(LayoutPoint(borderLeft(), borderTop()) + Layou
tSize(paddingLeft(), paddingTop())); | 69 controlsRenderer->setLocation(LayoutPoint(borderLeft(), borderTop()) + Layou
tSize(paddingLeft(), paddingTop())); |
| 73 controlsRenderer->style()->setHeight(Length(newSize.height(), Fixed)); | 70 controlsRenderer->style()->setHeight(Length(newSize.height(), Fixed)); |
| 74 controlsRenderer->style()->setWidth(Length(newSize.width(), Fixed)); | 71 controlsRenderer->style()->setWidth(Length(newSize.width(), Fixed)); |
| 75 controlsRenderer->forceLayout(); | 72 controlsRenderer->forceLayout(); |
| 76 clearNeedsLayout(); | 73 clearNeedsLayout(); |
| 77 | 74 |
| 78 statePusher.pop(); | 75 statePusher.pop(); |
| 79 } | 76 } |
| 80 | 77 |
| 81 void RenderMedia::paintReplaced(PaintInfo&, const LayoutPoint&) | 78 void RenderMedia::paintReplaced(PaintInfo&, const LayoutPoint&) |
| 82 { | 79 { |
| 83 } | 80 } |
| 84 | 81 |
| 85 } // namespace WebCore | 82 } // namespace WebCore |
| OLD | NEW |