OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 2269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2280 setStaticInlinePositionForChild(child, startAlignedOffsetForLine(logical
Top, indentText)); | 2280 setStaticInlinePositionForChild(child, startAlignedOffsetForLine(logical
Top, indentText)); |
2281 else | 2281 else |
2282 setStaticInlinePositionForChild(child, startOffsetForContent()); | 2282 setStaticInlinePositionForChild(child, startOffsetForContent()); |
2283 } | 2283 } |
2284 | 2284 |
2285 void LayoutBlockFlow::setStaticInlinePositionForChild(LayoutBox& child, LayoutUn
it inlinePosition) | 2285 void LayoutBlockFlow::setStaticInlinePositionForChild(LayoutBox& child, LayoutUn
it inlinePosition) |
2286 { | 2286 { |
2287 child.layer()->setStaticInlinePosition(inlinePosition); | 2287 child.layer()->setStaticInlinePosition(inlinePosition); |
2288 } | 2288 } |
2289 | 2289 |
| 2290 LayoutInline* LayoutBlockFlow::inlineElementContinuation() const |
| 2291 { |
| 2292 LayoutBoxModelObject* continuation = this->continuation(); |
| 2293 return continuation && continuation->isInline() ? toLayoutInline(continuatio
n) : nullptr; |
| 2294 } |
| 2295 |
2290 void LayoutBlockFlow::addChild(LayoutObject* newChild, LayoutObject* beforeChild
) | 2296 void LayoutBlockFlow::addChild(LayoutObject* newChild, LayoutObject* beforeChild
) |
2291 { | 2297 { |
2292 if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { | 2298 if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { |
2293 if (beforeChild == flowThread) | 2299 if (beforeChild == flowThread) |
2294 beforeChild = flowThread->firstChild(); | 2300 beforeChild = flowThread->firstChild(); |
2295 ASSERT(!beforeChild || beforeChild->isDescendantOf(flowThread)); | 2301 ASSERT(!beforeChild || beforeChild->isDescendantOf(flowThread)); |
2296 flowThread->addChild(newChild, beforeChild); | 2302 flowThread->addChild(newChild, beforeChild); |
2297 return; | 2303 return; |
2298 } | 2304 } |
2299 | 2305 |
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3329 if (floatingObject.layoutObject()->hitTest(result, locationInContain
er, childPoint)) { | 3335 if (floatingObject.layoutObject()->hitTest(result, locationInContain
er, childPoint)) { |
3330 updateHitTestResult(result, locationInContainer.point() - toLayo
utSize(childPoint)); | 3336 updateHitTestResult(result, locationInContainer.point() - toLayo
utSize(childPoint)); |
3331 return true; | 3337 return true; |
3332 } | 3338 } |
3333 } | 3339 } |
3334 } | 3340 } |
3335 | 3341 |
3336 return false; | 3342 return false; |
3337 } | 3343 } |
3338 | 3344 |
| 3345 LayoutSize LayoutBlockFlow::accumulateInFlowPositionOffsets() const |
| 3346 { |
| 3347 if (!isAnonymousBlock() || !isInFlowPositioned()) |
| 3348 return LayoutSize(); |
| 3349 LayoutSize offset; |
| 3350 for (const LayoutObject* p = inlineElementContinuation(); p && p->isLayoutIn
line(); p = p->parent()) { |
| 3351 if (p->isInFlowPositioned()) |
| 3352 offset += toLayoutInline(p)->offsetForInFlowPosition(); |
| 3353 } |
| 3354 return offset; |
| 3355 } |
| 3356 |
3339 LayoutUnit LayoutBlockFlow::logicalLeftFloatOffsetForLine(LayoutUnit logicalTop,
LayoutUnit fixedOffset, LayoutUnit logicalHeight) const | 3357 LayoutUnit LayoutBlockFlow::logicalLeftFloatOffsetForLine(LayoutUnit logicalTop,
LayoutUnit fixedOffset, LayoutUnit logicalHeight) const |
3340 { | 3358 { |
3341 if (m_floatingObjects && m_floatingObjects->hasLeftObjects()) | 3359 if (m_floatingObjects && m_floatingObjects->hasLeftObjects()) |
3342 return m_floatingObjects->logicalLeftOffset(fixedOffset, logicalTop, log
icalHeight); | 3360 return m_floatingObjects->logicalLeftOffset(fixedOffset, logicalTop, log
icalHeight); |
3343 | 3361 |
3344 return fixedOffset; | 3362 return fixedOffset; |
3345 } | 3363 } |
3346 | 3364 |
3347 LayoutUnit LayoutBlockFlow::logicalRightFloatOffsetForLine(LayoutUnit logicalTop
, LayoutUnit fixedOffset, LayoutUnit logicalHeight) const | 3365 LayoutUnit LayoutBlockFlow::logicalRightFloatOffsetForLine(LayoutUnit logicalTop
, LayoutUnit fixedOffset, LayoutUnit logicalHeight) const |
3348 { | 3366 { |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3781 if (!rect.isEmpty()) | 3799 if (!rect.isEmpty()) |
3782 rects.append(rect); | 3800 rects.append(rect); |
3783 } | 3801 } |
3784 } | 3802 } |
3785 | 3803 |
3786 if (inlineElementContinuation) | 3804 if (inlineElementContinuation) |
3787 inlineElementContinuation->addOutlineRects(rects, additionalOffset + (in
lineElementContinuation->containingBlock()->location() - location()), includeBlo
ckOverflows); | 3805 inlineElementContinuation->addOutlineRects(rects, additionalOffset + (in
lineElementContinuation->containingBlock()->location() - location()), includeBlo
ckOverflows); |
3788 } | 3806 } |
3789 | 3807 |
3790 } // namespace blink | 3808 } // namespace blink |
OLD | NEW |