Chromium Code Reviews| 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 18 matching lines...) Expand all Loading... | |
| 29 #include "HTMLNames.h" | 29 #include "HTMLNames.h" |
| 30 #include "core/html/HTMLFrameOwnerElement.h" | 30 #include "core/html/HTMLFrameOwnerElement.h" |
| 31 #include "core/page/Settings.h" | 31 #include "core/page/Settings.h" |
| 32 #include "core/page/scrolling/ScrollingConstraints.h" | 32 #include "core/page/scrolling/ScrollingConstraints.h" |
| 33 #include "core/platform/graphics/DrawLooper.h" | 33 #include "core/platform/graphics/DrawLooper.h" |
| 34 #include "core/platform/graphics/GraphicsContextStateSaver.h" | 34 #include "core/platform/graphics/GraphicsContextStateSaver.h" |
| 35 #include "core/platform/graphics/Path.h" | 35 #include "core/platform/graphics/Path.h" |
| 36 #include "core/platform/graphics/transforms/TransformState.h" | 36 #include "core/platform/graphics/transforms/TransformState.h" |
| 37 #include "core/rendering/ImageQualityController.h" | 37 #include "core/rendering/ImageQualityController.h" |
| 38 #include "core/rendering/RenderBlock.h" | 38 #include "core/rendering/RenderBlock.h" |
| 39 #include "core/rendering/RenderGeometryMap.h" | |
| 39 #include "core/rendering/RenderInline.h" | 40 #include "core/rendering/RenderInline.h" |
| 40 #include "core/rendering/RenderLayer.h" | 41 #include "core/rendering/RenderLayer.h" |
| 41 #include "core/rendering/RenderLayerBacking.h" | 42 #include "core/rendering/RenderLayerBacking.h" |
| 42 #include "core/rendering/RenderLayerCompositor.h" | 43 #include "core/rendering/RenderLayerCompositor.h" |
| 43 #include "core/rendering/RenderNamedFlowThread.h" | 44 #include "core/rendering/RenderNamedFlowThread.h" |
| 44 #include "core/rendering/RenderRegion.h" | 45 #include "core/rendering/RenderRegion.h" |
| 45 #include "core/rendering/RenderView.h" | 46 #include "core/rendering/RenderView.h" |
| 46 #include <wtf/CurrentTime.h> | 47 #include <wtf/CurrentTime.h> |
| 47 | 48 |
| 48 using namespace std; | 49 using namespace std; |
| (...skipping 2608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2657 | 2658 |
| 2658 bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || styl e()->preserves3D()); | 2659 bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || styl e()->preserves3D()); |
| 2659 if (mode & UseTransforms && shouldUseTransformFromContainer(o)) { | 2660 if (mode & UseTransforms && shouldUseTransformFromContainer(o)) { |
| 2660 TransformationMatrix t; | 2661 TransformationMatrix t; |
| 2661 getTransformFromContainer(o, containerOffset, t); | 2662 getTransformFromContainer(o, containerOffset, t); |
| 2662 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate Transform : TransformState::FlattenTransform); | 2663 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate Transform : TransformState::FlattenTransform); |
| 2663 } else | 2664 } else |
| 2664 transformState.move(containerOffset.width(), containerOffset.height(), p reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo rm); | 2665 transformState.move(containerOffset.width(), containerOffset.height(), p reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo rm); |
| 2665 } | 2666 } |
| 2666 | 2667 |
| 2668 const RenderObject* RenderBoxModelObject::pushMappingToContainer(const RenderLay erModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const | |
| 2669 { | |
| 2670 ASSERT(ancestorToStopAt != this); | |
| 2671 | |
| 2672 bool ancestorSkipped; | |
| 2673 RenderObject* container = this->container(ancestorToStopAt, &ancestorSkipped ); | |
| 2674 if (!container) | |
| 2675 return 0; | |
| 2676 | |
| 2677 bool isFixedPos = !isRenderInline() && style()->position() == FixedPosition; | |
|
esprehn
2013/06/17 23:56:45
isRenderInline is virtual, and now you call it twi
eae
2013/06/18 00:06:59
Both isRenderInline() and style() are marked as co
| |
| 2678 bool hasTransform = !isRenderInline() && hasLayer() && layer()->transform(); | |
| 2679 | |
| 2680 LayoutSize adjustmentForSkippedAncestor; | |
| 2681 if (ancestorSkipped) { | |
| 2682 // There can't be a transform between repaintContainer and o, because tr ansforms create containers, so it should be safe | |
| 2683 // to just subtract the delta between the ancestor and o. | |
| 2684 adjustmentForSkippedAncestor = -ancestorToStopAt->offsetFromAncestorCont ainer(container); | |
| 2685 } | |
| 2686 | |
| 2687 bool offsetDependsOnPoint = false; | |
| 2688 LayoutSize containerOffset = offsetFromContainer(container, LayoutPoint(), & offsetDependsOnPoint); | |
| 2689 | |
| 2690 bool preserve3D = container->style()->preserves3D() || style()->preserves3D( ); | |
| 2691 if (shouldUseTransformFromContainer(container)) { | |
| 2692 TransformationMatrix t; | |
| 2693 getTransformFromContainer(container, containerOffset, t); | |
| 2694 t.translateRight(adjustmentForSkippedAncestor.width(), adjustmentForSkip pedAncestor.height()); | |
| 2695 geometryMap.push(this, t, preserve3D, offsetDependsOnPoint, isFixedPos, hasTransform); | |
| 2696 } else { | |
| 2697 containerOffset += adjustmentForSkippedAncestor; | |
| 2698 geometryMap.push(this, containerOffset, preserve3D, offsetDependsOnPoint , isFixedPos, hasTransform); | |
| 2699 } | |
| 2700 | |
| 2701 return ancestorSkipped ? ancestorToStopAt : container; | |
| 2702 } | |
| 2703 | |
| 2667 void RenderBoxModelObject::moveChildTo(RenderBoxModelObject* toBoxModelObject, R enderObject* child, RenderObject* beforeChild, bool fullRemoveInsert) | 2704 void RenderBoxModelObject::moveChildTo(RenderBoxModelObject* toBoxModelObject, R enderObject* child, RenderObject* beforeChild, bool fullRemoveInsert) |
| 2668 { | 2705 { |
| 2669 // We assume that callers have cleared their positioned objects list for chi ld moves (!fullRemoveInsert) so the | 2706 // We assume that callers have cleared their positioned objects list for chi ld moves (!fullRemoveInsert) so the |
| 2670 // positioned renderer maps don't become stale. It would be too slow to do t he map lookup on each call. | 2707 // positioned renderer maps don't become stale. It would be too slow to do t he map lookup on each call. |
| 2671 ASSERT(!fullRemoveInsert || !isRenderBlock() || !toRenderBlock(this)->hasPos itionedObjects()); | 2708 ASSERT(!fullRemoveInsert || !isRenderBlock() || !toRenderBlock(this)->hasPos itionedObjects()); |
| 2672 | 2709 |
| 2673 ASSERT(this == child->parent()); | 2710 ASSERT(this == child->parent()); |
| 2674 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); | 2711 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); |
| 2675 if (fullRemoveInsert && (toBoxModelObject->isRenderBlock() || toBoxModelObje ct->isRenderInline())) { | 2712 if (fullRemoveInsert && (toBoxModelObject->isRenderBlock() || toBoxModelObje ct->isRenderInline())) { |
| 2676 // Takes care of adding the new child correctly if toBlock and fromBlock | 2713 // Takes care of adding the new child correctly if toBlock and fromBlock |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 2694 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); | 2731 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); |
| 2695 for (RenderObject* child = startChild; child && child != endChild; ) { | 2732 for (RenderObject* child = startChild; child && child != endChild; ) { |
| 2696 // Save our next sibling as moveChildTo will clear it. | 2733 // Save our next sibling as moveChildTo will clear it. |
| 2697 RenderObject* nextSibling = child->nextSibling(); | 2734 RenderObject* nextSibling = child->nextSibling(); |
| 2698 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); | 2735 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); |
| 2699 child = nextSibling; | 2736 child = nextSibling; |
| 2700 } | 2737 } |
| 2701 } | 2738 } |
| 2702 | 2739 |
| 2703 } // namespace WebCore | 2740 } // namespace WebCore |
| OLD | NEW |