Changeset 164457 in webkit for trunk/Source/WebCore/rendering/RenderMedia.cpp
- Timestamp:
- Feb 20, 2014, 4:39:35 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/rendering/RenderMedia.cpp
r162356 r164457 38 38 : RenderImage(element, std::move(style)) 39 39 { 40 setHasShadowControls(true); 40 41 } 41 42 … … 44 45 { 45 46 setIntrinsicSize(intrinsicSize); 47 setHasShadowControls(true); 46 48 } 47 49 48 50 RenderMedia::~RenderMedia() 49 51 { 50 }51 52 void RenderMedia::layout()53 {54 StackStats::LayoutCheckPoint layoutCheckPoint;55 LayoutSize oldSize = contentBoxRect().size();56 57 RenderImage::layout();58 59 RenderBox* controlsRenderer = toRenderBox(firstChild());60 if (!controlsRenderer)61 return;62 63 bool controlsNeedLayout = controlsRenderer->needsLayout();64 // If the region chain has changed we also need to relayout the controls to update the region box info.65 // FIXME: We can do better once we compute region box info for RenderReplaced, not only for RenderBlock.66 const RenderFlowThread* flowThread = flowThreadContainingBlock();67 if (flowThread && !controlsNeedLayout) {68 if (flowThread->pageLogicalSizeChanged())69 controlsNeedLayout = true;70 }71 72 LayoutSize newSize = contentBoxRect().size();73 if (newSize == oldSize && !controlsNeedLayout)74 return;75 76 // When calling layout() on a child node, a parent must either push a LayoutStateMaintainter, or77 // instantiate LayoutStateDisabler. Since using a LayoutStateMaintainer is slightly more efficient,78 // and this method will be called many times per second during playback, use a LayoutStateMaintainer:79 LayoutStateMaintainer statePusher(view(), *this, locationOffset(), hasTransform() || hasReflection() || style().isFlippedBlocksWritingMode());80 81 controlsRenderer->setLocation(LayoutPoint(borderLeft(), borderTop()) + LayoutSize(paddingLeft(), paddingTop()));82 controlsRenderer->style().setHeight(Length(newSize.height(), Fixed));83 controlsRenderer->style().setWidth(Length(newSize.width(), Fixed));84 controlsRenderer->setNeedsLayout(MarkOnlyThis);85 controlsRenderer->layout();86 clearChildNeedsLayout();87 88 statePusher.pop();89 52 } 90 53
Note:
See TracChangeset
for help on using the changeset viewer.