| 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) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
| 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r
ights 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 virtual void setSelectionState(SelectionState) override; | 157 virtual void setSelectionState(SelectionState) override; |
| 158 | 158 |
| 159 LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, co
nst LayoutRect& logicalRect); | 159 LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, co
nst LayoutRect& logicalRect); |
| 160 | 160 |
| 161 // Helper methods for computing line counts and heights for line counts. | 161 // Helper methods for computing line counts and heights for line counts. |
| 162 RootInlineBox* lineAtIndex(int) const; | 162 RootInlineBox* lineAtIndex(int) const; |
| 163 int lineCount(const RootInlineBox* = 0, bool* = 0) const; | 163 int lineCount(const RootInlineBox* = 0, bool* = 0) const; |
| 164 int heightForLineCount(int); | 164 int heightForLineCount(int); |
| 165 void clearTruncation(); | 165 void clearTruncation(); |
| 166 | 166 |
| 167 void addContinuationWithOutline(RenderInline*); | |
| 168 bool paintsContinuationOutline(RenderInline*); | |
| 169 | |
| 170 virtual RenderBoxModelObject* virtualContinuation() const override final { r
eturn continuation(); } | |
| 171 bool isAnonymousBlockContinuation() const { return continuation() && isAnony
mousBlock(); } | |
| 172 RenderInline* inlineElementContinuation() const; | |
| 173 RenderBlock* blockElementContinuation() const; | |
| 174 | |
| 175 using RenderBoxModelObject::continuation; | |
| 176 using RenderBoxModelObject::setContinuation; | |
| 177 | |
| 178 static RenderBlock* createAnonymousWithParentRendererAndDisplay(const Render
Object*, EDisplay = PARAGRAPH); | 167 static RenderBlock* createAnonymousWithParentRendererAndDisplay(const Render
Object*, EDisplay = PARAGRAPH); |
| 179 RenderBlock* createAnonymousBlock(EDisplay display = PARAGRAPH) const { retu
rn createAnonymousWithParentRendererAndDisplay(this, display); } | 168 RenderBlock* createAnonymousBlock(EDisplay display = PARAGRAPH) const { retu
rn createAnonymousWithParentRendererAndDisplay(this, display); } |
| 180 | 169 |
| 181 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* pare
nt) const override; | |
| 182 | |
| 183 // Accessors for logical width/height and margins in the containing block's
block-flow direction. | 170 // Accessors for logical width/height and margins in the containing block's
block-flow direction. |
| 184 LayoutUnit logicalWidthForChild(const RenderBox* child) const { return child
->width(); } | 171 LayoutUnit logicalWidthForChild(const RenderBox* child) const { return child
->width(); } |
| 185 LayoutUnit logicalHeightForChild(const RenderBox* child) const { return chil
d->height(); } | 172 LayoutUnit logicalHeightForChild(const RenderBox* child) const { return chil
d->height(); } |
| 186 LayoutSize logicalSizeForChild(const RenderBox* child) const { return child-
>size(); } | 173 LayoutSize logicalSizeForChild(const RenderBox* child) const { return child-
>size(); } |
| 187 LayoutUnit logicalTopForChild(const RenderBox* child) const { return child->
y(); } | 174 LayoutUnit logicalTopForChild(const RenderBox* child) const { return child->
y(); } |
| 188 LayoutUnit marginBeforeForChild(const RenderBoxModelObject* child) const { r
eturn child->marginBefore(style()); } | 175 LayoutUnit marginBeforeForChild(const RenderBoxModelObject* child) const { r
eturn child->marginBefore(style()); } |
| 189 LayoutUnit marginAfterForChild(const RenderBoxModelObject* child) const { re
turn child->marginAfter(style()); } | 176 LayoutUnit marginAfterForChild(const RenderBoxModelObject* child) const { re
turn child->marginAfter(style()); } |
| 190 LayoutUnit marginStartForChild(const RenderBoxModelObject* child) const { re
turn child->marginStart(style()); } | 177 LayoutUnit marginStartForChild(const RenderBoxModelObject* child) const { re
turn child->marginStart(style()); } |
| 191 LayoutUnit marginEndForChild(const RenderBoxModelObject* child) const { retu
rn child->marginEnd(style()); } | 178 LayoutUnit marginEndForChild(const RenderBoxModelObject* child) const { retu
rn child->marginEnd(style()); } |
| 192 void setMarginStartForChild(RenderBox* child, LayoutUnit value) const { chil
d->setMarginStart(value, style()); } | 179 void setMarginStartForChild(RenderBox* child, LayoutUnit value) const { chil
d->setMarginStart(value, style()); } |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 virtual const char* renderName() const override; | 283 virtual const char* renderName() const override; |
| 297 | 284 |
| 298 virtual bool isRenderBlock() const override final { return true; } | 285 virtual bool isRenderBlock() const override final { return true; } |
| 299 | 286 |
| 300 void makeChildrenNonInline(RenderObject* insertionPoint = 0); | 287 void makeChildrenNonInline(RenderObject* insertionPoint = 0); |
| 301 | 288 |
| 302 static void collapseAnonymousBlockChild(RenderBlock* parent, RenderBlock* ch
ild); | 289 static void collapseAnonymousBlockChild(RenderBlock* parent, RenderBlock* ch
ild); |
| 303 | 290 |
| 304 virtual void dirtyLinesFromChangedChild(RenderObject* child) override final
{ m_lineBoxes.dirtyLinesFromChangedChild(this, child); } | 291 virtual void dirtyLinesFromChangedChild(RenderObject* child) override final
{ m_lineBoxes.dirtyLinesFromChangedChild(this, child); } |
| 305 | 292 |
| 306 void addChildToContinuation(RenderObject* newChild, RenderObject* beforeChil
d); | |
| 307 virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObje
ct* beforeChild) override; | |
| 308 | |
| 309 void addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild, RenderObj
ect* beforeChild = 0); | 293 void addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild, RenderObj
ect* beforeChild = 0); |
| 310 | 294 |
| 311 void insertIntoTrackedRendererMaps(RenderBox* descendant, TrackedDescendants
Map*&, TrackedContainerMap*&); | 295 void insertIntoTrackedRendererMaps(RenderBox* descendant, TrackedDescendants
Map*&, TrackedContainerMap*&); |
| 312 static void removeFromTrackedRendererMaps(RenderBox* descendant, TrackedDesc
endantsMap*&, TrackedContainerMap*&); | 296 static void removeFromTrackedRendererMaps(RenderBox* descendant, TrackedDesc
endantsMap*&, TrackedContainerMap*&); |
| 313 | 297 |
| 314 Node* nodeForHitTest() const; | |
| 315 | |
| 316 void paintContents(PaintInfo&, const LayoutPoint&); | 298 void paintContents(PaintInfo&, const LayoutPoint&); |
| 317 void paintSelection(PaintInfo&, const LayoutPoint&); | 299 void paintSelection(PaintInfo&, const LayoutPoint&); |
| 318 void paintCarets(PaintInfo&, const LayoutPoint&); | 300 void paintCarets(PaintInfo&, const LayoutPoint&); |
| 319 | 301 |
| 320 bool hasCaret() const; | 302 bool hasCaret() const; |
| 321 | 303 |
| 322 bool hitTestContents(const HitTestRequest&, HitTestResult&, const HitTestLoc
ation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction)
; | 304 bool hitTestContents(const HitTestRequest&, HitTestResult&, const HitTestLoc
ation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction)
; |
| 323 | 305 |
| 324 void computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutU
nit& maxLogicalWidth) const; | 306 void computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutU
nit& maxLogicalWidth) const; |
| 325 | 307 |
| 326 // Obtains the nearest enclosing block (including this block) that contribut
es a first-line style to our inline | 308 // Obtains the nearest enclosing block (including this block) that contribut
es a first-line style to our inline |
| 327 // children. | 309 // children. |
| 328 virtual RenderBlock* firstLineBlock() const override; | 310 virtual RenderBlock* firstLineBlock() const override; |
| 329 | 311 |
| 330 virtual LayoutRect rectWithOutlineForPaintInvalidation(const RenderLayerMode
lObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalid
ationState* = 0) const override final; | |
| 331 | |
| 332 virtual RenderObject* hoverAncestor() const override final; | |
| 333 virtual void childBecameNonInline(RenderObject* child) override final; | |
| 334 | |
| 335 virtual LayoutRect selectionRectForPaintInvalidation(const RenderLayerModelO
bject* paintInvalidationContainer, bool /*clipToVisibleContent*/) override final | 312 virtual LayoutRect selectionRectForPaintInvalidation(const RenderLayerModelO
bject* paintInvalidationContainer, bool /*clipToVisibleContent*/) override final |
| 336 { | 313 { |
| 337 return selectionGapRectsForPaintInvalidation(paintInvalidationContainer)
; | 314 return selectionGapRectsForPaintInvalidation(paintInvalidationContainer)
; |
| 338 } | 315 } |
| 339 bool isSelectionRoot() const; | 316 bool isSelectionRoot() const; |
| 340 GapRects selectionGaps(RenderBlock* rootBlock, const LayoutPoint& rootBlockP
hysicalPosition, const LayoutSize& offsetFromRootBlock, | 317 GapRects selectionGaps(RenderBlock* rootBlock, const LayoutPoint& rootBlockP
hysicalPosition, const LayoutSize& offsetFromRootBlock, |
| 341 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLe
ft, LayoutUnit& lastLogicalRight, const PaintInfo* = 0); | 318 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLe
ft, LayoutUnit& lastLogicalRight, const PaintInfo* = 0); |
| 342 GapRects blockSelectionGaps(RenderBlock* rootBlock, const LayoutPoint& rootB
lockPhysicalPosition, const LayoutSize& offsetFromRootBlock, | 319 GapRects blockSelectionGaps(RenderBlock* rootBlock, const LayoutPoint& rootB
lockPhysicalPosition, const LayoutSize& offsetFromRootBlock, |
| 343 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogi
calLeft, LayoutUnit& lastLogicalRight, const PaintInfo*); | 320 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogi
calLeft, LayoutUnit& lastLogicalRight, const PaintInfo*); |
| 344 LayoutRect blockSelectionGap(RenderBlock* rootBlock, const LayoutPoint& root
BlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, | 321 LayoutRect blockSelectionGap(RenderBlock* rootBlock, const LayoutPoint& root
BlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, |
| 345 LayoutUnit lastLogicalTop, LayoutUnit lastLogic
alLeft, LayoutUnit lastLogicalRight, LayoutUnit logicalBottom, const PaintInfo*)
; | 322 LayoutUnit lastLogicalTop, LayoutUnit lastLogic
alLeft, LayoutUnit lastLogicalRight, LayoutUnit logicalBottom, const PaintInfo*)
; |
| 346 virtual LayoutUnit logicalLeftSelectionOffset(RenderBlock* rootBlock, Layout
Unit position); | 323 virtual LayoutUnit logicalLeftSelectionOffset(RenderBlock* rootBlock, Layout
Unit position); |
| 347 virtual LayoutUnit logicalRightSelectionOffset(RenderBlock* rootBlock, Layou
tUnit position); | 324 virtual LayoutUnit logicalRightSelectionOffset(RenderBlock* rootBlock, Layou
tUnit position); |
| 348 | 325 |
| 349 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const override; | 326 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const override; |
| 350 virtual void absoluteQuads(Vector<FloatQuad>&) const override; | 327 virtual void absoluteQuads(Vector<FloatQuad>&) const override; |
| 351 | 328 |
| 352 void paintContinuationOutlines(PaintInfo&, const LayoutPoint&); | |
| 353 | |
| 354 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e
xtraWidthToEndOfLine = 0) override final; | 329 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e
xtraWidthToEndOfLine = 0) override final; |
| 355 | 330 |
| 356 void markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUnit logicalBot
tom, RootInlineBox* highest = 0); | 331 void markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUnit logicalBot
tom, RootInlineBox* highest = 0); |
| 357 | 332 |
| 358 Position positionForBox(InlineBox*, bool start = true) const; | 333 Position positionForBox(InlineBox*, bool start = true) const; |
| 359 PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&); | 334 PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&); |
| 360 | 335 |
| 361 void splitBlocks(RenderBlock* fromBlock, RenderBlock* toBlock, RenderBlock*
middleBlock, | |
| 362 RenderObject* beforeChild, RenderBoxModelObject* oldCont); | |
| 363 RenderBlock* clone() const; | |
| 364 RenderBlock* continuationBefore(RenderObject* beforeChild); | |
| 365 | |
| 366 // End helper functions and structs used by layoutBlockChildren. | 336 // End helper functions and structs used by layoutBlockChildren. |
| 367 | 337 |
| 368 void removeFromGlobalMaps(); | 338 void removeFromGlobalMaps(); |
| 369 bool widthAvailableToChildrenHasChanged(); | 339 bool widthAvailableToChildrenHasChanged(); |
| 370 | 340 |
| 371 protected: | 341 protected: |
| 372 bool createsBlockFormattingContext() const; | 342 bool createsBlockFormattingContext() const; |
| 373 | 343 |
| 374 // Adjust from painting offsets to the local coords of this renderer | 344 // Adjust from painting offsets to the local coords of this renderer |
| 375 void offsetForContents(LayoutPoint&) const; | 345 void offsetForContents(LayoutPoint&) const; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 396 // FIXME: This is temporary as we move code that accesses block flow | 366 // FIXME: This is temporary as we move code that accesses block flow |
| 397 // member variables out of RenderBlock and into RenderBlockFlow. | 367 // member variables out of RenderBlock and into RenderBlockFlow. |
| 398 friend class RenderBlockFlow; | 368 friend class RenderBlockFlow; |
| 399 }; | 369 }; |
| 400 | 370 |
| 401 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock()); | 371 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock()); |
| 402 | 372 |
| 403 } // namespace blink | 373 } // namespace blink |
| 404 | 374 |
| 405 #endif // RenderBlock_h | 375 #endif // RenderBlock_h |
| OLD | NEW |