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. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 RenderTextFragment; | 51 class RenderTextFragment; |
52 class StickyPositionViewportConstraints; | |
53 | 52 |
54 // 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 |
55 // at http://www.w3.org/TR/CSS21/box.html | 54 // at http://www.w3.org/TR/CSS21/box.html |
56 | 55 |
57 class RenderBoxModelObject : public RenderLayerModelObject { | 56 class RenderBoxModelObject : public RenderLayerModelObject { |
58 public: | 57 public: |
59 RenderBoxModelObject(ContainerNode*); | 58 RenderBoxModelObject(ContainerNode*); |
60 virtual ~RenderBoxModelObject(); | 59 virtual ~RenderBoxModelObject(); |
61 | 60 |
62 LayoutSize relativePositionOffset() const; | 61 LayoutSize relativePositionOffset() const; |
63 LayoutSize relativePositionLogicalOffset() const { return style()->isHorizon
talWritingMode() ? relativePositionOffset() : relativePositionOffset().transpose
dSize(); } | 62 LayoutSize relativePositionLogicalOffset() const { return style()->isHorizon
talWritingMode() ? relativePositionOffset() : relativePositionOffset().transpose
dSize(); } |
64 | 63 |
65 void computeStickyPositionConstraints(StickyPositionViewportConstraints&, co
nst FloatRect& constrainingRect) const; | |
66 LayoutSize stickyPositionOffset() const; | |
67 LayoutSize stickyPositionLogicalOffset() const { return style()->isHorizonta
lWritingMode() ? stickyPositionOffset() : stickyPositionOffset().transposedSize(
); } | |
68 | |
69 LayoutSize offsetForInFlowPosition() const; | 64 LayoutSize offsetForInFlowPosition() const; |
70 | 65 |
71 // 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) |
72 // to return the remaining width on a given line (and the height of a single
line). | 67 // to return the remaining width on a given line (and the height of a single
line). |
73 virtual LayoutUnit offsetLeft() const; | 68 virtual LayoutUnit offsetLeft() const; |
74 virtual LayoutUnit offsetTop() const; | 69 virtual LayoutUnit offsetTop() const; |
75 virtual LayoutUnit offsetWidth() const = 0; | 70 virtual LayoutUnit offsetWidth() const = 0; |
76 virtual LayoutUnit offsetHeight() const = 0; | 71 virtual LayoutUnit offsetHeight() const = 0; |
77 | 72 |
78 int pixelSnappedOffsetLeft() const { return roundToInt(offsetLeft()); } | 73 int pixelSnappedOffsetLeft() const { return roundToInt(offsetLeft()); } |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 } | 293 } |
299 void moveChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* st
artChild, RenderObject* endChild, RenderObject* beforeChild, bool fullRemoveInse
rt = false); | 294 void moveChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* st
artChild, RenderObject* endChild, RenderObject* beforeChild, bool fullRemoveInse
rt = false); |
300 | 295 |
301 enum ScaleByEffectiveZoomOrNot { ScaleByEffectiveZoom, DoNotScaleByEffective
Zoom }; | 296 enum ScaleByEffectiveZoomOrNot { ScaleByEffectiveZoom, DoNotScaleByEffective
Zoom }; |
302 IntSize calculateImageIntrinsicDimensions(StyleImage*, const IntSize& scaled
PositioningAreaSize, ScaleByEffectiveZoomOrNot) const; | 297 IntSize calculateImageIntrinsicDimensions(StyleImage*, const IntSize& scaled
PositioningAreaSize, ScaleByEffectiveZoomOrNot) const; |
303 | 298 |
304 private: | 299 private: |
305 LayoutUnit computedCSSPadding(const Length&) const; | 300 LayoutUnit computedCSSPadding(const Length&) const; |
306 virtual bool isBoxModelObject() const OVERRIDE FINAL { return true; } | 301 virtual bool isBoxModelObject() const OVERRIDE FINAL { return true; } |
307 | 302 |
308 virtual LayoutRect frameRectForStickyPositioning() const = 0; | |
309 | |
310 IntSize calculateFillTileSize(const FillLayer*, const IntSize& scaledPositio
ningAreaSize) const; | 303 IntSize calculateFillTileSize(const FillLayer*, const IntSize& scaledPositio
ningAreaSize) const; |
311 | 304 |
312 RoundedRect getBackgroundRoundedRect(const LayoutRect&, InlineFlowBox*, Layo
utUnit inlineBoxWidth, LayoutUnit inlineBoxHeight, | 305 RoundedRect getBackgroundRoundedRect(const LayoutRect&, InlineFlowBox*, Layo
utUnit inlineBoxWidth, LayoutUnit inlineBoxHeight, |
313 bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const; | 306 bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const; |
314 | 307 |
315 bool fixedBackgroundPaintsInLocalCoordinates() const; | 308 bool fixedBackgroundPaintsInLocalCoordinates() const; |
316 | 309 |
317 void clipBorderSidePolygon(GraphicsContext*, const RoundedRect& outerBorder,
const RoundedRect& innerBorder, | 310 void clipBorderSidePolygon(GraphicsContext*, const RoundedRect& outerBorder,
const RoundedRect& innerBorder, |
318 BoxSide, bool firstEdgeMatches, bool secondEdgeMa
tches); | 311 BoxSide, bool firstEdgeMatches, bool secondEdgeMa
tches); |
319 void clipBorderSideForComplexInnerPath(GraphicsContext*, const RoundedRect&,
const RoundedRect&, BoxSide, const class BorderEdge[]); | 312 void clipBorderSideForComplexInnerPath(GraphicsContext*, const RoundedRect&,
const RoundedRect&, BoxSide, const class BorderEdge[]); |
320 void paintOneBorderSide(GraphicsContext*, const RenderStyle*, const RoundedR
ect& outerBorder, const RoundedRect& innerBorder, | 313 void paintOneBorderSide(GraphicsContext*, const RenderStyle*, const RoundedR
ect& outerBorder, const RoundedRect& innerBorder, |
321 const IntRect& sideRect, BoxSide, BoxSide adjace
ntSide1, BoxSide adjacentSide2, const class BorderEdge[], | 314 const IntRect& sideRect, BoxSide, BoxSide adjace
ntSide1, BoxSide adjacentSide2, const class BorderEdge[], |
322 const Path*, BackgroundBleedAvoidance, bool incl
udeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialias, const Color* o
verrideColor = 0); | 315 const Path*, BackgroundBleedAvoidance, bool incl
udeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialias, const Color* o
verrideColor = 0); |
323 void paintTranslucentBorderSides(GraphicsContext*, const RenderStyle*, const
RoundedRect& outerBorder, const RoundedRect& innerBorder, const IntPoint& inner
BorderAdjustment, | 316 void paintTranslucentBorderSides(GraphicsContext*, const RenderStyle*, const
RoundedRect& outerBorder, const RoundedRect& innerBorder, const IntPoint& inner
BorderAdjustment, |
324 const class BorderEdge[], BorderEdgeFlags, BackgroundBleedAvoidance, boo
l includeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialias = false); | 317 const class BorderEdge[], BorderEdgeFlags, BackgroundBleedAvoidance, boo
l includeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialias = false); |
325 void paintBorderSides(GraphicsContext*, const RenderStyle*, const RoundedRec
t& outerBorder, const RoundedRect& innerBorder, | 318 void paintBorderSides(GraphicsContext*, const RenderStyle*, const RoundedRec
t& outerBorder, const RoundedRect& innerBorder, |
326 const IntPoint& innerBorderAdjustment, const class BorderEdge[], BorderE
dgeFlags, BackgroundBleedAvoidance, | 319 const IntPoint& innerBorderAdjustment, const class BorderEdge[], BorderE
dgeFlags, BackgroundBleedAvoidance, |
327 bool includeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialia
s = false, const Color* overrideColor = 0); | 320 bool includeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialia
s = false, const Color* overrideColor = 0); |
328 void drawBoxSideFromPath(GraphicsContext*, const LayoutRect&, const Path&, c
onst class BorderEdge[], | 321 void drawBoxSideFromPath(GraphicsContext*, const LayoutRect&, const Path&, c
onst class BorderEdge[], |
329 float thickness, float drawThickness, BoxSide, const
RenderStyle*, | 322 float thickness, float drawThickness, BoxSide, const
RenderStyle*, |
330 Color, EBorderStyle, BackgroundBleedAvoidance, bool
includeLogicalLeftEdge, bool includeLogicalRightEdge); | 323 Color, EBorderStyle, BackgroundBleedAvoidance, bool
includeLogicalLeftEdge, bool includeLogicalRightEdge); |
331 }; | 324 }; |
332 | 325 |
333 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBoxModelObject, isBoxModelObject()); | 326 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBoxModelObject, isBoxModelObject()); |
334 | 327 |
335 } // namespace WebCore | 328 } // namespace WebCore |
336 | 329 |
337 #endif // RenderBoxModelObject_h | 330 #endif // RenderBoxModelObject_h |
OLD | NEW |