OLD | NEW |
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 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 3028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3039 if (useTransforms && shouldUseTransformFromContainer(o)) { | 3039 if (useTransforms && shouldUseTransformFromContainer(o)) { |
3040 TransformationMatrix t; | 3040 TransformationMatrix t; |
3041 getTransformFromContainer(o, containerOffset, t); | 3041 getTransformFromContainer(o, containerOffset, t); |
3042 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate
Transform : TransformState::FlattenTransform); | 3042 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate
Transform : TransformState::FlattenTransform); |
3043 } else | 3043 } else |
3044 transformState.move(containerOffset.width(), containerOffset.height(), p
reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo
rm); | 3044 transformState.move(containerOffset.width(), containerOffset.height(), p
reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo
rm); |
3045 } | 3045 } |
3046 | 3046 |
3047 void RenderBoxModelObject::moveChildTo(RenderBoxModelObject* toBoxModelObject, R
enderObject* child, RenderObject* beforeChild, bool fullRemoveInsert) | 3047 void RenderBoxModelObject::moveChildTo(RenderBoxModelObject* toBoxModelObject, R
enderObject* child, RenderObject* beforeChild, bool fullRemoveInsert) |
3048 { | 3048 { |
| 3049 // FIXME: We need a performant way to handle clearing positioned objects fro
m our list that are |
| 3050 // in |child|'s subtree so we could just clear them here. Because of this, w
e assume that callers |
| 3051 // have cleared their positioned objects list for child moves (!fullRemoveIn
sert) to avoid any badness. |
| 3052 ASSERT(!fullRemoveInsert || !isRenderBlock() || !toRenderBlock(this)->hasPos
itionedObjects()); |
| 3053 |
3049 ASSERT(this == child->parent()); | 3054 ASSERT(this == child->parent()); |
3050 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); | 3055 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); |
3051 if (fullRemoveInsert && (toBoxModelObject->isRenderBlock() || toBoxModelObje
ct->isRenderInline())) { | 3056 if (fullRemoveInsert && (toBoxModelObject->isRenderBlock() || toBoxModelObje
ct->isRenderInline())) { |
3052 // Takes care of adding the new child correctly if toBlock and fromBlock | 3057 // Takes care of adding the new child correctly if toBlock and fromBlock |
3053 // have different kind of children (block vs inline). | 3058 // have different kind of children (block vs inline). |
3054 toBoxModelObject->addChild(virtualChildren()->removeChildNode(this, chil
d), beforeChild); | 3059 toBoxModelObject->addChild(virtualChildren()->removeChildNode(this, chil
d), beforeChild); |
3055 } else | 3060 } else |
3056 toBoxModelObject->virtualChildren()->insertChildNode(toBoxModelObject, v
irtualChildren()->removeChildNode(this, child, fullRemoveInsert), beforeChild, f
ullRemoveInsert); | 3061 toBoxModelObject->virtualChildren()->insertChildNode(toBoxModelObject, v
irtualChildren()->removeChildNode(this, child, fullRemoveInsert), beforeChild, f
ullRemoveInsert); |
3057 } | 3062 } |
3058 | 3063 |
3059 void RenderBoxModelObject::moveChildrenTo(RenderBoxModelObject* toBoxModelObject
, RenderObject* startChild, RenderObject* endChild, RenderObject* beforeChild, b
ool fullRemoveInsert) | 3064 void RenderBoxModelObject::moveChildrenTo(RenderBoxModelObject* toBoxModelObject
, RenderObject* startChild, RenderObject* endChild, RenderObject* beforeChild, b
ool fullRemoveInsert) |
3060 { | 3065 { |
| 3066 // This condition is rarely hit since this function is usually called on |
| 3067 // anonymous blocks which can no longer carry positioned objects (see r12076
1) |
| 3068 // or when fullRemoveInsert is false. |
| 3069 if (fullRemoveInsert && isRenderBlock()) { |
| 3070 RenderBlock* block = toRenderBlock(this); |
| 3071 if (block->hasPositionedObjects()) |
| 3072 block->removePositionedObjects(0); |
| 3073 } |
| 3074 |
3061 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); | 3075 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); |
3062 for (RenderObject* child = startChild; child && child != endChild; ) { | 3076 for (RenderObject* child = startChild; child && child != endChild; ) { |
3063 // Save our next sibling as moveChildTo will clear it. | 3077 // Save our next sibling as moveChildTo will clear it. |
3064 RenderObject* nextSibling = child->nextSibling(); | 3078 RenderObject* nextSibling = child->nextSibling(); |
3065 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); | 3079 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); |
3066 child = nextSibling; | 3080 child = nextSibling; |
3067 } | 3081 } |
3068 } | 3082 } |
3069 | 3083 |
3070 } // namespace WebCore | 3084 } // namespace WebCore |
OLD | NEW |