| 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 * Copyright (C) 2003, 2006, 2007, 2009 Apple Inc. All rights reserved. | 4 * Copyright (C) 2003, 2006, 2007, 2009 Apple Inc. All rights reserved. |
| 5 * Copyright (C) 2010 Google Inc. All rights reserved. | 5 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| 11 * | 11 * |
| 12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
| 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 * Library General Public License for more details. | 15 * Library General Public License for more details. |
| 16 * | 16 * |
| 17 * You should have received a copy of the GNU Library General Public License | 17 * You should have received a copy of the GNU Library General Public License |
| 18 * along with this library; see the file COPYING.LIB. If not, write to | 18 * along with this library; see the file COPYING.LIB. If not, write to |
| 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 20 * Boston, MA 02110-1301, USA. | 20 * Boston, MA 02110-1301, USA. |
| 21 * | 21 * |
| 22 */ | 22 */ |
| 23 | 23 |
| 24 #ifndef RenderBoxModelObject_h | 24 #ifndef RenderBoxModelObject_h |
| 25 #define RenderBoxModelObject_h | 25 #define RenderBoxModelObject_h |
| 26 | 26 |
| 27 #include "core/rendering/RenderLayerModelObject.h" | 27 #include "core/layout/LayoutLayerModelObject.h" |
| 28 #include "core/rendering/style/ShadowData.h" | 28 #include "core/rendering/style/ShadowData.h" |
| 29 #include "platform/geometry/LayoutRect.h" | 29 #include "platform/geometry/LayoutRect.h" |
| 30 | 30 |
| 31 namespace blink { | 31 namespace blink { |
| 32 | 32 |
| 33 // Modes for some of the line-related functions. | 33 // Modes for some of the line-related functions. |
| 34 enum LinePositionMode { PositionOnContainingLine, PositionOfInteriorLineBoxes }; | 34 enum LinePositionMode { PositionOnContainingLine, PositionOfInteriorLineBoxes }; |
| 35 enum LineDirectionMode { HorizontalLine, VerticalLine }; | 35 enum LineDirectionMode { HorizontalLine, VerticalLine }; |
| 36 typedef unsigned BorderEdgeFlags; | 36 typedef unsigned BorderEdgeFlags; |
| 37 | 37 |
| 38 enum BackgroundBleedAvoidance { | 38 enum BackgroundBleedAvoidance { |
| 39 BackgroundBleedNone, | 39 BackgroundBleedNone, |
| 40 BackgroundBleedShrinkBackground, | 40 BackgroundBleedShrinkBackground, |
| 41 BackgroundBleedClipBackground, | 41 BackgroundBleedClipBackground, |
| 42 BackgroundBleedBackgroundOverBorder, | 42 BackgroundBleedBackgroundOverBorder, |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 enum ContentChangeType { | 45 enum ContentChangeType { |
| 46 ImageChanged, | 46 ImageChanged, |
| 47 CanvasChanged, | 47 CanvasChanged, |
| 48 CanvasContextChanged | 48 CanvasContextChanged |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 class InlineFlowBox; | 51 class InlineFlowBox; |
| 52 | 52 |
| 53 // This class is the base for all objects that adhere to the CSS box model as de
scribed | 53 // This class is the base for all objects that adhere to the CSS box model as de
scribed |
| 54 // at http://www.w3.org/TR/CSS21/box.html | 54 // at http://www.w3.org/TR/CSS21/box.html |
| 55 | 55 |
| 56 class RenderBoxModelObject : public RenderLayerModelObject { | 56 class RenderBoxModelObject : public LayoutLayerModelObject { |
| 57 public: | 57 public: |
| 58 RenderBoxModelObject(ContainerNode*); | 58 RenderBoxModelObject(ContainerNode*); |
| 59 virtual ~RenderBoxModelObject(); | 59 virtual ~RenderBoxModelObject(); |
| 60 | 60 |
| 61 LayoutSize relativePositionOffset() const; | 61 LayoutSize relativePositionOffset() const; |
| 62 LayoutSize relativePositionLogicalOffset() const { return style()->isHorizon
talWritingMode() ? relativePositionOffset() : relativePositionOffset().transpose
dSize(); } | 62 LayoutSize relativePositionLogicalOffset() const { return style()->isHorizon
talWritingMode() ? relativePositionOffset() : relativePositionOffset().transpose
dSize(); } |
| 63 | 63 |
| 64 LayoutSize offsetForInFlowPosition() const; | 64 LayoutSize offsetForInFlowPosition() const; |
| 65 | 65 |
| 66 // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlin
es (RenderFlow) | 66 // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlin
es (RenderFlow) |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 152 |
| 153 virtual void childBecameNonInline(RenderObject* /*child*/) { } | 153 virtual void childBecameNonInline(RenderObject* /*child*/) { } |
| 154 | 154 |
| 155 virtual bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance,
InlineFlowBox* = 0) const; | 155 virtual bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance,
InlineFlowBox* = 0) const; |
| 156 | 156 |
| 157 // Overridden by subclasses to determine line height and baseline position. | 157 // Overridden by subclasses to determine line height and baseline position. |
| 158 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio
nMode = PositionOnContainingLine) const = 0; | 158 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio
nMode = PositionOnContainingLine) const = 0; |
| 159 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode
, LinePositionMode = PositionOnContainingLine) const = 0; | 159 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode
, LinePositionMode = PositionOnContainingLine) const = 0; |
| 160 | 160 |
| 161 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c
onst override; | 161 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c
onst override; |
| 162 virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap&) const override; | 162 virtual const RenderObject* pushMappingToContainer(const LayoutLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap&) const override; |
| 163 | 163 |
| 164 virtual void setSelectionState(SelectionState) override; | 164 virtual void setSelectionState(SelectionState) override; |
| 165 | 165 |
| 166 void contentChanged(ContentChangeType); | 166 void contentChanged(ContentChangeType); |
| 167 bool hasAcceleratedCompositing() const; | 167 bool hasAcceleratedCompositing() const; |
| 168 | 168 |
| 169 virtual void computeLayerHitTestRects(LayerHitTestRects&) const override; | 169 virtual void computeLayerHitTestRects(LayerHitTestRects&) const override; |
| 170 | 170 |
| 171 protected: | 171 protected: |
| 172 virtual void willBeDestroyed() override; | 172 virtual void willBeDestroyed() override; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 private: | 214 private: |
| 215 LayoutUnit computedCSSPadding(const Length&) const; | 215 LayoutUnit computedCSSPadding(const Length&) const; |
| 216 virtual bool isBoxModelObject() const override final { return true; } | 216 virtual bool isBoxModelObject() const override final { return true; } |
| 217 }; | 217 }; |
| 218 | 218 |
| 219 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBoxModelObject, isBoxModelObject()); | 219 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBoxModelObject, isBoxModelObject()); |
| 220 | 220 |
| 221 } // namespace blink | 221 } // namespace blink |
| 222 | 222 |
| 223 #endif // RenderBoxModelObject_h | 223 #endif // RenderBoxModelObject_h |
| OLD | NEW |