| 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 |
| 11 * License as published by the Free Software Foundation; either | 11 * License as published by the Free Software Foundation; either |
| 12 * version 2 of the License, or (at your option) any later version. | 12 * version 2 of the License, or (at your option) any later version. |
| 13 * | 13 * |
| 14 * This library is distributed in the hope that it will be useful, | 14 * This library is distributed in the hope that it will be useful, |
| 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 * Library General Public License for more details. | 17 * Library General Public License for more details. |
| 18 * | 18 * |
| 19 * You should have received a copy of the GNU Library General Public License | 19 * You should have received a copy of the GNU Library General Public License |
| 20 * along with this library; see the file COPYING.LIB. If not, write to | 20 * along with this library; see the file COPYING.LIB. If not, write to |
| 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 22 * Boston, MA 02110-1301, USA. | 22 * Boston, MA 02110-1301, USA. |
| 23 * | 23 * |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "core/rendering/RenderBoxModelObject.h" | 27 #include "core/rendering/RenderBoxModelObject.h" |
| 28 | 28 |
| 29 #include "core/layout/Layer.h" |
| 29 #include "core/layout/compositing/CompositedLayerMapping.h" | 30 #include "core/layout/compositing/CompositedLayerMapping.h" |
| 30 #include "core/layout/compositing/RenderLayerCompositor.h" | 31 #include "core/layout/compositing/LayerCompositor.h" |
| 31 #include "core/page/scrolling/ScrollingConstraints.h" | 32 #include "core/page/scrolling/ScrollingConstraints.h" |
| 32 #include "core/rendering/ImageQualityController.h" | 33 #include "core/rendering/ImageQualityController.h" |
| 33 #include "core/rendering/RenderBlock.h" | 34 #include "core/rendering/RenderBlock.h" |
| 34 #include "core/rendering/RenderFlowThread.h" | 35 #include "core/rendering/RenderFlowThread.h" |
| 35 #include "core/rendering/RenderGeometryMap.h" | 36 #include "core/rendering/RenderGeometryMap.h" |
| 36 #include "core/rendering/RenderInline.h" | 37 #include "core/rendering/RenderInline.h" |
| 37 #include "core/rendering/RenderLayer.h" | |
| 38 #include "core/rendering/RenderObjectInlines.h" | 38 #include "core/rendering/RenderObjectInlines.h" |
| 39 #include "core/rendering/RenderRegion.h" | 39 #include "core/rendering/RenderRegion.h" |
| 40 #include "core/rendering/RenderTextFragment.h" | 40 #include "core/rendering/RenderTextFragment.h" |
| 41 #include "core/rendering/RenderView.h" | 41 #include "core/rendering/RenderView.h" |
| 42 #include "core/rendering/style/BorderEdge.h" | 42 #include "core/rendering/style/BorderEdge.h" |
| 43 #include "core/rendering/style/ShadowList.h" | 43 #include "core/rendering/style/ShadowList.h" |
| 44 #include "platform/LengthFunctions.h" | 44 #include "platform/LengthFunctions.h" |
| 45 #include "platform/geometry/TransformState.h" | 45 #include "platform/geometry/TransformState.h" |
| 46 #include "platform/graphics/DrawLooperBuilder.h" | 46 #include "platform/graphics/DrawLooperBuilder.h" |
| 47 #include "platform/graphics/GraphicsContextStateSaver.h" | 47 #include "platform/graphics/GraphicsContextStateSaver.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 layer()->contentChanged(changeType); | 87 layer()->contentChanged(changeType); |
| 88 } | 88 } |
| 89 | 89 |
| 90 bool RenderBoxModelObject::hasAcceleratedCompositing() const | 90 bool RenderBoxModelObject::hasAcceleratedCompositing() const |
| 91 { | 91 { |
| 92 return view()->compositor()->hasAcceleratedCompositing(); | 92 return view()->compositor()->hasAcceleratedCompositing(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 RenderBoxModelObject::RenderBoxModelObject(ContainerNode* node) | 95 RenderBoxModelObject::RenderBoxModelObject(ContainerNode* node) |
| 96 : RenderLayerModelObject(node) | 96 : LayoutLayerModelObject(node) |
| 97 { | 97 { |
| 98 } | 98 } |
| 99 | 99 |
| 100 RenderBoxModelObject::~RenderBoxModelObject() | 100 RenderBoxModelObject::~RenderBoxModelObject() |
| 101 { | 101 { |
| 102 } | 102 } |
| 103 | 103 |
| 104 void RenderBoxModelObject::willBeDestroyed() | 104 void RenderBoxModelObject::willBeDestroyed() |
| 105 { | 105 { |
| 106 ImageQualityController::remove(this); | 106 ImageQualityController::remove(this); |
| 107 | 107 |
| 108 // A continuation of this RenderObject should be destroyed at subclasses. | 108 // A continuation of this RenderObject should be destroyed at subclasses. |
| 109 ASSERT(!continuation()); | 109 ASSERT(!continuation()); |
| 110 | 110 |
| 111 RenderLayerModelObject::willBeDestroyed(); | 111 LayoutLayerModelObject::willBeDestroyed(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 bool RenderBoxModelObject::calculateHasBoxDecorations() const | 114 bool RenderBoxModelObject::calculateHasBoxDecorations() const |
| 115 { | 115 { |
| 116 RenderStyle* styleToUse = style(); | 116 RenderStyle* styleToUse = style(); |
| 117 ASSERT(styleToUse); | 117 ASSERT(styleToUse); |
| 118 return hasBackground() || styleToUse->hasBorder() || styleToUse->hasAppearan
ce() || styleToUse->boxShadow(); | 118 return hasBackground() || styleToUse->hasBorder() || styleToUse->hasAppearan
ce() || styleToUse->boxShadow(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void RenderBoxModelObject::updateFromStyle() | 121 void RenderBoxModelObject::updateFromStyle() |
| 122 { | 122 { |
| 123 RenderLayerModelObject::updateFromStyle(); | 123 LayoutLayerModelObject::updateFromStyle(); |
| 124 | 124 |
| 125 RenderStyle* styleToUse = style(); | 125 RenderStyle* styleToUse = style(); |
| 126 setHasBoxDecorationBackground(calculateHasBoxDecorations()); | 126 setHasBoxDecorationBackground(calculateHasBoxDecorations()); |
| 127 setInline(styleToUse->isDisplayInlineType()); | 127 setInline(styleToUse->isDisplayInlineType()); |
| 128 setPositionState(styleToUse->position()); | 128 setPositionState(styleToUse->position()); |
| 129 setHorizontalWritingMode(styleToUse->isHorizontalWritingMode()); | 129 setHorizontalWritingMode(styleToUse->isHorizontalWritingMode()); |
| 130 } | 130 } |
| 131 | 131 |
| 132 static LayoutSize accumulateInFlowPositionOffsets(const RenderObject* child) | 132 static LayoutSize accumulateInFlowPositionOffsets(const RenderObject* child) |
| 133 { | 133 { |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 continuationMap = new ContinuationMap; | 475 continuationMap = new ContinuationMap; |
| 476 continuationMap->set(this, continuation); | 476 continuationMap->set(this, continuation); |
| 477 } else { | 477 } else { |
| 478 if (continuationMap) | 478 if (continuationMap) |
| 479 continuationMap->remove(this); | 479 continuationMap->remove(this); |
| 480 } | 480 } |
| 481 } | 481 } |
| 482 | 482 |
| 483 void RenderBoxModelObject::computeLayerHitTestRects(LayerHitTestRects& rects) co
nst | 483 void RenderBoxModelObject::computeLayerHitTestRects(LayerHitTestRects& rects) co
nst |
| 484 { | 484 { |
| 485 RenderLayerModelObject::computeLayerHitTestRects(rects); | 485 LayoutLayerModelObject::computeLayerHitTestRects(rects); |
| 486 | 486 |
| 487 // If there is a continuation then we need to consult it here, since this is | 487 // If there is a continuation then we need to consult it here, since this is |
| 488 // the root of the tree walk and it wouldn't otherwise get picked up. | 488 // the root of the tree walk and it wouldn't otherwise get picked up. |
| 489 // Continuations should always be siblings in the tree, so any others should | 489 // Continuations should always be siblings in the tree, so any others should |
| 490 // get picked up already by the tree walk. | 490 // get picked up already by the tree walk. |
| 491 if (continuation()) | 491 if (continuation()) |
| 492 continuation()->computeLayerHitTestRects(rects); | 492 continuation()->computeLayerHitTestRects(rects); |
| 493 } | 493 } |
| 494 | 494 |
| 495 LayoutRect RenderBoxModelObject::localCaretRectForEmptyElement(LayoutUnit width,
LayoutUnit textIndentOffset) | 495 LayoutRect RenderBoxModelObject::localCaretRectForEmptyElement(LayoutUnit width,
LayoutUnit textIndentOffset) |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 | 580 |
| 581 bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || styl
e()->preserves3D()); | 581 bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || styl
e()->preserves3D()); |
| 582 if (mode & UseTransforms && shouldUseTransformFromContainer(o)) { | 582 if (mode & UseTransforms && shouldUseTransformFromContainer(o)) { |
| 583 TransformationMatrix t; | 583 TransformationMatrix t; |
| 584 getTransformFromContainer(o, containerOffset, t); | 584 getTransformFromContainer(o, containerOffset, t); |
| 585 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate
Transform : TransformState::FlattenTransform); | 585 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate
Transform : TransformState::FlattenTransform); |
| 586 } else | 586 } else |
| 587 transformState.move(containerOffset.width(), containerOffset.height(), p
reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo
rm); | 587 transformState.move(containerOffset.width(), containerOffset.height(), p
reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo
rm); |
| 588 } | 588 } |
| 589 | 589 |
| 590 const RenderObject* RenderBoxModelObject::pushMappingToContainer(const RenderLay
erModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const | 590 const RenderObject* RenderBoxModelObject::pushMappingToContainer(const LayoutLay
erModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const |
| 591 { | 591 { |
| 592 ASSERT(ancestorToStopAt != this); | 592 ASSERT(ancestorToStopAt != this); |
| 593 | 593 |
| 594 bool ancestorSkipped; | 594 bool ancestorSkipped; |
| 595 RenderObject* container = this->container(ancestorToStopAt, &ancestorSkipped
); | 595 RenderObject* container = this->container(ancestorToStopAt, &ancestorSkipped
); |
| 596 if (!container) | 596 if (!container) |
| 597 return 0; | 597 return 0; |
| 598 | 598 |
| 599 bool isInline = isRenderInline(); | 599 bool isInline = isRenderInline(); |
| 600 bool isFixedPos = !isInline && style()->position() == FixedPosition; | 600 bool isFixedPos = !isInline && style()->position() == FixedPosition; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); | 655 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); |
| 656 for (RenderObject* child = startChild; child && child != endChild; ) { | 656 for (RenderObject* child = startChild; child && child != endChild; ) { |
| 657 // Save our next sibling as moveChildTo will clear it. | 657 // Save our next sibling as moveChildTo will clear it. |
| 658 RenderObject* nextSibling = child->nextSibling(); | 658 RenderObject* nextSibling = child->nextSibling(); |
| 659 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); | 659 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); |
| 660 child = nextSibling; | 660 child = nextSibling; |
| 661 } | 661 } |
| 662 } | 662 } |
| 663 | 663 |
| 664 } // namespace blink | 664 } // namespace blink |
| OLD | NEW |