#include "RenderArena.h"
#include "RenderBlock.h"
#include "RenderFlowThread.h"
+#include "RenderFullScreen.h"
#include "RenderGeometryMap.h"
#include "RenderLayer.h"
#include "RenderTheme.h"
RenderInline* cloneInline = clone();
cloneInline->setContinuation(oldCont);
+ // If we're splitting the inline containing the fullscreened element,
+ // |beforeChild| may be the renderer for the fullscreened element. However,
+ // that renderer is wrapped in a RenderFullScreen, so |this| is not its
+ // parent. Since the splitting logic expects |this| to be the parent, set
+ // |beforeChild| to be the RenderFullScreen.
+ const Element* fullScreenElement = document()->webkitCurrentFullScreenElement();
+ if (fullScreenElement && beforeChild && beforeChild->node() == fullScreenElement)
+ beforeChild = document()->fullScreenRenderer();
+
// Now take all of the children from beforeChild to the end and remove
// them from |this| and place them in the clone.
RenderObject* o = beforeChild;