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

Unified Diff: sky/engine/core/rendering/RenderBoxModelObject.cpp

Issue 734813004: Get rid of continuations. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/rendering/RenderBoxModelObject.h ('k') | sky/engine/core/rendering/RenderInline.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderBoxModelObject.cpp
diff --git a/sky/engine/core/rendering/RenderBoxModelObject.cpp b/sky/engine/core/rendering/RenderBoxModelObject.cpp
index 12962a6aea45ea639f51a62d767c93f9bddbc2ab..2f0aa1f6c9d956435a477a799c09bf6cfd3a1a9f 100644
--- a/sky/engine/core/rendering/RenderBoxModelObject.cpp
+++ b/sky/engine/core/rendering/RenderBoxModelObject.cpp
@@ -46,16 +46,6 @@
namespace blink {
-// The HashMap for storing continuation pointers.
-// An inline can be split with blocks occuring in between the inline content.
-// When this occurs we need a pointer to the next object. We can basically be
-// split into a sequence of inlines and blocks. The continuation will either be
-// an anonymous block (that houses other blocks) or it will be an inline flow.
-// <b><i><p>Hello</p></i></b>. In this example the <i> will have a block as
-// its continuation but the <b> will just have an inline as its continuation.
-typedef HashMap<RawPtr<const RenderBoxModelObject>, RawPtr<RenderBoxModelObject> > ContinuationMap;
-static OwnPtr<ContinuationMap>* continuationMap = 0;
-
void RenderBoxModelObject::setSelectionState(SelectionState state)
{
if (state == SelectionInside && selectionState() != SelectionNone)
@@ -105,10 +95,6 @@ RenderBoxModelObject::~RenderBoxModelObject()
void RenderBoxModelObject::willBeDestroyed()
{
ImageQualityController::remove(this);
-
- // A continuation of this RenderObject should be destroyed at subclasses.
- ASSERT(!continuation());
-
RenderLayerModelObject::willBeDestroyed();
}
@@ -129,22 +115,6 @@ void RenderBoxModelObject::updateFromStyle()
setPositionState(styleToUse->position());
}
-static LayoutSize accumulateInFlowPositionOffsets(const RenderObject* child)
-{
- if (!child->isAnonymousBlock() || !child->isRelPositioned())
- return LayoutSize();
- LayoutSize offset;
- RenderObject* p = toRenderBlock(child)->inlineElementContinuation();
- while (p && p->isRenderInline()) {
- if (p->isRelPositioned()) {
- RenderInline* renderInline = toRenderInline(p);
- offset += renderInline->offsetForInFlowPosition();
- }
- p = p->parent();
- }
- return offset;
-}
-
bool RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight() const
{
Length logicalHeightLength = style()->logicalHeight();
@@ -219,7 +189,7 @@ void RenderBoxModelObject::paintRootBackgroundColor(const PaintInfo& paintInfo,
LayoutSize RenderBoxModelObject::relativePositionOffset() const
{
- LayoutSize offset = accumulateInFlowPositionOffsets(this);
+ LayoutSize offset;
RenderBlock* containingBlock = this->containingBlock();
@@ -2428,25 +2398,6 @@ LayoutUnit RenderBoxModelObject::containingBlockLogicalWidthForContent() const
return containingBlock()->availableLogicalWidth();
}
-RenderBoxModelObject* RenderBoxModelObject::continuation() const
-{
- if (!continuationMap)
- return 0;
- return (*continuationMap)->get(this);
-}
-
-void RenderBoxModelObject::setContinuation(RenderBoxModelObject* continuation)
-{
- if (continuation) {
- if (!continuationMap)
- continuationMap = new OwnPtr<ContinuationMap>(adoptPtr(new ContinuationMap));
- (*continuationMap)->set(this, continuation);
- } else {
- if (continuationMap)
- (*continuationMap)->remove(this);
- }
-}
-
LayoutRect RenderBoxModelObject::localCaretRectForEmptyElement(LayoutUnit width, LayoutUnit textIndentOffset)
{
ASSERT(!slowFirstChild());
@@ -2590,7 +2541,7 @@ void RenderBoxModelObject::moveChildTo(RenderBoxModelObject* toBoxModelObject, R
toBoxModelObject->virtualChildren()->insertChildNode(toBoxModelObject, virtualChildren()->removeChildNode(this, child, fullRemoveInsert), beforeChild, fullRemoveInsert);
}
-void RenderBoxModelObject::moveChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* startChild, RenderObject* endChild, RenderObject* beforeChild, bool fullRemoveInsert)
+void RenderBoxModelObject::moveAllChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* beforeChild, bool fullRemoveInsert)
{
// This condition is rarely hit since this function is usually called on
// anonymous blocks which can no longer carry positioned objects (see r120761)
@@ -2601,7 +2552,7 @@ void RenderBoxModelObject::moveChildrenTo(RenderBoxModelObject* toBoxModelObject
}
ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent());
- for (RenderObject* child = startChild; child && child != endChild; ) {
+ for (RenderObject* child = slowFirstChild(); child; ) {
// Save our next sibling as moveChildTo will clear it.
RenderObject* nextSibling = child->nextSibling();
moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert);
« no previous file with comments | « sky/engine/core/rendering/RenderBoxModelObject.h ('k') | sky/engine/core/rendering/RenderInline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698