Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: Source/core/rendering/RenderInline.cpp

Issue 788073004: Replace RenderFullscreen with top layer - Take II (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated after review comments. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 16 matching lines...) Expand all
27 #include "core/dom/StyleEngine.h" 27 #include "core/dom/StyleEngine.h"
28 #include "core/page/Chrome.h" 28 #include "core/page/Chrome.h"
29 #include "core/page/Page.h" 29 #include "core/page/Page.h"
30 #include "core/paint/BoxPainter.h" 30 #include "core/paint/BoxPainter.h"
31 #include "core/paint/InlinePainter.h" 31 #include "core/paint/InlinePainter.h"
32 #include "core/paint/ObjectPainter.h" 32 #include "core/paint/ObjectPainter.h"
33 #include "core/rendering/HitTestResult.h" 33 #include "core/rendering/HitTestResult.h"
34 #include "core/rendering/InlineTextBox.h" 34 #include "core/rendering/InlineTextBox.h"
35 #include "core/rendering/RenderBlock.h" 35 #include "core/rendering/RenderBlock.h"
36 #include "core/rendering/RenderFlowThread.h" 36 #include "core/rendering/RenderFlowThread.h"
37 #include "core/rendering/RenderFullScreen.h"
38 #include "core/rendering/RenderGeometryMap.h" 37 #include "core/rendering/RenderGeometryMap.h"
39 #include "core/rendering/RenderLayer.h" 38 #include "core/rendering/RenderLayer.h"
40 #include "core/rendering/RenderTheme.h" 39 #include "core/rendering/RenderTheme.h"
41 #include "core/rendering/RenderView.h" 40 #include "core/rendering/RenderView.h"
42 #include "core/rendering/style/StyleInheritedData.h" 41 #include "core/rendering/style/StyleInheritedData.h"
43 #include "platform/geometry/FloatQuad.h" 42 #include "platform/geometry/FloatQuad.h"
44 #include "platform/geometry/TransformState.h" 43 #include "platform/geometry/TransformState.h"
45 44
46 namespace blink { 45 namespace blink {
47 46
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 to->addChildIgnoringContinuation(children()->removeChildNode(this, curre ntChild), nullptr); 374 to->addChildIgnoringContinuation(children()->removeChildNode(this, curre ntChild), nullptr);
376 } 375 }
377 } 376 }
378 377
379 void RenderInline::splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock, 378 void RenderInline::splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock,
380 RenderBlock* middleBlock, 379 RenderBlock* middleBlock,
381 RenderObject* beforeChild, RenderBoxModelObject* oldCont) 380 RenderObject* beforeChild, RenderBoxModelObject* oldCont)
382 { 381 {
383 ASSERT(isDescendantOf(fromBlock)); 382 ASSERT(isDescendantOf(fromBlock));
384 383
385 // If we're splitting the inline containing the fullscreened element,
386 // |beforeChild| may be the renderer for the fullscreened element. However,
387 // that renderer is wrapped in a RenderFullScreen, so |this| is not its
388 // parent. Since the splitting logic expects |this| to be the parent, set
389 // |beforeChild| to be the RenderFullScreen.
390 if (Fullscreen* fullscreen = Fullscreen::fromIfExists(document())) {
391 const Element* fullScreenElement = fullscreen->webkitCurrentFullScreenEl ement();
392 if (fullScreenElement && beforeChild && beforeChild->node() == fullScree nElement)
393 beforeChild = fullscreen->fullScreenRenderer();
394 }
395
396 // FIXME: Because splitting is O(n^2) as tags nest pathologically, we cap th e depth at which we're willing to clone. 384 // FIXME: Because splitting is O(n^2) as tags nest pathologically, we cap th e depth at which we're willing to clone.
397 // There will eventually be a better approach to this problem that will let us nest to a much 385 // There will eventually be a better approach to this problem that will let us nest to a much
398 // greater depth (see bugzilla bug 13430) but for now we have a limit. This *will* result in 386 // greater depth (see bugzilla bug 13430) but for now we have a limit. This *will* result in
399 // incorrect rendering, but the alternative is to hang forever. 387 // incorrect rendering, but the alternative is to hang forever.
400 const unsigned cMaxSplitDepth = 200; 388 const unsigned cMaxSplitDepth = 200;
401 Vector<RenderInline*> inlinesToClone; 389 Vector<RenderInline*> inlinesToClone;
402 RenderInline* topMostInline = this; 390 RenderInline* topMostInline = this;
403 for (RenderObject* o = this; o != fromBlock; o = o->parent()) { 391 for (RenderObject* o = this; o != fromBlock; o = o->parent()) {
404 topMostInline = toRenderInline(o); 392 topMostInline = toRenderInline(o);
405 if (inlinesToClone.size() < cMaxSplitDepth) 393 if (inlinesToClone.size() < cMaxSplitDepth)
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after
1410 container = this; 1398 container = this;
1411 1399
1412 FloatPoint absPos = container->localToAbsolute(); 1400 FloatPoint absPos = container->localToAbsolute();
1413 region.bounds.setX(absPos.x() + region.bounds.x()); 1401 region.bounds.setX(absPos.x() + region.bounds.x());
1414 region.bounds.setY(absPos.y() + region.bounds.y()); 1402 region.bounds.setY(absPos.y() + region.bounds.y());
1415 1403
1416 regions.append(region); 1404 regions.append(region);
1417 } 1405 }
1418 1406
1419 } // namespace blink 1407 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698