#include "core/dom/FullscreenElementStack.h"
#include "core/rendering/RenderBlockFlow.h"
-using namespace WebCore;
+using namespace blink;
class RenderFullScreenPlaceholder FINAL : public RenderBlockFlow {
public:
RenderFullScreen::RenderFullScreen()
: RenderFlexibleBox(0)
- , m_placeholder(0)
+ , m_placeholder(nullptr)
{
setReplaced(false);
}
return renderer;
}
+void RenderFullScreen::trace(Visitor* visitor)
+{
+ visitor->trace(m_placeholder);
+ RenderFlexibleBox::trace(visitor);
+}
+
void RenderFullScreen::willBeDestroyed()
{
if (m_placeholder) {
}
// RenderObjects are unretained, so notify the document (which holds a pointer to a RenderFullScreen)
- // if it's RenderFullScreen is destroyed.
- FullscreenElementStack& controller = FullscreenElementStack::from(document());
- if (controller.fullScreenRenderer() == this)
- controller.fullScreenRendererDestroyed();
+ // if its RenderFullScreen is destroyed.
+ FullscreenElementStack& fullscreen = FullscreenElementStack::from(document());
+ if (fullscreen.fullScreenRenderer() == this)
+ fullscreen.fullScreenRendererDestroyed();
RenderFlexibleBox::willBeDestroyed();
}
fullscreenStyle->setPosition(FixedPosition);
fullscreenStyle->setWidth(Length(100.0, Percent));
fullscreenStyle->setHeight(Length(100.0, Percent));
- fullscreenStyle->setLeft(Length(0, WebCore::Fixed));
- fullscreenStyle->setTop(Length(0, WebCore::Fixed));
+ fullscreenStyle->setLeft(Length(0, blink::Fixed));
+ fullscreenStyle->setTop(Length(0, blink::Fixed));
fullscreenStyle->setBackgroundColor(StyleColor(Color::black));
RenderObject* RenderFullScreen::wrapRenderer(RenderObject* object, RenderObject* parent, Document* document)
{
+ // FIXME: We should not modify the structure of the render tree during
+ // layout. crbug.com/370459
+ DeprecatedDisableModifyRenderTreeStructureAsserts disabler;
+
RenderFullScreen* fullscreenRenderer = RenderFullScreen::createAnonymous(document);
fullscreenRenderer->setStyle(createFullScreenStyle());
if (parent && !parent->isChildAllowed(fullscreenRenderer, fullscreenRenderer->style())) {
// Always just do a full layout to ensure that line boxes get deleted properly.
// Because objects moved from |parent| to |fullscreenRenderer|, we want to
// make new line boxes instead of leaving the old ones around.
- parent->setNeedsLayoutAndPrefWidthsRecalc();
- containingBlock->setNeedsLayoutAndPrefWidthsRecalc();
+ parent->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
+ containingBlock->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
}
fullscreenRenderer->addChild(object);
- fullscreenRenderer->setNeedsLayoutAndPrefWidthsRecalc();
+ fullscreenRenderer->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
}
ASSERT(document);
void RenderFullScreen::unwrapRenderer()
{
+ // FIXME: We should not modify the structure of the render tree during
+ // layout. crbug.com/370459
+ DeprecatedDisableModifyRenderTreeStructureAsserts disabler;
+
if (parent()) {
- RenderObject* child;
- while ((child = firstChild())) {
+ for (RenderObject* child = firstChild(); child; child = firstChild()) {
// We have to clear the override size, because as a flexbox, we
// may have set one on the child, and we don't want to leave that
// lying around on the child.
toRenderBox(child)->clearOverrideSize();
child->remove();
parent()->addChild(child, this);
- parent()->setNeedsLayoutAndPrefWidthsRecalc();
+ parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
}
}
if (placeholder())
placeholder()->remove();
remove();
- FullscreenElementStack::from(document()).setFullScreenRenderer(0);
+ destroy();
}
void RenderFullScreen::setPlaceholder(RenderBlock* placeholder)
m_placeholder->setStyle(style);
if (parent()) {
parent()->addChild(m_placeholder, this);
- parent()->setNeedsLayoutAndPrefWidthsRecalc();
+ parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
}
} else
m_placeholder->setStyle(style);