| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "core/rendering/RenderBlockFlow.h" | 32 #include "core/rendering/RenderBlockFlow.h" |
| 33 | 33 |
| 34 #include "core/dom/AXObjectCache.h" | 34 #include "core/dom/AXObjectCache.h" |
| 35 #include "core/frame/FrameView.h" | 35 #include "core/frame/FrameView.h" |
| 36 #include "core/frame/LocalFrame.h" | 36 #include "core/frame/LocalFrame.h" |
| 37 #include "core/frame/Settings.h" | 37 #include "core/frame/Settings.h" |
| 38 #include "core/html/HTMLDialogElement.h" | 38 #include "core/html/HTMLDialogElement.h" |
| 39 #include "core/layout/HitTestLocation.h" | 39 #include "core/layout/HitTestLocation.h" |
| 40 #include "core/layout/Layer.h" |
| 40 #include "core/layout/line/LineBreaker.h" | 41 #include "core/layout/line/LineBreaker.h" |
| 41 #include "core/layout/line/LineWidth.h" | 42 #include "core/layout/line/LineWidth.h" |
| 42 #include "core/paint/BlockFlowPainter.h" | 43 #include "core/paint/BlockFlowPainter.h" |
| 43 #include "core/paint/RenderDrawingRecorder.h" | 44 #include "core/paint/RenderDrawingRecorder.h" |
| 44 #include "core/rendering/RenderFlowThread.h" | 45 #include "core/rendering/RenderFlowThread.h" |
| 45 #include "core/rendering/RenderLayer.h" | |
| 46 #include "core/rendering/RenderMultiColumnFlowThread.h" | 46 #include "core/rendering/RenderMultiColumnFlowThread.h" |
| 47 #include "core/rendering/RenderMultiColumnSpannerPlaceholder.h" | 47 #include "core/rendering/RenderMultiColumnSpannerPlaceholder.h" |
| 48 #include "core/rendering/RenderPagedFlowThread.h" | 48 #include "core/rendering/RenderPagedFlowThread.h" |
| 49 #include "core/rendering/RenderText.h" | 49 #include "core/rendering/RenderText.h" |
| 50 #include "core/rendering/RenderView.h" | 50 #include "core/rendering/RenderView.h" |
| 51 #include "core/rendering/TextAutosizer.h" | 51 #include "core/rendering/TextAutosizer.h" |
| 52 #include "platform/geometry/TransformState.h" | 52 #include "platform/geometry/TransformState.h" |
| 53 #include "platform/graphics/paint/ClipRecorderStack.h" | 53 #include "platform/graphics/paint/ClipRecorderStack.h" |
| 54 #include "platform/text/BidiTextRun.h" | 54 #include "platform/text/BidiTextRun.h" |
| 55 | 55 |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 | 360 |
| 361 updateLayerTransformAfterLayout(); | 361 updateLayerTransformAfterLayout(); |
| 362 | 362 |
| 363 // Update our scroll information if we're overflow:auto/scroll/hidden now th
at we know if | 363 // Update our scroll information if we're overflow:auto/scroll/hidden now th
at we know if |
| 364 // we overflow or not. | 364 // we overflow or not. |
| 365 updateScrollInfoAfterLayout(); | 365 updateScrollInfoAfterLayout(); |
| 366 | 366 |
| 367 if (m_paintInvalidationLogicalTop != m_paintInvalidationLogicalBottom) { | 367 if (m_paintInvalidationLogicalTop != m_paintInvalidationLogicalBottom) { |
| 368 bool hasVisibleContent = style()->visibility() == VISIBLE; | 368 bool hasVisibleContent = style()->visibility() == VISIBLE; |
| 369 if (!hasVisibleContent) { | 369 if (!hasVisibleContent) { |
| 370 RenderLayer* layer = enclosingLayer(); | 370 Layer* layer = enclosingLayer(); |
| 371 layer->updateDescendantDependentFlags(); | 371 layer->updateDescendantDependentFlags(); |
| 372 hasVisibleContent = layer->hasVisibleContent(); | 372 hasVisibleContent = layer->hasVisibleContent(); |
| 373 } | 373 } |
| 374 if (hasVisibleContent) | 374 if (hasVisibleContent) |
| 375 setShouldInvalidateOverflowForPaint(true); | 375 setShouldInvalidateOverflowForPaint(true); |
| 376 } | 376 } |
| 377 | 377 |
| 378 if (isHTMLDialogElement(node()) && isOutOfFlowPositioned()) | 378 if (isHTMLDialogElement(node()) && isOutOfFlowPositioned()) |
| 379 positionDialog(); | 379 positionDialog(); |
| 380 | 380 |
| (...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1342 updateStaticInlinePositionForChild(child, logicalTop); | 1342 updateStaticInlinePositionForChild(child, logicalTop); |
| 1343 | 1343 |
| 1344 if (!marginInfo.canCollapseWithMarginBefore()) { | 1344 if (!marginInfo.canCollapseWithMarginBefore()) { |
| 1345 // Positioned blocks don't collapse margins, so add the margin provided
by | 1345 // Positioned blocks don't collapse margins, so add the margin provided
by |
| 1346 // the container now. The child's own margin is added later when calcula
ting its logical top. | 1346 // the container now. The child's own margin is added later when calcula
ting its logical top. |
| 1347 LayoutUnit collapsedBeforePos = marginInfo.positiveMargin(); | 1347 LayoutUnit collapsedBeforePos = marginInfo.positiveMargin(); |
| 1348 LayoutUnit collapsedBeforeNeg = marginInfo.negativeMargin(); | 1348 LayoutUnit collapsedBeforeNeg = marginInfo.negativeMargin(); |
| 1349 logicalTop += collapsedBeforePos - collapsedBeforeNeg; | 1349 logicalTop += collapsedBeforePos - collapsedBeforeNeg; |
| 1350 } | 1350 } |
| 1351 | 1351 |
| 1352 RenderLayer* childLayer = child.layer(); | 1352 Layer* childLayer = child.layer(); |
| 1353 if (childLayer->staticBlockPosition() != logicalTop) { | 1353 if (childLayer->staticBlockPosition() != logicalTop) { |
| 1354 childLayer->setStaticBlockPosition(logicalTop); | 1354 childLayer->setStaticBlockPosition(logicalTop); |
| 1355 if (hasStaticBlockPosition) | 1355 if (hasStaticBlockPosition) |
| 1356 child.setChildNeedsLayout(MarkOnlyThis); | 1356 child.setChildNeedsLayout(MarkOnlyThis); |
| 1357 } | 1357 } |
| 1358 } | 1358 } |
| 1359 | 1359 |
| 1360 LayoutUnit RenderBlockFlow::clearFloatsIfNeeded(RenderBox& child, MarginInfo& ma
rginInfo, LayoutUnit oldTopPosMargin, LayoutUnit oldTopNegMargin, LayoutUnit yPo
s, bool childIsSelfCollapsing) | 1360 LayoutUnit RenderBlockFlow::clearFloatsIfNeeded(RenderBox& child, MarginInfo& ma
rginInfo, LayoutUnit oldTopPosMargin, LayoutUnit oldTopNegMargin, LayoutUnit yPo
s, bool childIsSelfCollapsing) |
| 1361 { | 1361 { |
| 1362 LayoutUnit heightIncrease = getClearDelta(&child, yPos); | 1362 LayoutUnit heightIncrease = getClearDelta(&child, yPos); |
| (...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2684 } | 2684 } |
| 2685 | 2685 |
| 2686 LayoutUnit RenderBlockFlow::logicalRightFloatOffsetForLine(LayoutUnit logicalTop
, LayoutUnit fixedOffset, LayoutUnit logicalHeight) const | 2686 LayoutUnit RenderBlockFlow::logicalRightFloatOffsetForLine(LayoutUnit logicalTop
, LayoutUnit fixedOffset, LayoutUnit logicalHeight) const |
| 2687 { | 2687 { |
| 2688 if (m_floatingObjects && m_floatingObjects->hasRightObjects()) | 2688 if (m_floatingObjects && m_floatingObjects->hasRightObjects()) |
| 2689 return m_floatingObjects->logicalRightOffset(fixedOffset, logicalTop, lo
gicalHeight); | 2689 return m_floatingObjects->logicalRightOffset(fixedOffset, logicalTop, lo
gicalHeight); |
| 2690 | 2690 |
| 2691 return fixedOffset; | 2691 return fixedOffset; |
| 2692 } | 2692 } |
| 2693 | 2693 |
| 2694 LayoutRect RenderBlockFlow::selectionRectForPaintInvalidation(const RenderLayerM
odelObject* paintInvalidationContainer) const | 2694 LayoutRect RenderBlockFlow::selectionRectForPaintInvalidation(const LayoutLayerM
odelObject* paintInvalidationContainer) const |
| 2695 { | 2695 { |
| 2696 LayoutRect rect = selectionGapRectsForPaintInvalidation(paintInvalidationCon
tainer); | 2696 LayoutRect rect = selectionGapRectsForPaintInvalidation(paintInvalidationCon
tainer); |
| 2697 // FIXME: groupedMapping() leaks the squashing abstraction. | 2697 // FIXME: groupedMapping() leaks the squashing abstraction. |
| 2698 if (paintInvalidationContainer->layer()->groupedMapping()) | 2698 if (paintInvalidationContainer->layer()->groupedMapping()) |
| 2699 RenderLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer
, rect); | 2699 Layer::mapRectToPaintBackingCoordinates(paintInvalidationContainer, rect
); |
| 2700 return rect; | 2700 return rect; |
| 2701 } | 2701 } |
| 2702 | 2702 |
| 2703 GapRects RenderBlockFlow::selectionGapRectsForPaintInvalidation(const RenderLaye
rModelObject* paintInvalidationContainer) const | 2703 GapRects RenderBlockFlow::selectionGapRectsForPaintInvalidation(const LayoutLaye
rModelObject* paintInvalidationContainer) const |
| 2704 { | 2704 { |
| 2705 ASSERT(!needsLayout()); | 2705 ASSERT(!needsLayout()); |
| 2706 | 2706 |
| 2707 if (!shouldPaintSelectionGaps()) | 2707 if (!shouldPaintSelectionGaps()) |
| 2708 return GapRects(); | 2708 return GapRects(); |
| 2709 | 2709 |
| 2710 TransformState transformState(TransformState::ApplyTransformDirection, Float
Point()); | 2710 TransformState transformState(TransformState::ApplyTransformDirection, Float
Point()); |
| 2711 mapLocalToContainer(paintInvalidationContainer, transformState, ApplyContain
erFlip | UseTransforms); | 2711 mapLocalToContainer(paintInvalidationContainer, transformState, ApplyContain
erFlip | UseTransforms); |
| 2712 LayoutPoint offsetFromPaintInvalidationContainer = roundedLayoutPoint(transf
ormState.mappedPoint()); | 2712 LayoutPoint offsetFromPaintInvalidationContainer = roundedLayoutPoint(transf
ormState.mappedPoint()); |
| 2713 | 2713 |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3140 FrameView* frameView = document().view(); | 3140 FrameView* frameView = document().view(); |
| 3141 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr
ollOffset().height(); | 3141 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr
ollOffset().height(); |
| 3142 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); | 3142 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); |
| 3143 if (size().height() < visibleHeight) | 3143 if (size().height() < visibleHeight) |
| 3144 top += (visibleHeight - size().height()) / 2; | 3144 top += (visibleHeight - size().height()) / 2; |
| 3145 setY(top); | 3145 setY(top); |
| 3146 dialog->setCentered(top); | 3146 dialog->setCentered(top); |
| 3147 } | 3147 } |
| 3148 | 3148 |
| 3149 } // namespace blink | 3149 } // namespace blink |
| OLD | NEW |