| 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 20 matching lines...) Expand all Loading... |
| 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/accessibility/AXObjectCache.h" | 34 #include "core/accessibility/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/paint/BlockFlowPainter.h" | 39 #include "core/paint/BlockFlowPainter.h" |
| 40 #include "core/paint/DrawingRecorder.h" | 40 #include "core/paint/DrawingRecorder.h" |
| 41 #include "core/paint/GraphicsContextRecorder.h" |
| 41 #include "core/rendering/HitTestLocation.h" | 42 #include "core/rendering/HitTestLocation.h" |
| 42 #include "core/rendering/RenderFlowThread.h" | 43 #include "core/rendering/RenderFlowThread.h" |
| 43 #include "core/rendering/RenderLayer.h" | 44 #include "core/rendering/RenderLayer.h" |
| 44 #include "core/rendering/RenderMultiColumnFlowThread.h" | 45 #include "core/rendering/RenderMultiColumnFlowThread.h" |
| 45 #include "core/rendering/RenderPagedFlowThread.h" | 46 #include "core/rendering/RenderPagedFlowThread.h" |
| 46 #include "core/rendering/RenderText.h" | 47 #include "core/rendering/RenderText.h" |
| 47 #include "core/rendering/RenderView.h" | 48 #include "core/rendering/RenderView.h" |
| 48 #include "core/rendering/TextAutosizer.h" | 49 #include "core/rendering/TextAutosizer.h" |
| 49 #include "core/rendering/line/LineWidth.h" | 50 #include "core/rendering/line/LineWidth.h" |
| 50 #include "platform/geometry/TransformState.h" | 51 #include "platform/geometry/TransformState.h" |
| (...skipping 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2113 BlockFlowPainter(*this).paintFloats(paintInfo, paintOffset, preservePhase); | 2114 BlockFlowPainter(*this).paintFloats(paintInfo, paintOffset, preservePhase); |
| 2114 } | 2115 } |
| 2115 | 2116 |
| 2116 void RenderBlockFlow::paintSelection(const PaintInfo& paintInfo, const LayoutPoi
nt& paintOffset) | 2117 void RenderBlockFlow::paintSelection(const PaintInfo& paintInfo, const LayoutPoi
nt& paintOffset) |
| 2117 { | 2118 { |
| 2118 BlockFlowPainter(*this).paintSelection(paintInfo, paintOffset); | 2119 BlockFlowPainter(*this).paintSelection(paintInfo, paintOffset); |
| 2119 } | 2120 } |
| 2120 | 2121 |
| 2121 void RenderBlockFlow::clipOutFloatingObjects(const RenderBlock* rootBlock, const
PaintInfo* paintInfo, const LayoutPoint& rootBlockPhysicalPosition, const Layou
tSize& offsetFromRootBlock) const | 2122 void RenderBlockFlow::clipOutFloatingObjects(const RenderBlock* rootBlock, const
PaintInfo* paintInfo, const LayoutPoint& rootBlockPhysicalPosition, const Layou
tSize& offsetFromRootBlock) const |
| 2122 { | 2123 { |
| 2123 if (m_floatingObjects) { | 2124 if (!m_floatingObjects) |
| 2124 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); | 2125 return; |
| 2125 FloatingObjectSetIterator end = floatingObjectSet.end(); | 2126 |
| 2126 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end
; ++it) { | 2127 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); |
| 2127 FloatingObject* floatingObject = it->get(); | 2128 FloatingObjectSetIterator end = floatingObjectSet.end(); |
| 2128 LayoutRect floatBox(offsetFromRootBlock.width() + xPositionForFloatI
ncludingMargin(floatingObject), | 2129 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++
it) { |
| 2129 offsetFromRootBlock.height() + yPositionForFloatIncludingMargin(
floatingObject), | 2130 FloatingObject* floatingObject = it->get(); |
| 2130 floatingObject->renderer()->width(), floatingObject->renderer()-
>height()); | 2131 LayoutRect floatBox(offsetFromRootBlock.width() + xPositionForFloatInclu
dingMargin(floatingObject), |
| 2131 rootBlock->flipForWritingMode(floatBox); | 2132 offsetFromRootBlock.height() + yPositionForFloatIncludingMargin(floa
tingObject), |
| 2132 floatBox.move(rootBlockPhysicalPosition.x(), rootBlockPhysicalPositi
on.y()); | 2133 floatingObject->renderer()->width(), floatingObject->renderer()->hei
ght()); |
| 2134 rootBlock->flipForWritingMode(floatBox); |
| 2135 floatBox.move(rootBlockPhysicalPosition.x(), rootBlockPhysicalPosition.y
()); |
| 2136 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { |
| 2137 GraphicsContextRecorder::currentRecorder().addClipRecorder( |
| 2138 adoptPtr(new ClipRecorder(const_cast<RenderBlockFlow&>(*this), c
onst_cast<PaintInfo&>(*paintInfo), floatBox, SkRegion::kDifference_Op))); |
| 2139 } else { |
| 2133 paintInfo->context->clipOut(pixelSnappedIntRect(floatBox)); | 2140 paintInfo->context->clipOut(pixelSnappedIntRect(floatBox)); |
| 2134 } | 2141 } |
| 2135 } | 2142 } |
| 2136 } | 2143 } |
| 2137 | 2144 |
| 2138 void RenderBlockFlow::clearFloats(EClear clear) | 2145 void RenderBlockFlow::clearFloats(EClear clear) |
| 2139 { | 2146 { |
| 2140 positionNewFloats(); | 2147 positionNewFloats(); |
| 2141 // set y position | 2148 // set y position |
| 2142 LayoutUnit newY = 0; | 2149 LayoutUnit newY = 0; |
| (...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3092 FrameView* frameView = document().view(); | 3099 FrameView* frameView = document().view(); |
| 3093 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr
ollOffset().height(); | 3100 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr
ollOffset().height(); |
| 3094 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); | 3101 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); |
| 3095 if (height() < visibleHeight) | 3102 if (height() < visibleHeight) |
| 3096 top += (visibleHeight - height()) / 2; | 3103 top += (visibleHeight - height()) / 2; |
| 3097 setY(top); | 3104 setY(top); |
| 3098 dialog->setCentered(top); | 3105 dialog->setCentered(top); |
| 3099 } | 3106 } |
| 3100 | 3107 |
| 3101 } // namespace blink | 3108 } // namespace blink |
| OLD | NEW |