| 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 2562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2573 const RenderObject* RenderBoxModelObject::pushMappingToContainer(const RenderLay
erModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const | 2573 const RenderObject* RenderBoxModelObject::pushMappingToContainer(const RenderLay
erModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const |
| 2574 { | 2574 { |
| 2575 ASSERT(ancestorToStopAt != this); | 2575 ASSERT(ancestorToStopAt != this); |
| 2576 | 2576 |
| 2577 bool ancestorSkipped; | 2577 bool ancestorSkipped; |
| 2578 RenderObject* container = this->container(ancestorToStopAt, &ancestorSkipped
); | 2578 RenderObject* container = this->container(ancestorToStopAt, &ancestorSkipped
); |
| 2579 if (!container) | 2579 if (!container) |
| 2580 return 0; | 2580 return 0; |
| 2581 | 2581 |
| 2582 bool isInline = isRenderInline(); | 2582 bool isInline = isRenderInline(); |
| 2583 bool isFixedPos = !isInline && style()->position() == FixedPosition; | |
| 2584 bool hasTransform = !isInline && hasLayer() && layer()->transform(); | 2583 bool hasTransform = !isInline && hasLayer() && layer()->transform(); |
| 2585 | 2584 |
| 2586 LayoutSize adjustmentForSkippedAncestor; | 2585 LayoutSize adjustmentForSkippedAncestor; |
| 2587 if (ancestorSkipped) { | 2586 if (ancestorSkipped) { |
| 2588 // There can't be a transform between paintInvalidationContainer and o,
because transforms create containers, so it should be safe | 2587 // There can't be a transform between paintInvalidationContainer and o,
because transforms create containers, so it should be safe |
| 2589 // to just subtract the delta between the ancestor and o. | 2588 // to just subtract the delta between the ancestor and o. |
| 2590 adjustmentForSkippedAncestor = -ancestorToStopAt->offsetFromAncestorCont
ainer(container); | 2589 adjustmentForSkippedAncestor = -ancestorToStopAt->offsetFromAncestorCont
ainer(container); |
| 2591 } | 2590 } |
| 2592 | 2591 |
| 2593 bool offsetDependsOnPoint = false; | 2592 bool offsetDependsOnPoint = false; |
| 2594 LayoutSize containerOffset = offsetFromContainer(container, LayoutPoint(), &
offsetDependsOnPoint); | 2593 LayoutSize containerOffset = offsetFromContainer(container, LayoutPoint(), &
offsetDependsOnPoint); |
| 2595 | 2594 |
| 2596 bool preserve3D = container->style()->preserves3D() || style()->preserves3D(
); | 2595 bool preserve3D = container->style()->preserves3D() || style()->preserves3D(
); |
| 2597 if (shouldUseTransformFromContainer(container)) { | 2596 if (shouldUseTransformFromContainer(container)) { |
| 2598 TransformationMatrix t; | 2597 TransformationMatrix t; |
| 2599 getTransformFromContainer(container, containerOffset, t); | 2598 getTransformFromContainer(container, containerOffset, t); |
| 2600 t.translateRight(adjustmentForSkippedAncestor.width().toFloat(), adjustm
entForSkippedAncestor.height().toFloat()); | 2599 t.translateRight(adjustmentForSkippedAncestor.width().toFloat(), adjustm
entForSkippedAncestor.height().toFloat()); |
| 2601 geometryMap.push(this, t, preserve3D, offsetDependsOnPoint, isFixedPos,
hasTransform); | 2600 geometryMap.push(this, t, preserve3D, offsetDependsOnPoint, hasTransform
); |
| 2602 } else { | 2601 } else { |
| 2603 containerOffset += adjustmentForSkippedAncestor; | 2602 containerOffset += adjustmentForSkippedAncestor; |
| 2604 geometryMap.push(this, containerOffset, preserve3D, offsetDependsOnPoint
, isFixedPos, hasTransform); | 2603 geometryMap.push(this, containerOffset, preserve3D, offsetDependsOnPoint
, hasTransform); |
| 2605 } | 2604 } |
| 2606 | 2605 |
| 2607 return ancestorSkipped ? ancestorToStopAt : container; | 2606 return ancestorSkipped ? ancestorToStopAt : container; |
| 2608 } | 2607 } |
| 2609 | 2608 |
| 2610 void RenderBoxModelObject::moveChildTo(RenderBoxModelObject* toBoxModelObject, R
enderObject* child, RenderObject* beforeChild, bool fullRemoveInsert) | 2609 void RenderBoxModelObject::moveChildTo(RenderBoxModelObject* toBoxModelObject, R
enderObject* child, RenderObject* beforeChild, bool fullRemoveInsert) |
| 2611 { | 2610 { |
| 2612 // We assume that callers have cleared their positioned objects list for chi
ld moves (!fullRemoveInsert) so the | 2611 // We assume that callers have cleared their positioned objects list for chi
ld moves (!fullRemoveInsert) so the |
| 2613 // positioned renderer maps don't become stale. It would be too slow to do t
he map lookup on each call. | 2612 // positioned renderer maps don't become stale. It would be too slow to do t
he map lookup on each call. |
| 2614 ASSERT(!fullRemoveInsert || !isRenderBlock() || !toRenderBlock(this)->hasPos
itionedObjects()); | 2613 ASSERT(!fullRemoveInsert || !isRenderBlock() || !toRenderBlock(this)->hasPos
itionedObjects()); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2638 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); | 2637 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); |
| 2639 for (RenderObject* child = startChild; child && child != endChild; ) { | 2638 for (RenderObject* child = startChild; child && child != endChild; ) { |
| 2640 // Save our next sibling as moveChildTo will clear it. | 2639 // Save our next sibling as moveChildTo will clear it. |
| 2641 RenderObject* nextSibling = child->nextSibling(); | 2640 RenderObject* nextSibling = child->nextSibling(); |
| 2642 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); | 2641 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); |
| 2643 child = nextSibling; | 2642 child = nextSibling; |
| 2644 } | 2643 } |
| 2645 } | 2644 } |
| 2646 | 2645 |
| 2647 } // namespace blink | 2646 } // namespace blink |
| OLD | NEW |