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 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
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/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/rendering/HitTestLocation.h" | 40 #include "core/rendering/HitTestLocation.h" |
40 #include "core/rendering/RenderFlowThread.h" | 41 #include "core/rendering/RenderFlowThread.h" |
41 #include "core/rendering/RenderLayer.h" | 42 #include "core/rendering/RenderLayer.h" |
42 #include "core/rendering/RenderMultiColumnFlowThread.h" | 43 #include "core/rendering/RenderMultiColumnFlowThread.h" |
43 #include "core/rendering/RenderPagedFlowThread.h" | 44 #include "core/rendering/RenderPagedFlowThread.h" |
44 #include "core/rendering/RenderText.h" | 45 #include "core/rendering/RenderText.h" |
45 #include "core/rendering/RenderView.h" | 46 #include "core/rendering/RenderView.h" |
46 #include "core/rendering/TextAutosizer.h" | 47 #include "core/rendering/TextAutosizer.h" |
47 #include "core/rendering/line/LineWidth.h" | 48 #include "core/rendering/line/LineWidth.h" |
48 #include "core/rendering/svg/SVGTextRunRenderingContext.h" | 49 #include "core/rendering/svg/SVGTextRunRenderingContext.h" |
(...skipping 2046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2095 if (hasReflection()) | 2096 if (hasReflection()) |
2096 invalidatePaintRectangle(reflectedRect(paintInvalidationRect)); | 2097 invalidatePaintRectangle(reflectedRect(paintInvalidationRect)); |
2097 } | 2098 } |
2098 | 2099 |
2099 m_paintInvalidationLogicalTop = 0; | 2100 m_paintInvalidationLogicalTop = 0; |
2100 m_paintInvalidationLogicalBottom = 0; | 2101 m_paintInvalidationLogicalBottom = 0; |
2101 } | 2102 } |
2102 | 2103 |
2103 void RenderBlockFlow::paintFloats(PaintInfo& paintInfo, const LayoutPoint& paint
Offset, bool preservePhase) | 2104 void RenderBlockFlow::paintFloats(PaintInfo& paintInfo, const LayoutPoint& paint
Offset, bool preservePhase) |
2104 { | 2105 { |
2105 if (!m_floatingObjects) | 2106 BlockFlowPainter(*this).paintFloats(paintInfo, paintOffset, preservePhase); |
2106 return; | |
2107 | |
2108 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); | |
2109 FloatingObjectSetIterator end = floatingObjectSet.end(); | |
2110 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++
it) { | |
2111 FloatingObject* floatingObject = it->get(); | |
2112 // Only paint the object if our m_shouldPaint flag is set. | |
2113 if (floatingObject->shouldPaint() && !floatingObject->renderer()->hasSel
fPaintingLayer()) { | |
2114 PaintInfo currentPaintInfo(paintInfo); | |
2115 currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhas
eBlockBackground; | |
2116 // FIXME: LayoutPoint version of xPositionForFloatIncludingMargin wo
uld make this much cleaner. | |
2117 LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObj
ect, LayoutPoint(paintOffset.x() + xPositionForFloatIncludingMargin(floatingObje
ct) - floatingObject->renderer()->x(), paintOffset.y() + yPositionForFloatInclud
ingMargin(floatingObject) - floatingObject->renderer()->y())); | |
2118 floatingObject->renderer()->paint(currentPaintInfo, childPoint); | |
2119 if (!preservePhase) { | |
2120 currentPaintInfo.phase = PaintPhaseChildBlockBackgrounds; | |
2121 floatingObject->renderer()->paint(currentPaintInfo, childPoint); | |
2122 currentPaintInfo.phase = PaintPhaseFloat; | |
2123 floatingObject->renderer()->paint(currentPaintInfo, childPoint); | |
2124 currentPaintInfo.phase = PaintPhaseForeground; | |
2125 floatingObject->renderer()->paint(currentPaintInfo, childPoint); | |
2126 currentPaintInfo.phase = PaintPhaseOutline; | |
2127 floatingObject->renderer()->paint(currentPaintInfo, childPoint); | |
2128 } | |
2129 } | |
2130 } | |
2131 } | 2107 } |
2132 | 2108 |
2133 void RenderBlockFlow::clipOutFloatingObjects(const RenderBlock* rootBlock, const
PaintInfo* paintInfo, const LayoutPoint& rootBlockPhysicalPosition, const Layou
tSize& offsetFromRootBlock) const | 2109 void RenderBlockFlow::clipOutFloatingObjects(const RenderBlock* rootBlock, const
PaintInfo* paintInfo, const LayoutPoint& rootBlockPhysicalPosition, const Layou
tSize& offsetFromRootBlock) const |
2134 { | 2110 { |
2135 if (m_floatingObjects) { | 2111 if (m_floatingObjects) { |
2136 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); | 2112 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); |
2137 FloatingObjectSetIterator end = floatingObjectSet.end(); | 2113 FloatingObjectSetIterator end = floatingObjectSet.end(); |
2138 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end
; ++it) { | 2114 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end
; ++it) { |
2139 FloatingObject* floatingObject = it->get(); | 2115 FloatingObject* floatingObject = it->get(); |
2140 LayoutRect floatBox(offsetFromRootBlock.width() + xPositionForFloatI
ncludingMargin(floatingObject), | 2116 LayoutRect floatBox(offsetFromRootBlock.width() + xPositionForFloatI
ncludingMargin(floatingObject), |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2939 FrameView* frameView = document().view(); | 2915 FrameView* frameView = document().view(); |
2940 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr
ollOffset().height(); | 2916 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr
ollOffset().height(); |
2941 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); | 2917 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); |
2942 if (height() < visibleHeight) | 2918 if (height() < visibleHeight) |
2943 top += (visibleHeight - height()) / 2; | 2919 top += (visibleHeight - height()) / 2; |
2944 setY(top); | 2920 setY(top); |
2945 dialog->setCentered(top); | 2921 dialog->setCentered(top); |
2946 } | 2922 } |
2947 | 2923 |
2948 } // namespace blink | 2924 } // namespace blink |
OLD | NEW |