LEFT | RIGHT |
1 /* | 1 /* |
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
6 * Copyright (C) 2004-2017 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004-2017 Apple Inc. All rights reserved. |
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 m_firstLayoutCallbackPending = false; | 270 m_firstLayoutCallbackPending = false; |
271 m_wasScrolledByUser = false; | 271 m_wasScrolledByUser = false; |
272 m_delayedScrollEventTimer.stop(); | 272 m_delayedScrollEventTimer.stop(); |
273 m_shouldScrollToFocusedElement = false; | 273 m_shouldScrollToFocusedElement = false; |
274 m_delayedScrollToFocusedElementTimer.stop(); | 274 m_delayedScrollToFocusedElementTimer.stop(); |
275 m_lastViewportSize = IntSize(); | 275 m_lastViewportSize = IntSize(); |
276 m_lastZoomFactor = 1.0f; | 276 m_lastZoomFactor = 1.0f; |
277 m_isTrackingRepaints = false; | 277 m_isTrackingRepaints = false; |
278 m_trackedRepaintRects.clear(); | 278 m_trackedRepaintRects.clear(); |
279 m_lastPaintTime = MonotonicTime(); | 279 m_lastPaintTime = MonotonicTime(); |
280 m_paintBehavior = PaintBehaviorNormal; | 280 m_paintBehavior = PaintBehavior::Normal; |
281 m_isPainting = false; | 281 m_isPainting = false; |
282 m_visuallyNonEmptyCharacterCount = 0; | 282 m_visuallyNonEmptyCharacterCount = 0; |
283 m_visuallyNonEmptyPixelCount = 0; | 283 m_visuallyNonEmptyPixelCount = 0; |
284 m_isVisuallyNonEmpty = false; | 284 m_isVisuallyNonEmpty = false; |
285 m_firstVisuallyNonEmptyLayoutCallbackPending = true; | 285 m_firstVisuallyNonEmptyLayoutCallbackPending = true; |
286 m_renderTextCountForVisuallyNonEmptyCharacters = 0; | 286 m_renderTextCountForVisuallyNonEmptyCharacters = 0; |
287 m_renderedSignificantAmountOfText = false; | 287 m_renderedSignificantAmountOfText = false; |
288 m_significantRenderedTextMilestonePending = true; | 288 m_significantRenderedTextMilestonePending = true; |
289 m_needsDeferredScrollbarsUpdate = false; | 289 m_needsDeferredScrollbarsUpdate = false; |
290 m_maintainScrollPositionAnchor = nullptr; | 290 m_maintainScrollPositionAnchor = nullptr; |
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1386 { | 1386 { |
1387 if (printing) { | 1387 if (printing) { |
1388 if (m_mediaTypeWhenNotPrinting.isNull()) | 1388 if (m_mediaTypeWhenNotPrinting.isNull()) |
1389 m_mediaTypeWhenNotPrinting = mediaType(); | 1389 m_mediaTypeWhenNotPrinting = mediaType(); |
1390 setMediaType("print"); | 1390 setMediaType("print"); |
1391 } else { | 1391 } else { |
1392 if (!m_mediaTypeWhenNotPrinting.isNull()) | 1392 if (!m_mediaTypeWhenNotPrinting.isNull()) |
1393 setMediaType(m_mediaTypeWhenNotPrinting); | 1393 setMediaType(m_mediaTypeWhenNotPrinting); |
1394 m_mediaTypeWhenNotPrinting = String(); | 1394 m_mediaTypeWhenNotPrinting = String(); |
1395 } | 1395 } |
1396 | |
1397 RenderTheme::singleton().platformColorsDidChange(); | |
1398 } | 1396 } |
1399 | 1397 |
1400 bool FrameView::useSlowRepaints(bool considerOverlap) const | 1398 bool FrameView::useSlowRepaints(bool considerOverlap) const |
1401 { | 1399 { |
1402 bool mustBeSlow = hasSlowRepaintObjects() || (platformWidget() && hasViewpor
tConstrainedObjects()); | 1400 bool mustBeSlow = hasSlowRepaintObjects() || (platformWidget() && hasViewpor
tConstrainedObjects()); |
1403 | 1401 |
1404 // FIXME: WidgetMac.mm makes the assumption that useSlowRepaints == | 1402 // FIXME: WidgetMac.mm makes the assumption that useSlowRepaints == |
1405 // m_contentIsOpaque, so don't take the fast path for composited layers | 1403 // m_contentIsOpaque, so don't take the fast path for composited layers |
1406 // if they are a platform widget in order to get painting correctness | 1404 // if they are a platform widget in order to get painting correctness |
1407 // for transparent layers. See the comment in WidgetMac::paint. | 1405 // for transparent layers. See the comment in WidgetMac::paint. |
(...skipping 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4062 InspectorInstrumentation::willPaint(*renderView()); | 4060 InspectorInstrumentation::willPaint(*renderView()); |
4063 | 4061 |
4064 paintingState.isTopLevelPainter = !sCurrentPaintTimeStamp; | 4062 paintingState.isTopLevelPainter = !sCurrentPaintTimeStamp; |
4065 | 4063 |
4066 if (paintingState.isTopLevelPainter) | 4064 if (paintingState.isTopLevelPainter) |
4067 sCurrentPaintTimeStamp = MonotonicTime::now(); | 4065 sCurrentPaintTimeStamp = MonotonicTime::now(); |
4068 | 4066 |
4069 paintingState.paintBehavior = m_paintBehavior; | 4067 paintingState.paintBehavior = m_paintBehavior; |
4070 ···· | 4068 ···· |
4071 if (FrameView* parentView = parentFrameView()) { | 4069 if (FrameView* parentView = parentFrameView()) { |
4072 if (parentView->paintBehavior() & PaintBehaviorFlattenCompositingLayers) | 4070 if (parentView->paintBehavior() & PaintBehavior::FlattenCompositingLayer
s) |
4073 m_paintBehavior |= PaintBehaviorFlattenCompositingLayers; | 4071 m_paintBehavior |= PaintBehavior::FlattenCompositingLayers; |
4074 ········ | 4072 ········ |
4075 if (parentView->paintBehavior() & PaintBehaviorSnapshotting) | 4073 if (parentView->paintBehavior() & PaintBehavior::Snapshotting) |
4076 m_paintBehavior |= PaintBehaviorSnapshotting; | 4074 m_paintBehavior |= PaintBehavior::Snapshotting; |
4077 ········ | 4075 ········ |
4078 if (parentView->paintBehavior() & PaintBehaviorTileFirstPaint) | 4076 if (parentView->paintBehavior() & PaintBehavior::TileFirstPaint) |
4079 m_paintBehavior |= PaintBehaviorTileFirstPaint; | 4077 m_paintBehavior |= PaintBehavior::TileFirstPaint; |
4080 } | 4078 } |
4081 | 4079 |
4082 if (document->printing()) | 4080 if (document->printing()) { |
4083 m_paintBehavior |= (PaintBehaviorFlattenCompositingLayers | PaintBehavio
rSnapshotting); | 4081 m_paintBehavior |= PaintBehavior::FlattenCompositingLayers; |
4084 | 4082 m_paintBehavior |= PaintBehavior::Snapshotting; |
4085 paintingState.isFlatteningPaintOfRootFrame = (m_paintBehavior & PaintBehavio
rFlattenCompositingLayers) && !frame().ownerElement(); | 4083 } |
| 4084 |
| 4085 paintingState.isFlatteningPaintOfRootFrame = (m_paintBehavior & PaintBehavio
r::FlattenCompositingLayers) && !frame().ownerElement(); |
4086 if (paintingState.isFlatteningPaintOfRootFrame) | 4086 if (paintingState.isFlatteningPaintOfRootFrame) |
4087 notifyWidgetsInAllFrames(WillPaintFlattened); | 4087 notifyWidgetsInAllFrames(WillPaintFlattened); |
4088 | 4088 |
4089 ASSERT(!m_isPainting); | 4089 ASSERT(!m_isPainting); |
4090 m_isPainting = true; | 4090 m_isPainting = true; |
4091 } | 4091 } |
4092 | 4092 |
4093 void FrameView::didPaintContents(GraphicsContext& context, const IntRect& dirtyR
ect, PaintingState& paintingState) | 4093 void FrameView::didPaintContents(GraphicsContext& context, const IntRect& dirtyR
ect, PaintingState& paintingState) |
4094 { | 4094 { |
4095 m_isPainting = false; | 4095 m_isPainting = false; |
(...skipping 23 matching lines...) Expand all Loading... |
4119 void FrameView::paintContents(GraphicsContext& context, const IntRect& dirtyRect
, SecurityOriginPaintPolicy securityOriginPaintPolicy) | 4119 void FrameView::paintContents(GraphicsContext& context, const IntRect& dirtyRect
, SecurityOriginPaintPolicy securityOriginPaintPolicy) |
4120 { | 4120 { |
4121 #ifndef NDEBUG | 4121 #ifndef NDEBUG |
4122 bool fillWithWarningColor; | 4122 bool fillWithWarningColor; |
4123 if (frame().document()->printing()) | 4123 if (frame().document()->printing()) |
4124 fillWithWarningColor = false; // Printing, don't fill with red (can't re
member why). | 4124 fillWithWarningColor = false; // Printing, don't fill with red (can't re
member why). |
4125 else if (frame().ownerElement()) | 4125 else if (frame().ownerElement()) |
4126 fillWithWarningColor = false; // Subframe, don't fill with red. | 4126 fillWithWarningColor = false; // Subframe, don't fill with red. |
4127 else if (isTransparent()) | 4127 else if (isTransparent()) |
4128 fillWithWarningColor = false; // Transparent, don't fill with red. | 4128 fillWithWarningColor = false; // Transparent, don't fill with red. |
4129 else if (m_paintBehavior & PaintBehaviorSelectionOnly) | 4129 else if (m_paintBehavior & PaintBehavior::SelectionOnly) |
4130 fillWithWarningColor = false; // Selections are transparent, don't fill
with red. | 4130 fillWithWarningColor = false; // Selections are transparent, don't fill
with red. |
4131 else if (m_nodeToDraw) | 4131 else if (m_nodeToDraw) |
4132 fillWithWarningColor = false; // Element images are transparent, don't f
ill with red. | 4132 fillWithWarningColor = false; // Element images are transparent, don't f
ill with red. |
4133 else | 4133 else |
4134 fillWithWarningColor = true; | 4134 fillWithWarningColor = true; |
4135 ···· | 4135 ···· |
4136 if (fillWithWarningColor) | 4136 if (fillWithWarningColor) |
4137 context.fillRect(dirtyRect, Color(255, 64, 255)); | 4137 context.fillRect(dirtyRect, Color(255, 64, 255)); |
4138 #endif | 4138 #endif |
4139 | 4139 |
(...skipping 28 matching lines...) Expand all Loading... |
4168 while (is<RenderInline>(renderer) && !downcast<RenderInline>(*renderer).firs
tLineBox()) | 4168 while (is<RenderInline>(renderer) && !downcast<RenderInline>(*renderer).firs
tLineBox()) |
4169 renderer = renderer->parent(); | 4169 renderer = renderer->parent(); |
4170 | 4170 |
4171 rootLayer->paint(context, dirtyRect, LayoutSize(), m_paintBehavior, renderer
, 0, securityOriginPaintPolicy == SecurityOriginPaintPolicy::AnyOrigin ? RenderL
ayer::SecurityOriginPaintPolicy::AnyOrigin : RenderLayer::SecurityOriginPaintPol
icy::AccessibleOriginOnly); | 4171 rootLayer->paint(context, dirtyRect, LayoutSize(), m_paintBehavior, renderer
, 0, securityOriginPaintPolicy == SecurityOriginPaintPolicy::AnyOrigin ? RenderL
ayer::SecurityOriginPaintPolicy::AnyOrigin : RenderLayer::SecurityOriginPaintPol
icy::AccessibleOriginOnly); |
4172 if (rootLayer->containsDirtyOverlayScrollbars()) | 4172 if (rootLayer->containsDirtyOverlayScrollbars()) |
4173 rootLayer->paintOverlayScrollbars(context, dirtyRect, m_paintBehavior, r
enderer); | 4173 rootLayer->paintOverlayScrollbars(context, dirtyRect, m_paintBehavior, r
enderer); |
4174 | 4174 |
4175 didPaintContents(context, dirtyRect, paintingState); | 4175 didPaintContents(context, dirtyRect, paintingState); |
4176 } | 4176 } |
4177 | 4177 |
4178 void FrameView::setPaintBehavior(PaintBehavior behavior) | 4178 void FrameView::setPaintBehavior(OptionSet<PaintBehavior> behavior) |
4179 { | 4179 { |
4180 m_paintBehavior = behavior; | 4180 m_paintBehavior = behavior; |
4181 } | 4181 } |
4182 | 4182 |
4183 PaintBehavior FrameView::paintBehavior() const | 4183 OptionSet<PaintBehavior> FrameView::paintBehavior() const |
4184 { | 4184 { |
4185 return m_paintBehavior; | 4185 return m_paintBehavior; |
4186 } | 4186 } |
4187 | 4187 |
4188 bool FrameView::isPainting() const | 4188 bool FrameView::isPainting() const |
4189 { | 4189 { |
4190 return m_isPainting; | 4190 return m_isPainting; |
4191 } | 4191 } |
4192 | 4192 |
4193 // FIXME: change this to use the subtreePaint terminology. | 4193 // FIXME: change this to use the subtreePaint terminology. |
4194 void FrameView::setNodeToDraw(Node* node) | 4194 void FrameView::setNodeToDraw(Node* node) |
4195 { | 4195 { |
4196 m_nodeToDraw = node; | 4196 m_nodeToDraw = node; |
4197 } | 4197 } |
4198 | 4198 |
4199 void FrameView::paintContentsForSnapshot(GraphicsContext& context, const IntRect
& imageRect, SelectionInSnapshot shouldPaintSelection, CoordinateSpaceForSnapsho
t coordinateSpace) | 4199 void FrameView::paintContentsForSnapshot(GraphicsContext& context, const IntRect
& imageRect, SelectionInSnapshot shouldPaintSelection, CoordinateSpaceForSnapsho
t coordinateSpace) |
4200 { | 4200 { |
4201 updateLayoutAndStyleIfNeededRecursive(); | 4201 updateLayoutAndStyleIfNeededRecursive(); |
4202 | 4202 |
4203 // Cache paint behavior and set a new behavior appropriate for snapshots. | 4203 // Cache paint behavior and set a new behavior appropriate for snapshots. |
4204 PaintBehavior oldBehavior = paintBehavior(); | 4204 auto oldBehavior = paintBehavior(); |
4205 setPaintBehavior(oldBehavior | (PaintBehaviorFlattenCompositingLayers | Pain
tBehaviorSnapshotting)); | 4205 setPaintBehavior(oldBehavior | PaintBehavior::FlattenCompositingLayers | Pai
ntBehavior::Snapshotting); |
4206 | 4206 |
4207 // If the snapshot should exclude selection, then we'll clear the current se
lection | 4207 // If the snapshot should exclude selection, then we'll clear the current se
lection |
4208 // in the render tree only. This will allow us to restore the selection from
the DOM | 4208 // in the render tree only. This will allow us to restore the selection from
the DOM |
4209 // after we paint the snapshot. | 4209 // after we paint the snapshot. |
4210 if (shouldPaintSelection == ExcludeSelection) { | 4210 if (shouldPaintSelection == ExcludeSelection) { |
4211 for (auto* frame = m_frame.ptr(); frame; frame = frame->tree().traverseN
ext(m_frame.ptr())) { | 4211 for (auto* frame = m_frame.ptr(); frame; frame = frame->tree().traverseN
ext(m_frame.ptr())) { |
4212 if (auto* renderView = frame->contentRenderer()) | 4212 if (auto* renderView = frame->contentRenderer()) |
4213 renderView->selection().clear(); | 4213 renderView->selection().clear(); |
4214 } | 4214 } |
4215 } | 4215 } |
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5192 viewportSize.height = viewportSize.height.value_or(visibleContentSizeIncludi
ngScrollbars.height()); | 5192 viewportSize.height = viewportSize.height.value_or(visibleContentSizeIncludi
ngScrollbars.height()); |
5193 return { *viewportSize.width, *viewportSize.height }; | 5193 return { *viewportSize.width, *viewportSize.height }; |
5194 } | 5194 } |
5195 | 5195 |
5196 bool FrameView::shouldPlaceBlockDirectionScrollbarOnLeft() const | 5196 bool FrameView::shouldPlaceBlockDirectionScrollbarOnLeft() const |
5197 { | 5197 { |
5198 return renderView() && renderView()->shouldPlaceBlockDirectionScrollbarOnLef
t(); | 5198 return renderView() && renderView()->shouldPlaceBlockDirectionScrollbarOnLef
t(); |
5199 } | 5199 } |
5200 ···· | 5200 ···· |
5201 } // namespace WebCore | 5201 } // namespace WebCore |
LEFT | RIGHT |