| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 LayoutUnit marginHeight() const { return marginTop() + marginBottom(); } | 144 LayoutUnit marginHeight() const { return marginTop() + marginBottom(); } |
| 145 LayoutUnit marginWidth() const { return marginLeft() + marginRight(); } | 145 LayoutUnit marginWidth() const { return marginLeft() + marginRight(); } |
| 146 LayoutUnit marginLogicalHeight() const { return marginBefore() + marginAfter
(); } | 146 LayoutUnit marginLogicalHeight() const { return marginBefore() + marginAfter
(); } |
| 147 LayoutUnit marginLogicalWidth() const { return marginStart() + marginEnd();
} | 147 LayoutUnit marginLogicalWidth() const { return marginStart() + marginEnd();
} |
| 148 | 148 |
| 149 bool hasInlineDirectionBordersPaddingOrMargin() const { return hasInlineDire
ctionBordersOrPadding() || marginStart()|| marginEnd(); } | 149 bool hasInlineDirectionBordersPaddingOrMargin() const { return hasInlineDire
ctionBordersOrPadding() || marginStart()|| marginEnd(); } |
| 150 bool hasInlineDirectionBordersOrPadding() const { return borderStart() || bo
rderEnd() || paddingStart()|| paddingEnd(); } | 150 bool hasInlineDirectionBordersOrPadding() const { return borderStart() || bo
rderEnd() || paddingStart()|| paddingEnd(); } |
| 151 | 151 |
| 152 LayoutUnit containingBlockLogicalWidthForContent() const; | 152 LayoutUnit containingBlockLogicalWidthForContent() const; |
| 153 | 153 |
| 154 virtual void childBecameNonInline(RenderObject* /*child*/) { } | |
| 155 | |
| 156 void paintBorder(const PaintInfo&, const LayoutRect&, const RenderStyle*, Ba
ckgroundBleedAvoidance = BackgroundBleedNone, bool includeLogicalLeftEdge = true
, bool includeLogicalRightEdge = true); | 154 void paintBorder(const PaintInfo&, const LayoutRect&, const RenderStyle*, Ba
ckgroundBleedAvoidance = BackgroundBleedNone, bool includeLogicalLeftEdge = true
, bool includeLogicalRightEdge = true); |
| 157 bool paintNinePieceImage(GraphicsContext*, const LayoutRect&, const RenderSt
yle*, const NinePieceImage&, CompositeOperator = CompositeSourceOver); | 155 bool paintNinePieceImage(GraphicsContext*, const LayoutRect&, const RenderSt
yle*, const NinePieceImage&, CompositeOperator = CompositeSourceOver); |
| 158 void paintBoxShadow(const PaintInfo&, const LayoutRect&, const RenderStyle*,
ShadowStyle, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge =
true); | 156 void paintBoxShadow(const PaintInfo&, const LayoutRect&, const RenderStyle*,
ShadowStyle, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge =
true); |
| 159 void paintFillLayerExtended(const PaintInfo&, const Color&, const FillLayer&
, const LayoutRect&, BackgroundBleedAvoidance, InlineFlowBox* = 0, const LayoutS
ize& = LayoutSize(), CompositeOperator = CompositeSourceOver, RenderObject* back
groundObject = 0, bool skipBaseColor = false); | 157 void paintFillLayerExtended(const PaintInfo&, const Color&, const FillLayer&
, const LayoutRect&, BackgroundBleedAvoidance, InlineFlowBox* = 0, const LayoutS
ize& = LayoutSize(), CompositeOperator = CompositeSourceOver, RenderObject* back
groundObject = 0, bool skipBaseColor = false); |
| 160 | 158 |
| 161 virtual bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance,
InlineFlowBox* = 0) const; | 159 virtual bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance,
InlineFlowBox* = 0) const; |
| 162 | 160 |
| 163 // Overridden by subclasses to determine line height and baseline position. | 161 // Overridden by subclasses to determine line height and baseline position. |
| 164 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio
nMode = PositionOnContainingLine) const = 0; | 162 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio
nMode = PositionOnContainingLine) const = 0; |
| 165 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode
, LinePositionMode = PositionOnContainingLine) const = 0; | 163 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode
, LinePositionMode = PositionOnContainingLine) const = 0; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 bool calculateHasBoxDecorations() const; | 241 bool calculateHasBoxDecorations() const; |
| 244 void calculateBackgroundImageGeometry(const RenderLayerModelObject* paintCon
tainer, const FillLayer&, const LayoutRect& paintRect, BackgroundImageGeometry&,
RenderObject* = 0) const; | 242 void calculateBackgroundImageGeometry(const RenderLayerModelObject* paintCon
tainer, const FillLayer&, const LayoutRect& paintRect, BackgroundImageGeometry&,
RenderObject* = 0) const; |
| 245 void getBorderEdgeInfo(class BorderEdge[], const RenderStyle*, bool includeL
ogicalLeftEdge = true, bool includeLogicalRightEdge = true) const; | 243 void getBorderEdgeInfo(class BorderEdge[], const RenderStyle*, bool includeL
ogicalLeftEdge = true, bool includeLogicalRightEdge = true) const; |
| 246 bool borderObscuresBackgroundEdge(const FloatSize& contextScale) const; | 244 bool borderObscuresBackgroundEdge(const FloatSize& contextScale) const; |
| 247 bool borderObscuresBackground() const; | 245 bool borderObscuresBackground() const; |
| 248 RoundedRect backgroundRoundedRectAdjustedForBleedAvoidance(GraphicsContext*,
const LayoutRect&, BackgroundBleedAvoidance, InlineFlowBox*, const LayoutSize&,
bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const; | 246 RoundedRect backgroundRoundedRectAdjustedForBleedAvoidance(GraphicsContext*,
const LayoutRect&, BackgroundBleedAvoidance, InlineFlowBox*, const LayoutSize&,
bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const; |
| 249 LayoutRect borderInnerRectAdjustedForBleedAvoidance(GraphicsContext*, const
LayoutRect&, BackgroundBleedAvoidance) const; | 247 LayoutRect borderInnerRectAdjustedForBleedAvoidance(GraphicsContext*, const
LayoutRect&, BackgroundBleedAvoidance) const; |
| 250 | 248 |
| 251 InterpolationQuality chooseInterpolationQuality(GraphicsContext*, Image*, co
nst void*, const LayoutSize&); | 249 InterpolationQuality chooseInterpolationQuality(GraphicsContext*, Image*, co
nst void*, const LayoutSize&); |
| 252 | 250 |
| 253 RenderBoxModelObject* continuation() const; | |
| 254 virtual void setContinuation(RenderBoxModelObject*); | |
| 255 | |
| 256 LayoutRect localCaretRectForEmptyElement(LayoutUnit width, LayoutUnit textIn
dentOffset); | 251 LayoutRect localCaretRectForEmptyElement(LayoutUnit width, LayoutUnit textIn
dentOffset); |
| 257 | 252 |
| 258 static void clipRoundedInnerRect(GraphicsContext*, const LayoutRect&, const
RoundedRect& clipRect); | 253 static void clipRoundedInnerRect(GraphicsContext*, const LayoutRect&, const
RoundedRect& clipRect); |
| 259 | 254 |
| 260 bool hasAutoHeightOrContainingBlockWithAutoHeight() const; | 255 bool hasAutoHeightOrContainingBlockWithAutoHeight() const; |
| 261 | 256 |
| 262 bool isDocumentElementWithOpaqueBackground() const; | 257 bool isDocumentElementWithOpaqueBackground() const; |
| 263 | 258 |
| 264 void paintRootBackgroundColor(const PaintInfo&, const LayoutRect&, const Col
or&); | 259 void paintRootBackgroundColor(const PaintInfo&, const LayoutRect&, const Col
or&); |
| 265 | 260 |
| 266 public: | 261 public: |
| 267 static bool shouldAntialiasLines(GraphicsContext*); | 262 static bool shouldAntialiasLines(GraphicsContext*); |
| 268 | 263 |
| 269 // These functions are only used internally to manipulate the render tree st
ructure via remove/insert/appendChildNode. | 264 // These functions are only used internally to manipulate the render tree st
ructure via remove/insert/appendChildNode. |
| 270 // Since they are typically called only to move objects around within anonym
ous blocks (which only have layers in | 265 void moveChildTo(RenderBoxModelObject* toBoxModelObject, RenderObject* child
, RenderObject* beforeChild, bool fullRemoveInsert); |
| 271 // the case of column spans), the default for fullRemoveInsert is false rath
er than true. | 266 void moveAllChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject*
beforeChild, bool fullRemoveInsert); |
| 272 void moveChildTo(RenderBoxModelObject* toBoxModelObject, RenderObject* child
, RenderObject* beforeChild, bool fullRemoveInsert = false); | |
| 273 void moveChildTo(RenderBoxModelObject* toBoxModelObject, RenderObject* child
, bool fullRemoveInsert = false) | |
| 274 { | |
| 275 moveChildTo(toBoxModelObject, child, 0, fullRemoveInsert); | |
| 276 } | |
| 277 void moveAllChildrenTo(RenderBoxModelObject* toBoxModelObject, bool fullRemo
veInsert = false) | |
| 278 { | |
| 279 moveAllChildrenTo(toBoxModelObject, 0, fullRemoveInsert); | |
| 280 } | |
| 281 void moveAllChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject*
beforeChild, bool fullRemoveInsert = false) | |
| 282 { | |
| 283 moveChildrenTo(toBoxModelObject, slowFirstChild(), 0, beforeChild, fullR
emoveInsert); | |
| 284 } | |
| 285 // Move all of the kids from |startChild| up to but excluding |endChild|. 0
can be passed as the |endChild| to denote | |
| 286 // that all the kids from |startChild| onwards should be moved. | |
| 287 void moveChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* st
artChild, RenderObject* endChild, bool fullRemoveInsert = false) | |
| 288 { | |
| 289 moveChildrenTo(toBoxModelObject, startChild, endChild, 0, fullRemoveInse
rt); | |
| 290 } | |
| 291 void moveChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* st
artChild, RenderObject* endChild, RenderObject* beforeChild, bool fullRemoveInse
rt = false); | |
| 292 | 267 |
| 293 IntSize calculateImageIntrinsicDimensions(StyleImage*, const IntSize& scaled
PositioningAreaSize) const; | 268 IntSize calculateImageIntrinsicDimensions(StyleImage*, const IntSize& scaled
PositioningAreaSize) const; |
| 294 | 269 |
| 295 private: | 270 private: |
| 296 LayoutUnit computedCSSPadding(const Length&) const; | 271 LayoutUnit computedCSSPadding(const Length&) const; |
| 297 virtual bool isBoxModelObject() const override final { return true; } | 272 virtual bool isBoxModelObject() const override final { return true; } |
| 298 | 273 |
| 299 IntSize calculateFillTileSize(const FillLayer&, const IntSize& scaledPositio
ningAreaSize) const; | 274 IntSize calculateFillTileSize(const FillLayer&, const IntSize& scaledPositio
ningAreaSize) const; |
| 300 | 275 |
| 301 RoundedRect getBackgroundRoundedRect(const LayoutRect&, InlineFlowBox*, Layo
utUnit inlineBoxWidth, LayoutUnit inlineBoxHeight, | 276 RoundedRect getBackgroundRoundedRect(const LayoutRect&, InlineFlowBox*, Layo
utUnit inlineBoxWidth, LayoutUnit inlineBoxHeight, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 317 void drawBoxSideFromPath(GraphicsContext*, const LayoutRect&, const Path&, c
onst class BorderEdge[], | 292 void drawBoxSideFromPath(GraphicsContext*, const LayoutRect&, const Path&, c
onst class BorderEdge[], |
| 318 float thickness, float drawThickness, BoxSide, const
RenderStyle*, | 293 float thickness, float drawThickness, BoxSide, const
RenderStyle*, |
| 319 Color, EBorderStyle, BackgroundBleedAvoidance, bool
includeLogicalLeftEdge, bool includeLogicalRightEdge); | 294 Color, EBorderStyle, BackgroundBleedAvoidance, bool
includeLogicalLeftEdge, bool includeLogicalRightEdge); |
| 320 }; | 295 }; |
| 321 | 296 |
| 322 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBoxModelObject, isBoxModelObject()); | 297 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBoxModelObject, isBoxModelObject()); |
| 323 | 298 |
| 324 } // namespace blink | 299 } // namespace blink |
| 325 | 300 |
| 326 #endif // RenderBoxModelObject_h | 301 #endif // RenderBoxModelObject_h |
| OLD | NEW |