WebKit Bugzilla
Attachment 346568 Details for
Bug 188323
: Use enum classes and OptionSets for PaintPhase and PaintBehavior
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188323-20180803173403.patch (text/plain), 151.52 KB, created by
Alex Christensen
on 2018-08-03 17:34:04 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2018-08-03 17:34:04 PDT
Size:
151.52 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 234514) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,179 @@ >+2018-08-03 Alex Christensen <achristensen@webkit.org> >+ >+ Use enum classes and OptionSets for PaintPhase and PaintBehavior >+ https://bugs.webkit.org/show_bug.cgi?id=188323 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No change in behaviour. >+ >+ * html/shadow/MediaControlElements.cpp: >+ (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): >+ * page/FrameSnapshotting.cpp: >+ (WebCore::snapshotFrameRectWithClip): >+ * page/FrameView.cpp: >+ (WebCore::FrameView::reset): >+ (WebCore::FrameView::willPaintContents): >+ (WebCore::FrameView::paintContents): >+ (WebCore::FrameView::setPaintBehavior): >+ (WebCore::FrameView::paintBehavior const): >+ (WebCore::FrameView::paintContentsForSnapshot): >+ * page/FrameView.h: >+ * rendering/InlineElementBox.cpp: >+ (WebCore::InlineElementBox::paint): >+ * rendering/InlineFlowBox.cpp: >+ (WebCore::InlineFlowBox::paint): >+ (WebCore::InlineFlowBox::paintBoxDecorations): >+ (WebCore::InlineFlowBox::paintMask): >+ * rendering/InlineTextBox.cpp: >+ (WebCore::InlineTextBox::paint): >+ * rendering/PaintInfo.h: >+ (WebCore::PaintInfo::PaintInfo): >+ (WebCore::PaintInfo::forceBlackText const): >+ (WebCore::PaintInfo::forceWhiteText const): >+ (WebCore::PaintInfo::skipRootBackground const): >+ (WebCore::PaintInfo::paintRootBackgroundOnly const): >+ * rendering/PaintPhase.h: >+ (): Deleted. >+ * rendering/RenderBlock.cpp: >+ (WebCore::RenderBlock::paint): >+ (WebCore::RenderBlock::paintContents): >+ (WebCore::RenderBlock::paintObject): >+ (WebCore::RenderBlock::paintSelection): >+ * rendering/RenderBlockFlow.cpp: >+ (WebCore::RenderBlockFlow::paintFloats): >+ * rendering/RenderBox.cpp: >+ (WebCore::RenderBox::paintMask): >+ (WebCore::RenderBox::paintClippingMask): >+ (WebCore::RenderBox::paintMaskImages): >+ (WebCore::RenderBox::pushContentsClip): >+ (WebCore::RenderBox::popContentsClip): >+ * rendering/RenderBox.h: >+ * rendering/RenderBoxModelObject.cpp: >+ (WebCore::RenderBoxModelObject::decodingModeForImageDraw const): >+ (WebCore::RenderBoxModelObject::paintMaskForTextFillBox): >+ (WebCore::RenderBoxModelObject::fixedBackgroundPaintsInLocalCoordinates const): >+ * rendering/RenderDetailsMarker.cpp: >+ (WebCore::RenderDetailsMarker::paint): >+ * rendering/RenderElement.cpp: >+ (WebCore::RenderElement::paintAsInlineBlock): >+ (WebCore::RenderElement::selectionColor const): >+ * rendering/RenderEmbeddedObject.cpp: >+ (WebCore::RenderEmbeddedObject::paint): >+ (WebCore::RenderEmbeddedObject::paintReplaced): >+ * rendering/RenderFileUploadControl.cpp: >+ (WebCore::RenderFileUploadControl::paintObject): >+ * rendering/RenderFrameSet.cpp: >+ (WebCore::RenderFrameSet::paint): >+ * rendering/RenderHTMLCanvas.cpp: >+ (WebCore::RenderHTMLCanvas::paintReplaced): >+ * rendering/RenderImage.cpp: >+ (WebCore::RenderImage::paintReplaced): >+ (WebCore::RenderImage::paint): >+ * rendering/RenderLayer.cpp: >+ (WebCore::RenderLayer::renderableTransform const): >+ (WebCore::transparencyClipBox): >+ (WebCore::expandClipRectForDescendantsAndReflection): >+ (WebCore::paintingExtent): >+ (WebCore::RenderLayer::paint): >+ (WebCore::RenderLayer::paintOverlayScrollbars): >+ (WebCore::RenderLayer::paintLayer): >+ (WebCore::RenderLayer::paintLayerContents): >+ (WebCore::RenderLayer::paintBackgroundForFragments): >+ (WebCore::RenderLayer::paintForegroundForFragments): >+ (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase): >+ (WebCore::RenderLayer::paintOutlineForFragments): >+ (WebCore::RenderLayer::paintMaskForFragments): >+ (WebCore::RenderLayer::paintChildClippingMaskForFragments): >+ (WebCore::RenderLayer::calculateClipRects const): >+ * rendering/RenderLayer.h: >+ * rendering/RenderLayerBacking.cpp: >+ (WebCore::RenderLayerBacking::paintIntoLayer): >+ (WebCore::RenderLayerBacking::paintContents): >+ * rendering/RenderLayerBacking.h: >+ * rendering/RenderLineBoxList.cpp: >+ (WebCore::RenderLineBoxList::paint const): >+ * rendering/RenderListBox.cpp: >+ (WebCore::RenderListBox::paintObject): >+ * rendering/RenderListMarker.cpp: >+ (WebCore::RenderListMarker::paint): >+ * rendering/RenderReplaced.cpp: >+ (WebCore::RenderReplaced::paint): >+ (WebCore::RenderReplaced::shouldPaint): >+ * rendering/RenderReplica.cpp: >+ (WebCore::RenderReplica::paint): >+ * rendering/RenderScrollbarPart.cpp: >+ (WebCore::RenderScrollbarPart::paintIntoRect): >+ * rendering/RenderSnapshottedPlugIn.cpp: >+ (WebCore::RenderSnapshottedPlugIn::paint): >+ * rendering/RenderTable.cpp: >+ (WebCore::RenderTable::paintObject): >+ (WebCore::RenderTable::paintMask): >+ (WebCore::RenderTable::overflowClipRect): >+ * rendering/RenderTable.h: >+ * rendering/RenderTableCell.cpp: >+ (WebCore::RenderTableCell::paint): >+ (WebCore::RenderTableCell::paintCollapsedBorders): >+ (WebCore::RenderTableCell::paintMask): >+ * rendering/RenderTableRow.cpp: >+ (WebCore::RenderTableRow::paintOutlineForRowIfNeeded): >+ (WebCore::RenderTableRow::paint): >+ * rendering/RenderTableSection.cpp: >+ (WebCore::RenderTableSection::paint): >+ (WebCore::RenderTableSection::paintCell): >+ (WebCore::RenderTableSection::paintObject): >+ * rendering/RenderThemeMac.mm: >+ (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay): >+ (WebCore::RenderThemeMac::paintImageControlsButton): >+ * rendering/RenderVideo.cpp: >+ (WebCore::RenderVideo::paintReplaced): >+ * rendering/RenderWidget.cpp: >+ (WebCore::RenderWidget::paintContents): >+ (WebCore::RenderWidget::paint): >+ * rendering/RootInlineBox.cpp: >+ (WebCore::RootInlineBox::paintEllipsisBox const): >+ * rendering/SimpleLineLayoutFunctions.cpp: >+ (WebCore::SimpleLineLayout::paintFlow): >+ * rendering/mathml/MathOperator.cpp: >+ (WebCore::MathOperator::paint): >+ * rendering/mathml/RenderMathMLBlock.cpp: >+ (WebCore::RenderMathMLBlock::paint): >+ * rendering/mathml/RenderMathMLFraction.cpp: >+ (WebCore::RenderMathMLFraction::paint): >+ * rendering/mathml/RenderMathMLMenclose.cpp: >+ (WebCore::RenderMathMLMenclose::paint): >+ * rendering/mathml/RenderMathMLToken.cpp: >+ (WebCore::RenderMathMLToken::paint): >+ * rendering/svg/RenderSVGContainer.cpp: >+ (WebCore::RenderSVGContainer::paint): >+ * rendering/svg/RenderSVGForeignObject.cpp: >+ (WebCore::RenderSVGForeignObject::paint): >+ * rendering/svg/RenderSVGImage.cpp: >+ (WebCore::RenderSVGImage::paint): >+ * rendering/svg/RenderSVGResource.cpp: >+ (WebCore::requestPaintingResource): >+ * rendering/svg/RenderSVGResourceClipper.cpp: >+ (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage): >+ * rendering/svg/RenderSVGResourceSolidColor.cpp: >+ (WebCore::RenderSVGResourceSolidColor::applyResource): >+ * rendering/svg/RenderSVGRoot.cpp: >+ (WebCore::RenderSVGRoot::paintReplaced): >+ * rendering/svg/RenderSVGShape.cpp: >+ (WebCore::RenderSVGShape::paint): >+ * rendering/svg/RenderSVGText.cpp: >+ (WebCore::RenderSVGText::paint): >+ * rendering/svg/SVGInlineFlowBox.cpp: >+ (WebCore::SVGInlineFlowBox::paintSelectionBackground): >+ (WebCore::SVGInlineFlowBox::paint): >+ * rendering/svg/SVGInlineTextBox.cpp: >+ (WebCore::SVGInlineTextBox::paintSelectionBackground): >+ (WebCore::SVGInlineTextBox::paint): >+ * rendering/svg/SVGRenderingContext.cpp: >+ (WebCore::isRenderingMaskImage): >+ (WebCore::SVGRenderingContext::renderSubtreeToImageBuffer): >+ * rendering/svg/SVGRootInlineBox.cpp: >+ (WebCore::SVGRootInlineBox::paint): >+ > 2018-08-02 Timothy Hatcher <timothy@apple.com> > > Text selection color is hard to see in dark mode web views. >Index: Source/WebCore/html/shadow/MediaControlElements.cpp >=================================================================== >--- Source/WebCore/html/shadow/MediaControlElements.cpp (revision 234514) >+++ Source/WebCore/html/shadow/MediaControlElements.cpp (working copy) >@@ -1437,7 +1437,7 @@ RefPtr<Image> MediaControlTextTrackConta > if (!buffer) > return nullptr; > >- layer->paint(buffer->context(), paintingRect, LayoutSize(), PaintBehaviorFlattenCompositingLayers | PaintBehaviorSnapshotting, nullptr, RenderLayer::PaintLayerPaintingCompositingAllPhases); >+ layer->paint(buffer->context(), paintingRect, LayoutSize(), OptionSet<PaintBehavior>(PaintBehavior::FlattenCompositingLayers) | PaintBehavior::Snapshotting, nullptr, RenderLayer::PaintLayerPaintingCompositingAllPhases); > > return ImageBuffer::sinkIntoImage(WTFMove(buffer)); > } >Index: Source/WebCore/page/FrameSnapshotting.cpp >=================================================================== >--- Source/WebCore/page/FrameSnapshotting.cpp (revision 234514) >+++ Source/WebCore/page/FrameSnapshotting.cpp (working copy) >@@ -63,7 +63,7 @@ struct ScopedFramePaintingState { > > const Frame& frame; > const Node* node; >- const PaintBehavior paintBehavior; >+ const OptionSet<PaintBehavior> paintBehavior; > const Color backgroundColor; > }; > >@@ -90,15 +90,15 @@ std::unique_ptr<ImageBuffer> snapshotFra > > ScopedFramePaintingState state(frame, nullptr); > >- PaintBehavior paintBehavior = state.paintBehavior; >+ auto paintBehavior = state.paintBehavior; > if (options & SnapshotOptionsForceBlackText) >- paintBehavior |= PaintBehaviorForceBlackText; >+ paintBehavior |= PaintBehavior::ForceBlackText; > if (options & SnapshotOptionsPaintSelectionOnly) >- paintBehavior |= PaintBehaviorSelectionOnly; >+ paintBehavior |= PaintBehavior::SelectionOnly; > if (options & SnapshotOptionsPaintSelectionAndBackgroundsOnly) >- paintBehavior |= PaintBehaviorSelectionAndBackgroundsOnly; >+ paintBehavior |= PaintBehavior::SelectionAndBackgroundsOnly; > if (options & SnapshotOptionsPaintEverythingExcludingSelection) >- paintBehavior |= PaintBehaviorExcludeSelection; >+ paintBehavior |= PaintBehavior::ExcludeSelection; > > // Other paint behaviors are set by paintContentsForSnapshot. > frame.view()->setPaintBehavior(paintBehavior); >Index: Source/WebCore/page/FrameView.cpp >=================================================================== >--- Source/WebCore/page/FrameView.cpp (revision 234514) >+++ Source/WebCore/page/FrameView.cpp (working copy) >@@ -277,7 +277,7 @@ void FrameView::reset() > m_isTrackingRepaints = false; > m_trackedRepaintRects.clear(); > m_lastPaintTime = MonotonicTime(); >- m_paintBehavior = PaintBehaviorNormal; >+ m_paintBehavior = PaintBehavior::Normal; > m_isPainting = false; > m_visuallyNonEmptyCharacterCount = 0; > m_visuallyNonEmptyPixelCount = 0; >@@ -4062,20 +4062,22 @@ void FrameView::willPaintContents(Graphi > paintingState.paintBehavior = m_paintBehavior; > > if (FrameView* parentView = parentFrameView()) { >- if (parentView->paintBehavior() & PaintBehaviorFlattenCompositingLayers) >- m_paintBehavior |= PaintBehaviorFlattenCompositingLayers; >+ if (parentView->paintBehavior() & PaintBehavior::FlattenCompositingLayers) >+ m_paintBehavior |= PaintBehavior::FlattenCompositingLayers; > >- if (parentView->paintBehavior() & PaintBehaviorSnapshotting) >- m_paintBehavior |= PaintBehaviorSnapshotting; >+ if (parentView->paintBehavior() & PaintBehavior::Snapshotting) >+ m_paintBehavior |= PaintBehavior::Snapshotting; > >- if (parentView->paintBehavior() & PaintBehaviorTileFirstPaint) >- m_paintBehavior |= PaintBehaviorTileFirstPaint; >+ if (parentView->paintBehavior() & PaintBehavior::TileFirstPaint) >+ m_paintBehavior |= PaintBehavior::TileFirstPaint; > } > >- if (document->printing()) >- m_paintBehavior |= (PaintBehaviorFlattenCompositingLayers | PaintBehaviorSnapshotting); >+ if (document->printing()) { >+ m_paintBehavior |= PaintBehavior::FlattenCompositingLayers; >+ m_paintBehavior |= PaintBehavior::Snapshotting; >+ } > >- paintingState.isFlatteningPaintOfRootFrame = (m_paintBehavior & PaintBehaviorFlattenCompositingLayers) && !frame().ownerElement(); >+ paintingState.isFlatteningPaintOfRootFrame = (m_paintBehavior & PaintBehavior::FlattenCompositingLayers) && !frame().ownerElement(); > if (paintingState.isFlatteningPaintOfRootFrame) > notifyWidgetsInAllFrames(WillPaintFlattened); > >@@ -4119,7 +4121,7 @@ void FrameView::paintContents(GraphicsCo > fillWithWarningColor = false; // Subframe, don't fill with red. > else if (isTransparent()) > fillWithWarningColor = false; // Transparent, don't fill with red. >- else if (m_paintBehavior & PaintBehaviorSelectionOnly) >+ else if (m_paintBehavior & PaintBehavior::SelectionOnly) > fillWithWarningColor = false; // Selections are transparent, don't fill with red. > else if (m_nodeToDraw) > fillWithWarningColor = false; // Element images are transparent, don't fill with red. >@@ -4168,12 +4170,12 @@ void FrameView::paintContents(GraphicsCo > didPaintContents(context, dirtyRect, paintingState); > } > >-void FrameView::setPaintBehavior(PaintBehavior behavior) >+void FrameView::setPaintBehavior(OptionSet<PaintBehavior> behavior) > { > m_paintBehavior = behavior; > } > >-PaintBehavior FrameView::paintBehavior() const >+OptionSet<PaintBehavior> FrameView::paintBehavior() const > { > return m_paintBehavior; > } >@@ -4194,8 +4196,8 @@ void FrameView::paintContentsForSnapshot > updateLayoutAndStyleIfNeededRecursive(); > > // Cache paint behavior and set a new behavior appropriate for snapshots. >- PaintBehavior oldBehavior = paintBehavior(); >- setPaintBehavior(oldBehavior | (PaintBehaviorFlattenCompositingLayers | PaintBehaviorSnapshotting)); >+ auto oldBehavior = paintBehavior(); >+ setPaintBehavior(oldBehavior | PaintBehavior::FlattenCompositingLayers | PaintBehavior::Snapshotting); > > // If the snapshot should exclude selection, then we'll clear the current selection > // in the render tree only. This will allow us to restore the selection from the DOM >Index: Source/WebCore/page/FrameView.h >=================================================================== >--- Source/WebCore/page/FrameView.h (revision 234514) >+++ Source/WebCore/page/FrameView.h (working copy) >@@ -42,6 +42,7 @@ > #include <wtf/HashSet.h> > #include <wtf/IsoMalloc.h> > #include <wtf/ListHashSet.h> >+#include <wtf/OptionSet.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { >@@ -166,7 +167,7 @@ public: > // Returns true if the flush was completed. > WEBCORE_EXPORT bool flushCompositingStateIncludingSubframes(); > >- // Returns true when a paint with the PaintBehaviorFlattenCompositingLayers flag set gives >+ // Returns true when a paint with the PaintBehavior::FlattenCompositingLayers flag set gives > // a faithful representation of the content. > WEBCORE_EXPORT bool isSoftwareRenderable() const; > >@@ -347,7 +348,7 @@ public: > WEBCORE_EXPORT void paintContents(GraphicsContext&, const IntRect& dirtyRect, SecurityOriginPaintPolicy = SecurityOriginPaintPolicy::AnyOrigin) final; > > struct PaintingState { >- PaintBehavior paintBehavior; >+ OptionSet<PaintBehavior> paintBehavior; > bool isTopLevelPainter; > bool isFlatteningPaintOfRootFrame; > PaintingState() >@@ -365,8 +366,8 @@ public: > WEBCORE_EXPORT void didReplaceMultipartContent(); > #endif > >- WEBCORE_EXPORT void setPaintBehavior(PaintBehavior); >- WEBCORE_EXPORT PaintBehavior paintBehavior() const; >+ WEBCORE_EXPORT void setPaintBehavior(OptionSet<PaintBehavior>); >+ WEBCORE_EXPORT OptionSet<PaintBehavior> paintBehavior() const; > bool isPainting() const; > bool hasEverPainted() const { return !!m_lastPaintTime; } > void setLastPaintTime(MonotonicTime lastPaintTime) { m_lastPaintTime = lastPaintTime; } >@@ -854,7 +855,7 @@ private: > std::optional<LayoutRect> m_visualViewportOverrideRect; // Used when the iOS keyboard is showing. > > RefPtr<Node> m_nodeToDraw; >- PaintBehavior m_paintBehavior; >+ OptionSet<PaintBehavior> m_paintBehavior; > bool m_isPainting; > > unsigned m_visuallyNonEmptyCharacterCount; >Index: Source/WebCore/rendering/InlineElementBox.cpp >=================================================================== >--- Source/WebCore/rendering/InlineElementBox.cpp (revision 234514) >+++ Source/WebCore/rendering/InlineElementBox.cpp (working copy) >@@ -71,7 +71,7 @@ void InlineElementBox::paint(PaintInfo& > if (!paintInfo.shouldPaintWithinRoot(renderer())) > return; > >- if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection) >+ if (paintInfo.phase != PaintPhase::Foreground && paintInfo.phase != PaintPhase::Selection) > return; > > LayoutPoint childPoint = paintOffset; >Index: Source/WebCore/rendering/InlineFlowBox.cpp >=================================================================== >--- Source/WebCore/rendering/InlineFlowBox.cpp (revision 234514) >+++ Source/WebCore/rendering/InlineFlowBox.cpp (working copy) >@@ -1141,7 +1141,7 @@ bool InlineFlowBox::nodeAtPoint(const Hi > > void InlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom) > { >- if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPhaseOutline && paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintPhaseChildOutlines && paintInfo.phase != PaintPhaseTextClip && paintInfo.phase != PaintPhaseMask) >+ if (paintInfo.phase != PaintPhase::Foreground && paintInfo.phase != PaintPhase::Selection && paintInfo.phase != PaintPhase::Outline && paintInfo.phase != PaintPhase::SelfOutline && paintInfo.phase != PaintPhase::ChildOutlines && paintInfo.phase != PaintPhase::TextClip && paintInfo.phase != PaintPhase::Mask) > return; > > LayoutRect overflowRect(visualOverflowRect(lineTop, lineBottom)); >@@ -1151,8 +1151,8 @@ void InlineFlowBox::paint(PaintInfo& pai > if (!paintInfo.rect.intersects(snappedIntRect(overflowRect))) > return; > >- if (paintInfo.phase != PaintPhaseChildOutlines) { >- if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) { >+ if (paintInfo.phase != PaintPhase::ChildOutlines) { >+ if (paintInfo.phase == PaintPhase::Outline || paintInfo.phase == PaintPhase::SelfOutline) { > // Add ourselves to the paint info struct's list of inlines that need to paint their > // outlines. > if (renderer().style().visibility() == Visibility::Visible && renderer().hasOutline() && !isRootInlineBox()) { >@@ -1185,7 +1185,7 @@ void InlineFlowBox::paint(PaintInfo& pai > } else if (!inlineFlow.isContinuation()) > paintInfo.outlineObjects->add(&inlineFlow); > } >- } else if (paintInfo.phase == PaintPhaseMask) >+ } else if (paintInfo.phase == PaintPhase::Mask) > paintMask(paintInfo, paintOffset); > else { > // Paint our background, border and box-shadow. >@@ -1193,16 +1193,16 @@ void InlineFlowBox::paint(PaintInfo& pai > } > } > >- if (paintInfo.phase == PaintPhaseMask) >+ if (paintInfo.phase == PaintPhase::Mask) > return; > >- PaintPhase paintPhase = paintInfo.phase == PaintPhaseChildOutlines ? PaintPhaseOutline : paintInfo.phase; >+ PaintPhase paintPhase = paintInfo.phase == PaintPhase::ChildOutlines ? PaintPhase::Outline : paintInfo.phase; > PaintInfo childInfo(paintInfo); > childInfo.phase = paintPhase; > childInfo.updateSubtreePaintRootForChildren(&renderer()); > > // Paint our children. >- if (paintPhase != PaintPhaseSelfOutline) { >+ if (paintPhase != PaintPhase::SelfOutline) { > for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { > if (curr->renderer().isText() || !curr->boxModelObject()->hasSelfPaintingLayer()) > curr->paint(childInfo, paintOffset, lineTop, lineBottom); >@@ -1335,7 +1335,7 @@ static LayoutRect clipRectForNinePieceIm > > void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { >- if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style().visibility() != Visibility::Visible || paintInfo.phase != PaintPhaseForeground) >+ if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style().visibility() != Visibility::Visible || paintInfo.phase != PaintPhase::Foreground) > return; > > LayoutRect frameRect(this->frameRect()); >@@ -1414,7 +1414,7 @@ void InlineFlowBox::paintBoxDecorations( > > void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { >- if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style().visibility() != Visibility::Visible || paintInfo.phase != PaintPhaseMask) >+ if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style().visibility() != Visibility::Visible || paintInfo.phase != PaintPhase::Mask) > return; > > LayoutRect frameRect(this->frameRect()); >@@ -1431,7 +1431,7 @@ void InlineFlowBox::paintMask(PaintInfo& > // Figure out if we need to push a transparency layer to render our mask. > bool pushTransparencyLayer = false; > bool compositedMask = renderer().hasLayer() && renderer().layer()->hasCompositedMask(); >- bool flattenCompositingLayers = renderer().view().frameView().paintBehavior() & PaintBehaviorFlattenCompositingLayers; >+ bool flattenCompositingLayers = renderer().view().frameView().paintBehavior().contains(PaintBehavior::FlattenCompositingLayers); > CompositeOperator compositeOp = CompositeSourceOver; > if (!compositedMask || flattenCompositingLayers) { > if ((maskBoxImage && renderer().style().maskLayers().hasImage()) || renderer().style().maskLayers().next()) >Index: Source/WebCore/rendering/InlineTextBox.cpp >=================================================================== >--- Source/WebCore/rendering/InlineTextBox.cpp (revision 234514) >+++ Source/WebCore/rendering/InlineTextBox.cpp (working copy) >@@ -437,10 +437,10 @@ static MarkedText createMarkedTextFromSe > void InlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit /*lineTop*/, LayoutUnit /*lineBottom*/) > { > if (isLineBreak() || !paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style().visibility() != Visibility::Visible >- || m_truncation == cFullTruncation || paintInfo.phase == PaintPhaseOutline || !m_len) >+ || m_truncation == cFullTruncation || paintInfo.phase == PaintPhase::Outline || !m_len) > return; > >- ASSERT(paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintPhaseChildOutlines); >+ ASSERT(paintInfo.phase != PaintPhase::SelfOutline && paintInfo.phase != PaintPhase::ChildOutlines); > > LayoutUnit logicalLeftSide = logicalLeftVisualOverflow(); > LayoutUnit logicalRightSide = logicalRightVisualOverflow(); >@@ -458,10 +458,11 @@ void InlineTextBox::paint(PaintInfo& pai > bool isPrinting = renderer().document().printing(); > > // Determine whether or not we're selected. >- bool haveSelection = !isPrinting && paintInfo.phase != PaintPhaseTextClip && selectionState() != RenderObject::SelectionNone; >- if (!haveSelection && paintInfo.phase == PaintPhaseSelection) >+ bool haveSelection = !isPrinting && paintInfo.phase != PaintPhase::TextClip && selectionState() != RenderObject::SelectionNone; >+ if (!haveSelection && paintInfo.phase == PaintPhase::Selection) { > // When only painting the selection, don't bother to paint if there is none. > return; >+ } > > if (m_truncation != cNoTruncation) { > if (renderer().containingBlock()->style().isLeftToRightDirection() != isLeftToRightDirection()) { >@@ -504,7 +505,7 @@ void InlineTextBox::paint(PaintInfo& pai > > // 1. Paint backgrounds behind text if needed. Examples of such backgrounds include selection > // and composition underlines. >- if (paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPhaseTextClip && !isPrinting) { >+ if (paintInfo.phase != PaintPhase::Selection && paintInfo.phase != PaintPhase::TextClip && !isPrinting) { > if (containsComposition && !useCustomUnderlines) > paintCompositionBackground(paintInfo, boxOrigin); > >@@ -528,19 +529,19 @@ void InlineTextBox::paint(PaintInfo& pai > // legitimately be unpainted if they are waiting on a slow-loading web font. We should fix that, and > // when we do, we will have to account for the fact the InlineTextBoxes do not always have unique > // renderers and Page currently relies on each unpainted object having a unique renderer. >- if (paintInfo.phase == PaintPhaseForeground) >+ if (paintInfo.phase == PaintPhase::Foreground) > renderer().page().addRelevantRepaintedObject(&renderer(), IntRect(boxOrigin.x(), boxOrigin.y(), logicalWidth(), logicalHeight())); > > // 2. Now paint the foreground, including text and decorations like underline/overline (in quirks mode only). > bool shouldPaintSelectionForeground = haveSelection && !useCustomUnderlines; > Vector<MarkedText> markedTexts; >- if (paintInfo.phase != PaintPhaseSelection) { >+ if (paintInfo.phase != PaintPhase::Selection) { > // The marked texts for the gaps between document markers and selection are implicitly created by subdividing the entire line. > markedTexts.append({ clampedOffset(m_start), clampedOffset(end() + 1), MarkedText::Unmarked }); > if (!isPrinting) { > markedTexts.appendVector(collectMarkedTextsForDocumentMarkers(TextPaintPhase::Foreground)); > >- bool shouldPaintDraggedContent = !(paintInfo.paintBehavior & PaintBehaviorExcludeSelection); >+ bool shouldPaintDraggedContent = !(paintInfo.paintBehavior.contains(PaintBehavior::ExcludeSelection)); > if (shouldPaintDraggedContent) { > auto markedTextsForDraggedContent = collectMarkedTextsForDraggedContent(); > if (!markedTextsForDraggedContent.isEmpty()) { >@@ -561,7 +562,7 @@ void InlineTextBox::paint(PaintInfo& pai > auto styledMarkedTexts = subdivideAndResolveStyle(markedTexts, unmarkedStyle, paintInfo); > > // ... now remove the selection marked text if we are excluding selection. >- if (!isPrinting && paintInfo.paintBehavior & PaintBehaviorExcludeSelection) >+ if (!isPrinting && paintInfo.paintBehavior.contains(PaintBehavior::ExcludeSelection)) > styledMarkedTexts.removeAllMatching([] (const StyledMarkedText& markedText) { return markedText.type == MarkedText::Selection; }); > > // Coalesce styles of adjacent marked texts to minimize the number of drawing commands. >@@ -571,7 +572,7 @@ void InlineTextBox::paint(PaintInfo& pai > > // Paint decorations > auto textDecorations = lineStyle.textDecorationsInEffect(); >- if (!textDecorations.isEmpty() && paintInfo.phase != PaintPhaseSelection) { >+ if (!textDecorations.isEmpty() && paintInfo.phase != PaintPhase::Selection) { > TextRun textRun = createTextRun(); > unsigned length = textRun.length(); > if (m_truncation != cNoTruncation) >@@ -582,7 +583,7 @@ void InlineTextBox::paint(PaintInfo& pai > std::tie(selectionStart, selectionEnd) = selectionStartEnd(); > > FloatRect textDecorationSelectionClipOutRect; >- if ((paintInfo.paintBehavior & PaintBehaviorExcludeSelection) && selectionStart < selectionEnd && selectionEnd <= length) { >+ if ((paintInfo.paintBehavior.contains(PaintBehavior::ExcludeSelection)) && selectionStart < selectionEnd && selectionEnd <= length) { > textDecorationSelectionClipOutRect = logicalOverflowRect(); > textDecorationSelectionClipOutRect.moveBy(localPaintOffset); > float logicalWidthBeforeRange; >@@ -608,7 +609,7 @@ void InlineTextBox::paint(PaintInfo& pai > } > > // 3. Paint fancy decorations, including composition underlines and platform-specific underlines for spelling errors, grammar errors, et cetera. >- if (paintInfo.phase == PaintPhaseForeground) { >+ if (paintInfo.phase == PaintPhase::Foreground) { > paintPlatformDocumentMarkers(context, boxOrigin); > > if (useCustomUnderlines) >Index: Source/WebCore/rendering/PaintInfo.h >=================================================================== >--- Source/WebCore/rendering/PaintInfo.h (revision 234514) >+++ Source/WebCore/rendering/PaintInfo.h (working copy) >@@ -33,6 +33,7 @@ > #include <limits> > #include <wtf/HashMap.h> > #include <wtf/ListHashSet.h> >+#include <wtf/OptionSet.h> > > namespace WebCore { > >@@ -49,7 +50,7 @@ typedef HashMap<OverlapTestRequestClient > * (tx|ty) is the calculated position of the parent > */ > struct PaintInfo { >- PaintInfo(GraphicsContext& newContext, const LayoutRect& newRect, PaintPhase newPhase, PaintBehavior newPaintBehavior, >+ PaintInfo(GraphicsContext& newContext, const LayoutRect& newRect, PaintPhase newPhase, OptionSet<PaintBehavior> newPaintBehavior, > RenderObject* newSubtreePaintRoot = nullptr, ListHashSet<RenderInline*>* newOutlineObjects = nullptr, > OverlapTestRequestMap* overlapTestRequests = nullptr, const RenderLayerModelObject* newPaintContainer = nullptr, > const RenderLayer* enclosingSelfPaintingLayer = nullptr, bool newRequireSecurityOriginAccessForWidgets = false) >@@ -95,12 +96,12 @@ struct PaintInfo { > } > > bool forceTextColor() const { return forceBlackText() || forceWhiteText(); } >- bool forceBlackText() const { return paintBehavior & PaintBehaviorForceBlackText; } >- bool forceWhiteText() const { return paintBehavior & PaintBehaviorForceWhiteText; } >+ bool forceBlackText() const { return paintBehavior.contains(PaintBehavior::ForceBlackText); } >+ bool forceWhiteText() const { return paintBehavior.contains(PaintBehavior::ForceWhiteText); } > Color forcedTextColor() const { return (forceBlackText()) ? Color::black : Color::white; } > >- bool skipRootBackground() const { return paintBehavior & PaintBehaviorSkipRootBackground; } >- bool paintRootBackgroundOnly() const { return paintBehavior & PaintBehaviorRootBackgroundOnly; } >+ bool skipRootBackground() const { return paintBehavior.contains(PaintBehavior::SkipRootBackground); } >+ bool paintRootBackgroundOnly() const { return paintBehavior.contains(PaintBehavior::RootBackgroundOnly); } > > const RenderLayer* enclosingSelfPaintingLayer() const { return m_enclosingSelfPaintingLayer; } > >@@ -121,7 +122,7 @@ struct PaintInfo { > > LayoutRect rect; > PaintPhase phase; >- PaintBehavior paintBehavior; >+ OptionSet<PaintBehavior> paintBehavior; > RenderObject* subtreePaintRoot; // used to draw just one element and its visual children > ListHashSet<RenderInline*>* outlineObjects; // used to list outlines that should be painted by a block with inline children > OverlapTestRequestMap* overlapTestRequests; >Index: Source/WebCore/rendering/PaintPhase.h >=================================================================== >--- Source/WebCore/rendering/PaintPhase.h (revision 234514) >+++ Source/WebCore/rendering/PaintPhase.h (working copy) >@@ -36,38 +36,36 @@ namespace WebCore { > * three phases invoked on them during this phase. > */ > >-enum PaintPhase { >- PaintPhaseBlockBackground, >- PaintPhaseChildBlockBackground, >- PaintPhaseChildBlockBackgrounds, >- PaintPhaseFloat, >- PaintPhaseForeground, >- PaintPhaseOutline, >- PaintPhaseChildOutlines, >- PaintPhaseSelfOutline, >- PaintPhaseSelection, >- PaintPhaseCollapsedTableBorders, >- PaintPhaseTextClip, >- PaintPhaseMask, >- PaintPhaseClippingMask >+enum class PaintPhase : uint8_t { >+ BlockBackground, >+ ChildBlockBackground, >+ ChildBlockBackgrounds, >+ Float, >+ Foreground, >+ Outline, >+ ChildOutlines, >+ SelfOutline, >+ Selection, >+ CollapsedTableBorders, >+ TextClip, >+ Mask, >+ ClippingMask > }; > >-enum PaintBehaviorFlags { >- PaintBehaviorNormal = 0, >- PaintBehaviorSelectionOnly = 1 << 0, >- PaintBehaviorSkipSelectionHighlight = 1 << 1, >- PaintBehaviorForceBlackText = 1 << 2, >- PaintBehaviorForceWhiteText = 1 << 3, >- PaintBehaviorRenderingSVGMask = 1 << 4, >- PaintBehaviorSkipRootBackground = 1 << 5, >- PaintBehaviorRootBackgroundOnly = 1 << 6, >- PaintBehaviorSelectionAndBackgroundsOnly = 1 << 7, >- PaintBehaviorExcludeSelection = 1 << 8, >- PaintBehaviorFlattenCompositingLayers = 1 << 9, // Paint doesn't stop at compositing layer boundaries. >- PaintBehaviorSnapshotting = 1 << 10, >- PaintBehaviorTileFirstPaint = 1 << 11, >+enum class PaintBehavior : uint16_t { >+ Normal = 0, >+ SelectionOnly = 1 << 0, >+ SkipSelectionHighlight = 1 << 1, >+ ForceBlackText = 1 << 2, >+ ForceWhiteText = 1 << 3, >+ RenderingSVGMask = 1 << 4, >+ SkipRootBackground = 1 << 5, >+ RootBackgroundOnly = 1 << 6, >+ SelectionAndBackgroundsOnly = 1 << 7, >+ ExcludeSelection = 1 << 8, >+ FlattenCompositingLayers = 1 << 9, // Paint doesn't stop at compositing layer boundaries. >+ Snapshotting = 1 << 10, >+ TileFirstPaint = 1 << 11, > }; > >-typedef unsigned PaintBehavior; >- > } // namespace WebCore >Index: Source/WebCore/rendering/RenderBlock.cpp >=================================================================== >--- Source/WebCore/rendering/RenderBlock.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderBlock.cpp (working copy) >@@ -1108,7 +1108,7 @@ void RenderBlock::paint(PaintInfo& paint > // Our scrollbar widgets paint exactly when we tell them to, so that they work properly with > // z-index. We paint after we painted the background/border, so that the scrollbars will > // sit above the background/border. >- if ((phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBlockBackground) && hasOverflowClip() && layer() >+ if ((phase == PaintPhase::BlockBackground || phase == PaintPhase::ChildBlockBackground) && hasOverflowClip() && layer() > && style().visibility() == Visibility::Visible && paintInfo.shouldPaintWithinRoot(*this) && !paintInfo.paintRootBackgroundOnly()) > layer()->paintOverflowControls(paintInfo.context(), roundedIntPoint(adjustedPaintOffset), snappedIntRect(paintInfo.rect)); > } >@@ -1124,8 +1124,8 @@ void RenderBlock::paintContents(PaintInf > if (childrenInline()) > paintInlineChildren(paintInfo, paintOffset); > else { >- PaintPhase newPhase = (paintInfo.phase == PaintPhaseChildOutlines) ? PaintPhaseOutline : paintInfo.phase; >- newPhase = (newPhase == PaintPhaseChildBlockBackgrounds) ? PaintPhaseChildBlockBackground : newPhase; >+ PaintPhase newPhase = (paintInfo.phase == PaintPhase::ChildOutlines) ? PaintPhase::Outline : paintInfo.phase; >+ newPhase = (newPhase == PaintPhase::ChildBlockBackgrounds) ? PaintPhase::ChildBlockBackground : newPhase; > > // We don't paint our own background, but we do let the kids paint their backgrounds. > PaintInfo paintInfoForChild(paintInfo); >@@ -1219,21 +1219,21 @@ void RenderBlock::paintObject(PaintInfo& > PaintPhase paintPhase = paintInfo.phase; > > // 1. paint background, borders etc >- if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) && style().visibility() == Visibility::Visible) { >+ if ((paintPhase == PaintPhase::BlockBackground || paintPhase == PaintPhase::ChildBlockBackground) && style().visibility() == Visibility::Visible) { > if (hasVisibleBoxDecorations()) > paintBoxDecorations(paintInfo, paintOffset); > } > > // Paint legends just above the border before we scroll or clip. >- if (paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground || paintPhase == PaintPhaseSelection) >+ if (paintPhase == PaintPhase::BlockBackground || paintPhase == PaintPhase::ChildBlockBackground || paintPhase == PaintPhase::Selection) > paintExcludedChildrenInBorder(paintInfo, paintOffset); > >- if (paintPhase == PaintPhaseMask && style().visibility() == Visibility::Visible) { >+ if (paintPhase == PaintPhase::Mask && style().visibility() == Visibility::Visible) { > paintMask(paintInfo, paintOffset); > return; > } > >- if (paintPhase == PaintPhaseClippingMask && style().visibility() == Visibility::Visible) { >+ if (paintPhase == PaintPhase::ClippingMask && style().visibility() == Visibility::Visible) { > paintClippingMask(paintInfo, paintOffset); > return; > } >@@ -1249,15 +1249,15 @@ void RenderBlock::paintObject(PaintInfo& > // Column rules need to account for scrolling and clipping. > // FIXME: Clipping of column rules does not work. We will need a separate paint phase for column rules I suspect in order to get > // clipping correct (since it has to paint as background but is still considered "contents"). >- if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) && style().visibility() == Visibility::Visible) >+ if ((paintPhase == PaintPhase::BlockBackground || paintPhase == PaintPhase::ChildBlockBackground) && style().visibility() == Visibility::Visible) > paintColumnRules(paintInfo, scrolledOffset); > > // Done with backgrounds, borders and column rules. >- if (paintPhase == PaintPhaseBlockBackground) >+ if (paintPhase == PaintPhase::BlockBackground) > return; > > // 2. paint contents >- if (paintPhase != PaintPhaseSelfOutline) >+ if (paintPhase != PaintPhase::SelfOutline) > paintContents(paintInfo, scrolledOffset); > > // 3. paint selection >@@ -1267,15 +1267,15 @@ void RenderBlock::paintObject(PaintInfo& > paintSelection(paintInfo, scrolledOffset); // Fill in gaps in selection on lines and between blocks. > > // 4. paint floats. >- if (paintPhase == PaintPhaseFloat || paintPhase == PaintPhaseSelection || paintPhase == PaintPhaseTextClip) >- paintFloats(paintInfo, scrolledOffset, paintPhase == PaintPhaseSelection || paintPhase == PaintPhaseTextClip); >+ if (paintPhase == PaintPhase::Float || paintPhase == PaintPhase::Selection || paintPhase == PaintPhase::TextClip) >+ paintFloats(paintInfo, scrolledOffset, paintPhase == PaintPhase::Selection || paintPhase == PaintPhase::TextClip); > > // 5. paint outline. >- if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && hasOutline() && style().visibility() == Visibility::Visible) >+ if ((paintPhase == PaintPhase::Outline || paintPhase == PaintPhase::SelfOutline) && hasOutline() && style().visibility() == Visibility::Visible) > paintOutline(paintInfo, LayoutRect(paintOffset, size())); > > // 6. paint continuation outlines. >- if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseChildOutlines)) { >+ if ((paintPhase == PaintPhase::Outline || paintPhase == PaintPhase::ChildOutlines)) { > RenderInline* inlineCont = inlineContinuation(); > if (inlineCont && inlineCont->hasOutline() && inlineCont->style().visibility() == Visibility::Visible) { > RenderInline* inlineRenderer = downcast<RenderInline>(inlineCont->element()->renderer()); >@@ -1301,9 +1301,9 @@ void RenderBlock::paintObject(PaintInfo& > } > > // 7. paint caret. >- // If the caret's node's render object's containing block is this block, and the paint action is PaintPhaseForeground, >+ // If the caret's node's render object's containing block is this block, and the paint action is PaintPhase::Foreground, > // then paint the caret. >- if (paintPhase == PaintPhaseForeground) { >+ if (paintPhase == PaintPhase::Foreground) { > paintCaret(paintInfo, paintOffset, CursorCaret); > paintCaret(paintInfo, paintOffset, DragCaret); > } >@@ -1423,7 +1423,7 @@ GapRects RenderBlock::selectionGapRectsF > void RenderBlock::paintSelection(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { > #if ENABLE(TEXT_SELECTION) >- if (shouldPaintSelectionGaps() && paintInfo.phase == PaintPhaseForeground) { >+ if (shouldPaintSelectionGaps() && paintInfo.phase == PaintPhase::Foreground) { > LogicalSelectionOffsetCaches cache(*this); > LayoutUnit lastTop = 0; > LayoutUnit lastLeft = logicalLeftSelectionOffset(*this, lastTop, cache); >Index: Source/WebCore/rendering/RenderBlockFlow.cpp >=================================================================== >--- Source/WebCore/rendering/RenderBlockFlow.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderBlockFlow.cpp (working copy) >@@ -2174,17 +2174,17 @@ void RenderBlockFlow::paintFloats(PaintI > // Only paint the object if our m_shouldPaint flag is set. > if (floatingObject.shouldPaint() && !renderer.hasSelfPaintingLayer()) { > PaintInfo currentPaintInfo(paintInfo); >- currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground; >+ currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhase::BlockBackground; > LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObject, paintOffset + floatingObject.translationOffsetToAncestor()); > renderer.paint(currentPaintInfo, childPoint); > if (!preservePhase) { >- currentPaintInfo.phase = PaintPhaseChildBlockBackgrounds; >+ currentPaintInfo.phase = PaintPhase::ChildBlockBackgrounds; > renderer.paint(currentPaintInfo, childPoint); >- currentPaintInfo.phase = PaintPhaseFloat; >+ currentPaintInfo.phase = PaintPhase::Float; > renderer.paint(currentPaintInfo, childPoint); >- currentPaintInfo.phase = PaintPhaseForeground; >+ currentPaintInfo.phase = PaintPhase::Foreground; > renderer.paint(currentPaintInfo, childPoint); >- currentPaintInfo.phase = PaintPhaseOutline; >+ currentPaintInfo.phase = PaintPhase::Outline; > renderer.paint(currentPaintInfo, childPoint); > } > } >Index: Source/WebCore/rendering/RenderBox.cpp >=================================================================== >--- Source/WebCore/rendering/RenderBox.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderBox.cpp (working copy) >@@ -1500,7 +1500,7 @@ bool RenderBox::backgroundHasOpaqueTopLa > > void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { >- if (!paintInfo.shouldPaintWithinRoot(*this) || style().visibility() != Visibility::Visible || paintInfo.phase != PaintPhaseMask || paintInfo.context().paintingDisabled()) >+ if (!paintInfo.shouldPaintWithinRoot(*this) || style().visibility() != Visibility::Visible || paintInfo.phase != PaintPhase::Mask || paintInfo.context().paintingDisabled()) > return; > > LayoutRect paintRect = LayoutRect(paintOffset, size()); >@@ -1510,7 +1510,7 @@ void RenderBox::paintMask(PaintInfo& pai > > void RenderBox::paintClippingMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { >- if (!paintInfo.shouldPaintWithinRoot(*this) || style().visibility() != Visibility::Visible || paintInfo.phase != PaintPhaseClippingMask || paintInfo.context().paintingDisabled()) >+ if (!paintInfo.shouldPaintWithinRoot(*this) || style().visibility() != Visibility::Visible || paintInfo.phase != PaintPhase::ClippingMask || paintInfo.context().paintingDisabled()) > return; > > LayoutRect paintRect = LayoutRect(paintOffset, size()); >@@ -1522,7 +1522,7 @@ void RenderBox::paintMaskImages(const Pa > // Figure out if we need to push a transparency layer to render our mask. > bool pushTransparencyLayer = false; > bool compositedMask = hasLayer() && layer()->hasCompositedMask(); >- bool flattenCompositingLayers = paintInfo.paintBehavior & PaintBehaviorFlattenCompositingLayers; >+ bool flattenCompositingLayers = paintInfo.paintBehavior.contains(PaintBehavior::FlattenCompositingLayers); > CompositeOperator compositeOp = CompositeSourceOver; > > bool allMaskImagesLoaded = true; >@@ -1722,21 +1722,21 @@ bool RenderBox::repaintLayerRectsForImag > > bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumulatedOffset) > { >- if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == PaintPhaseSelfOutline || paintInfo.phase == PaintPhaseMask) >+ if (paintInfo.phase == PaintPhase::BlockBackground || paintInfo.phase == PaintPhase::SelfOutline || paintInfo.phase == PaintPhase::Mask) > return false; >- >+ > bool isControlClip = hasControlClip(); > bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer(); > > if (!isControlClip && !isOverflowClip) > return false; > >- if (paintInfo.phase == PaintPhaseOutline) >- paintInfo.phase = PaintPhaseChildOutlines; >- else if (paintInfo.phase == PaintPhaseChildBlockBackground) { >- paintInfo.phase = PaintPhaseBlockBackground; >+ if (paintInfo.phase == PaintPhase::Outline) >+ paintInfo.phase = PaintPhase::ChildOutlines; >+ else if (paintInfo.phase == PaintPhase::ChildBlockBackground) { >+ paintInfo.phase = PaintPhase::BlockBackground; > paintObject(paintInfo, accumulatedOffset); >- paintInfo.phase = PaintPhaseChildBlockBackgrounds; >+ paintInfo.phase = PaintPhase::ChildBlockBackgrounds; > } > float deviceScaleFactor = document().deviceScaleFactor(); > FloatRect clipRect = snapRectToDevicePixels((isControlClip ? controlClipRect(accumulatedOffset) : overflowClipRect(accumulatedOffset, nullptr, IgnoreOverlayScrollbarSize, paintInfo.phase)), deviceScaleFactor); >@@ -1752,11 +1752,11 @@ void RenderBox::popContentsClip(PaintInf > ASSERT(hasControlClip() || (hasOverflowClip() && !layer()->isSelfPaintingLayer())); > > paintInfo.context().restore(); >- if (originalPhase == PaintPhaseOutline) { >- paintInfo.phase = PaintPhaseSelfOutline; >+ if (originalPhase == PaintPhase::Outline) { >+ paintInfo.phase = PaintPhase::SelfOutline; > paintObject(paintInfo, accumulatedOffset); > paintInfo.phase = originalPhase; >- } else if (originalPhase == PaintPhaseChildBlockBackground) >+ } else if (originalPhase == PaintPhase::ChildBlockBackground) > paintInfo.phase = originalPhase; > } > >Index: Source/WebCore/rendering/RenderBox.h >=================================================================== >--- Source/WebCore/rendering/RenderBox.h (revision 234514) >+++ Source/WebCore/rendering/RenderBox.h (working copy) >@@ -480,7 +480,7 @@ public: > > LayoutRect localCaretRect(InlineBox*, unsigned caretOffset, LayoutUnit* extraWidthToEndOfLine = nullptr) override; > >- virtual LayoutRect overflowClipRect(const LayoutPoint& location, RenderFragmentContainer* = nullptr, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize, PaintPhase = PaintPhaseBlockBackground); >+ virtual LayoutRect overflowClipRect(const LayoutPoint& location, RenderFragmentContainer* = nullptr, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize, PaintPhase = PaintPhase::BlockBackground); > virtual LayoutRect overflowClipRectForChildLayers(const LayoutPoint& location, RenderFragmentContainer* fragment, OverlayScrollbarSizeRelevancy relevancy) { return overflowClipRect(location, fragment, relevancy); } > LayoutRect clipRect(const LayoutPoint& location, RenderFragmentContainer*); > virtual bool hasControlClip() const { return false; } >Index: Source/WebCore/rendering/RenderBoxModelObject.cpp >=================================================================== >--- Source/WebCore/rendering/RenderBoxModelObject.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderBoxModelObject.cpp (working copy) >@@ -374,13 +374,13 @@ DecodingMode RenderBoxModelObject::decod > return DecodingMode::Asynchronous; > if (document().isImageDocument()) > return DecodingMode::Synchronous; >- if (paintInfo.paintBehavior & PaintBehaviorSnapshotting) >+ if (paintInfo.paintBehavior.contains(PaintBehavior::Snapshotting)) > return DecodingMode::Synchronous; > if (!settings().largeImageAsyncDecodingEnabled()) > return DecodingMode::Synchronous; > if (!bitmapImage.canUseAsyncDecodingForLargeImages()) > return DecodingMode::Synchronous; >- if (paintInfo.paintBehavior & PaintBehaviorTileFirstPaint) >+ if (paintInfo.paintBehavior.contains(PaintBehavior::TileFirstPaint)) > return DecodingMode::Asynchronous; > // FIXME: isVisibleInViewport() is not cheap. Find a way to make this condition faster. > if (!isVisibleInViewport()) >@@ -728,7 +728,7 @@ void RenderBoxModelObject::paintMaskForT > > // Now add the text to the clip. We do this by painting using a special paint phase that signals to > // InlineTextBoxes that they should just add their contents to the clip. >- PaintInfo info(maskImageContext, maskRect, PaintPhaseTextClip, PaintBehaviorForceBlackText); >+ PaintInfo info(maskImageContext, maskRect, PaintPhase::TextClip, PaintBehavior::ForceBlackText); > if (box) { > const RootInlineBox& rootBox = box->root(); > box->paint(info, LayoutPoint(scrolledPaintRect.x() - box->x(), scrolledPaintRect.y() - box->y()), rootBox.lineTop(), rootBox.lineBottom()); >@@ -1172,7 +1172,7 @@ bool RenderBoxModelObject::fixedBackgrou > if (!isDocumentElementRenderer()) > return false; > >- if (view().frameView().paintBehavior() & PaintBehaviorFlattenCompositingLayers) >+ if (view().frameView().paintBehavior().contains(PaintBehavior::FlattenCompositingLayers)) > return false; > > RenderLayer* rootLayer = view().layer(); >Index: Source/WebCore/rendering/RenderDetailsMarker.cpp >=================================================================== >--- Source/WebCore/rendering/RenderDetailsMarker.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderDetailsMarker.cpp (working copy) >@@ -118,7 +118,7 @@ Path RenderDetailsMarker::getPath(const > > void RenderDetailsMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { >- if (paintInfo.phase != PaintPhaseForeground || style().visibility() != Visibility::Visible) { >+ if (paintInfo.phase != PaintPhase::Foreground || style().visibility() != Visibility::Visible) { > RenderBlockFlow::paint(paintInfo, paintOffset); > return; > } >Index: Source/WebCore/rendering/RenderElement.cpp >=================================================================== >--- Source/WebCore/rendering/RenderElement.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderElement.cpp (working copy) >@@ -989,15 +989,15 @@ void RenderElement::paintAsInlineBlock(P > // Paint all phases atomically, as though the element established its own stacking context. > // (See Appendix E.2, section 6.4 on inline block/table/replaced elements in the CSS2.1 specification.) > // This is also used by other elements (e.g. flex items and grid items). >- PaintPhase paintPhaseToUse = isExcludedAndPlacedInBorder() ? paintInfo.phase : PaintPhaseForeground; >- if (paintInfo.phase == PaintPhaseSelection) >+ PaintPhase paintPhaseToUse = isExcludedAndPlacedInBorder() ? paintInfo.phase : PaintPhase::Foreground; >+ if (paintInfo.phase == PaintPhase::Selection) > paint(paintInfo, childPoint); > else if (paintInfo.phase == paintPhaseToUse) { >- paintPhase(*this, PaintPhaseBlockBackground, paintInfo, childPoint); >- paintPhase(*this, PaintPhaseChildBlockBackgrounds, paintInfo, childPoint); >- paintPhase(*this, PaintPhaseFloat, paintInfo, childPoint); >- paintPhase(*this, PaintPhaseForeground, paintInfo, childPoint); >- paintPhase(*this, PaintPhaseOutline, paintInfo, childPoint); >+ paintPhase(*this, PaintPhase::BlockBackground, paintInfo, childPoint); >+ paintPhase(*this, PaintPhase::ChildBlockBackgrounds, paintInfo, childPoint); >+ paintPhase(*this, PaintPhase::Float, paintInfo, childPoint); >+ paintPhase(*this, PaintPhase::Foreground, paintInfo, childPoint); >+ paintPhase(*this, PaintPhase::Outline, paintInfo, childPoint); > > // Reset |paintInfo| to the original phase. > paintInfo.phase = paintPhaseToUse; >@@ -1361,7 +1361,7 @@ Color RenderElement::selectionColor(CSSP > // If the element is unselectable, or we are only painting the selection, > // don't override the foreground color with the selection foreground color. > if (style().userSelect() == UserSelect::None >- || (view().frameView().paintBehavior() & (PaintBehaviorSelectionOnly | PaintBehaviorSelectionAndBackgroundsOnly))) >+ || (view().frameView().paintBehavior().contains(OptionSet<PaintBehavior>(PaintBehavior::SelectionOnly) | PaintBehavior::SelectionAndBackgroundsOnly))) > return Color(); > > if (std::unique_ptr<RenderStyle> pseudoStyle = selectionPseudoStyle()) { >Index: Source/WebCore/rendering/RenderEmbeddedObject.cpp >=================================================================== >--- Source/WebCore/rendering/RenderEmbeddedObject.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderEmbeddedObject.cpp (working copy) >@@ -249,7 +249,7 @@ void RenderEmbeddedObject::paintContents > void RenderEmbeddedObject::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { > // The relevant repainted object heuristic is not tuned for plugin documents. >- bool countsTowardsRelevantObjects = !document().isPluginDocument() && paintInfo.phase == PaintPhaseForeground; >+ bool countsTowardsRelevantObjects = !document().isPluginDocument() && paintInfo.phase == PaintPhase::Foreground; > > if (isPluginUnavailable()) { > if (countsTowardsRelevantObjects) >@@ -292,7 +292,7 @@ void RenderEmbeddedObject::paintReplaced > if (!showsUnavailablePluginIndicator()) > return; > >- if (paintInfo.phase == PaintPhaseSelection) >+ if (paintInfo.phase == PaintPhase::Selection) > return; > > GraphicsContext& context = paintInfo.context(); >Index: Source/WebCore/rendering/RenderFileUploadControl.cpp >=================================================================== >--- Source/WebCore/rendering/RenderFileUploadControl.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderFileUploadControl.cpp (working copy) >@@ -119,7 +119,7 @@ void RenderFileUploadControl::paintObjec > > // Push a clip. > GraphicsContextStateSaver stateSaver(paintInfo.context(), false); >- if (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseChildBlockBackgrounds) { >+ if (paintInfo.phase == PaintPhase::Foreground || paintInfo.phase == PaintPhase::ChildBlockBackgrounds) { > IntRect clipRect = enclosingIntRect(LayoutRect(paintOffset.x() + borderLeft(), paintOffset.y() + borderTop(), > width() - borderLeft() - borderRight(), height() - borderBottom() - borderTop() + buttonShadowHeight)); > if (clipRect.isEmpty()) >@@ -128,7 +128,7 @@ void RenderFileUploadControl::paintObjec > paintInfo.context().clip(clipRect); > } > >- if (paintInfo.phase == PaintPhaseForeground) { >+ if (paintInfo.phase == PaintPhase::Foreground) { > const String& displayedFilename = fileTextValue(); > const FontCascade& font = style().fontCascade(); > TextRun textRun = constructTextRun(displayedFilename, style(), AllowTrailingExpansion, RespectDirection | RespectDirectionOverride); >Index: Source/WebCore/rendering/RenderFrameSet.cpp >=================================================================== >--- Source/WebCore/rendering/RenderFrameSet.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderFrameSet.cpp (working copy) >@@ -126,7 +126,7 @@ void RenderFrameSet::paintRowBorder(cons > > void RenderFrameSet::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { >- if (paintInfo.phase != PaintPhaseForeground) >+ if (paintInfo.phase != PaintPhase::Foreground) > return; > > RenderObject* child = firstChild(); >Index: Source/WebCore/rendering/RenderHTMLCanvas.cpp >=================================================================== >--- Source/WebCore/rendering/RenderHTMLCanvas.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderHTMLCanvas.cpp (working copy) >@@ -83,7 +83,7 @@ void RenderHTMLCanvas::paintReplaced(Pai > if (clip) > paintInfo.context().clip(snappedIntRect(contentBoxRect)); > >- if (paintInfo.phase == PaintPhaseForeground) >+ if (paintInfo.phase == PaintPhase::Foreground) > page().addRelevantRepaintedObject(this, intersection(replacedContentRect, contentBoxRect)); > > InterpolationQualityMaintainer interpolationMaintainer(context, ImageQualityController::interpolationQualityFromStyle(style())); >Index: Source/WebCore/rendering/RenderImage.cpp >=================================================================== >--- Source/WebCore/rendering/RenderImage.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderImage.cpp (working copy) >@@ -412,10 +412,10 @@ void RenderImage::paintReplaced(PaintInf > LayoutUnit missingImageBorderWidth(1 / deviceScaleFactor); > > if (!imageResource().cachedImage() || imageResource().errorOccurred()) { >- if (paintInfo.phase == PaintPhaseSelection) >+ if (paintInfo.phase == PaintPhase::Selection) > return; > >- if (paintInfo.phase == PaintPhaseForeground) >+ if (paintInfo.phase == PaintPhase::Foreground) > page().addRelevantUnpaintedObject(this, visualOverflowRect()); > > paintIncompleteImageOutline(paintInfo, paintOffset, missingImageBorderWidth); >@@ -490,7 +490,7 @@ void RenderImage::paintReplaced(PaintInf > if (showBorderForIncompleteImage) > paintIncompleteImageOutline(paintInfo, paintOffset, missingImageBorderWidth); > >- if (paintInfo.phase == PaintPhaseForeground) >+ if (paintInfo.phase == PaintPhase::Foreground) > page().addRelevantUnpaintedObject(this, visualOverflowRect()); > return; > } >@@ -509,7 +509,7 @@ void RenderImage::paintReplaced(PaintInf > if (showBorderForIncompleteImage && (result != ImageDrawResult::DidDraw || (cachedImage() && cachedImage()->isLoading()))) > paintIncompleteImageOutline(paintInfo, paintOffset, missingImageBorderWidth); > >- if (cachedImage() && paintInfo.phase == PaintPhaseForeground) { >+ if (cachedImage() && paintInfo.phase == PaintPhase::Foreground) { > // For now, count images as unpainted if they are still progressively loading. We may want > // to refine this in the future to account for the portion of the image that has painted. > LayoutRect visibleRect = intersection(replacedContentRect, contentBoxRect); >@@ -524,7 +524,7 @@ void RenderImage::paint(PaintInfo& paint > { > RenderReplaced::paint(paintInfo, paintOffset); > >- if (paintInfo.phase == PaintPhaseOutline) >+ if (paintInfo.phase == PaintPhase::Outline) > paintAreaElementFocusRing(paintInfo, paintOffset); > } > >Index: Source/WebCore/rendering/RenderLayer.cpp >=================================================================== >--- Source/WebCore/rendering/RenderLayer.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderLayer.cpp (working copy) >@@ -1038,12 +1038,12 @@ TransformationMatrix RenderLayer::curren > return *m_transform; > } > >-TransformationMatrix RenderLayer::renderableTransform(PaintBehavior paintBehavior) const >+TransformationMatrix RenderLayer::renderableTransform(OptionSet<PaintBehavior> paintBehavior) const > { > if (!m_transform) > return TransformationMatrix(); > >- if (paintBehavior & PaintBehaviorFlattenCompositingLayers) { >+ if (paintBehavior & PaintBehavior::FlattenCompositingLayers) { > TransformationMatrix matrix = *m_transform; > makeMatrixRenderable(matrix, false /* flatten 3d */); > return matrix; >@@ -1721,10 +1721,10 @@ enum TransparencyClipBoxMode { > RootOfTransparencyClipBox > }; > >-static LayoutRect transparencyClipBox(const RenderLayer&, const RenderLayer* rootLayer, TransparencyClipBoxBehavior, TransparencyClipBoxMode, PaintBehavior = 0); >+static LayoutRect transparencyClipBox(const RenderLayer&, const RenderLayer* rootLayer, TransparencyClipBoxBehavior, TransparencyClipBoxMode, OptionSet<PaintBehavior> = { }); > > static void expandClipRectForDescendantsAndReflection(LayoutRect& clipRect, const RenderLayer& layer, const RenderLayer* rootLayer, >- TransparencyClipBoxBehavior transparencyBehavior, PaintBehavior paintBehavior) >+ TransparencyClipBoxBehavior transparencyBehavior, OptionSet<PaintBehavior> paintBehavior) > { > // If we have a mask, then the clip is limited to the border box area (and there is > // no need to examine child layers). >@@ -1750,7 +1750,7 @@ static void expandClipRectForDescendants > } > > static LayoutRect transparencyClipBox(const RenderLayer& layer, const RenderLayer* rootLayer, TransparencyClipBoxBehavior transparencyBehavior, >- TransparencyClipBoxMode transparencyMode, PaintBehavior paintBehavior) >+ TransparencyClipBoxMode transparencyMode, OptionSet<PaintBehavior> paintBehavior) > { > // FIXME: Although this function completely ignores CSS-imposed clipping, we did already intersect with the > // paintDirtyRect, and that should cut down on the amount we have to paint. Still it >@@ -1794,7 +1794,7 @@ static LayoutRect transparencyClipBox(co > return clipRect; > } > >-static LayoutRect paintingExtent(const RenderLayer& currentLayer, const RenderLayer* rootLayer, const LayoutRect& paintDirtyRect, PaintBehavior paintBehavior) >+static LayoutRect paintingExtent(const RenderLayer& currentLayer, const RenderLayer* rootLayer, const LayoutRect& paintDirtyRect, OptionSet<PaintBehavior> paintBehavior) > { > return intersection(transparencyClipBox(currentLayer, rootLayer, PaintingTransparencyClipBox, RootOfTransparencyClipBox, paintBehavior), paintDirtyRect); > } >@@ -3862,7 +3862,7 @@ bool RenderLayer::scroll(ScrollDirection > return ScrollableArea::scroll(direction, granularity, multiplier); > } > >-void RenderLayer::paint(GraphicsContext& context, const LayoutRect& damageRect, const LayoutSize& subpixelOffset, PaintBehavior paintBehavior, RenderObject* subtreePaintRoot, PaintLayerFlags paintFlags, SecurityOriginPaintPolicy paintPolicy) >+void RenderLayer::paint(GraphicsContext& context, const LayoutRect& damageRect, const LayoutSize& subpixelOffset, OptionSet<PaintBehavior> paintBehavior, RenderObject* subtreePaintRoot, PaintLayerFlags paintFlags, SecurityOriginPaintPolicy paintPolicy) > { > OverlapTestRequestMap overlapTestRequests; > >@@ -3873,7 +3873,7 @@ void RenderLayer::paint(GraphicsContext& > widget->setOverlapTestResult(false); > } > >-void RenderLayer::paintOverlayScrollbars(GraphicsContext& context, const LayoutRect& damageRect, PaintBehavior paintBehavior, RenderObject* subtreePaintRoot) >+void RenderLayer::paintOverlayScrollbars(GraphicsContext& context, const LayoutRect& damageRect, OptionSet<PaintBehavior> paintBehavior, RenderObject* subtreePaintRoot) > { > if (!m_containsDirtyOverlayScrollbars) > return; >@@ -3979,7 +3979,7 @@ void RenderLayer::paintLayer(GraphicsCon > if (isComposited()) { > // The performingPaintInvalidation() painting pass goes through compositing layers, > // but we need to ensure that we don't cache clip rects computed with the wrong root in this case. >- if (context.performingPaintInvalidation() || (paintingInfo.paintBehavior & PaintBehaviorFlattenCompositingLayers)) >+ if (context.performingPaintInvalidation() || (paintingInfo.paintBehavior & PaintBehavior::FlattenCompositingLayers)) > paintFlags |= PaintLayerTemporaryClipRects; > else if (!backing()->paintsIntoWindow() > && !backing()->paintsIntoCompositedAncestor() >@@ -4331,8 +4331,8 @@ void RenderLayer::paintLayerContents(Gra > if (shouldApplyClipPath(paintingInfo.paintBehavior, localPaintFlags)) > hasClipPath = setupClipPath(context, paintingInfo, columnAwareOffsetFromRoot, rootRelativeBounds, rootRelativeBoundsComputed); > >- bool selectionAndBackgroundsOnly = paintingInfo.paintBehavior & PaintBehaviorSelectionAndBackgroundsOnly; >- bool selectionOnly = paintingInfo.paintBehavior & PaintBehaviorSelectionOnly; >+ bool selectionAndBackgroundsOnly = paintingInfo.paintBehavior.contains(PaintBehavior::SelectionAndBackgroundsOnly); >+ bool selectionOnly = paintingInfo.paintBehavior.contains(PaintBehavior::SelectionOnly); > > SinglePaintFrequencyTracking singlePaintFrequencyTracking(m_paintFrequencyTracker, shouldPaintContent); > >@@ -4360,23 +4360,23 @@ void RenderLayer::paintLayerContents(Gra > if (localPaintingInfo.overlapTestRequests && isSelfPaintingLayer) > performOverlapTests(*localPaintingInfo.overlapTestRequests, localPaintingInfo.rootLayer, this); > >- PaintBehavior paintBehavior = PaintBehaviorNormal; >+ OptionSet<PaintBehavior> paintBehavior = PaintBehavior::Normal; > if (localPaintFlags & PaintLayerPaintingSkipRootBackground) >- paintBehavior |= PaintBehaviorSkipRootBackground; >+ paintBehavior |= PaintBehavior::SkipRootBackground; > else if (localPaintFlags & PaintLayerPaintingRootBackgroundOnly) >- paintBehavior |= PaintBehaviorRootBackgroundOnly; >+ paintBehavior |= PaintBehavior::RootBackgroundOnly; > >- if (paintingInfo.paintBehavior & PaintBehaviorFlattenCompositingLayers) >- paintBehavior |= PaintBehaviorFlattenCompositingLayers; >+ if (paintingInfo.paintBehavior & PaintBehavior::FlattenCompositingLayers) >+ paintBehavior |= PaintBehavior::FlattenCompositingLayers; > >- if (paintingInfo.paintBehavior & PaintBehaviorSnapshotting) >- paintBehavior |= PaintBehaviorSnapshotting; >+ if (paintingInfo.paintBehavior & PaintBehavior::Snapshotting) >+ paintBehavior |= PaintBehavior::Snapshotting; > >- if ((paintingInfo.paintBehavior & PaintBehaviorTileFirstPaint) && isRenderViewLayer()) >- paintBehavior |= PaintBehaviorTileFirstPaint; >+ if ((paintingInfo.paintBehavior & PaintBehavior::TileFirstPaint) && isRenderViewLayer()) >+ paintBehavior |= PaintBehavior::TileFirstPaint; > >- if (paintingInfo.paintBehavior & PaintBehaviorExcludeSelection) >- paintBehavior |= PaintBehaviorExcludeSelection; >+ if (paintingInfo.paintBehavior & PaintBehavior::ExcludeSelection) >+ paintBehavior |= PaintBehavior::ExcludeSelection; > > LayoutRect paintDirtyRect = localPaintingInfo.paintDirtyRect; > if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars) { >@@ -4443,15 +4443,15 @@ void RenderLayer::paintLayerContents(Gra > } > > if (shouldPaintContent && !(selectionOnly || selectionAndBackgroundsOnly)) { >- PaintBehavior paintBehavior = PaintBehaviorNormal; >- if (paintingInfo.paintBehavior & PaintBehaviorFlattenCompositingLayers) >- paintBehavior |= PaintBehaviorFlattenCompositingLayers; >+ OptionSet<PaintBehavior> paintBehavior = PaintBehavior::Normal; >+ if (paintingInfo.paintBehavior & PaintBehavior::FlattenCompositingLayers) >+ paintBehavior |= PaintBehavior::FlattenCompositingLayers; > >- if (paintingInfo.paintBehavior & PaintBehaviorSnapshotting) >- paintBehavior |= PaintBehaviorSnapshotting; >+ if (paintingInfo.paintBehavior & PaintBehavior::Snapshotting) >+ paintBehavior |= PaintBehavior::Snapshotting; > >- if (paintingInfo.paintBehavior & PaintBehaviorTileFirstPaint) >- paintBehavior |= PaintBehaviorTileFirstPaint; >+ if (paintingInfo.paintBehavior & PaintBehavior::TileFirstPaint) >+ paintBehavior |= PaintBehavior::TileFirstPaint; > > if (shouldPaintMask(paintingInfo.paintBehavior, localPaintFlags)) { > // Paint the mask for the fragments. >@@ -4727,7 +4727,7 @@ void RenderLayer::paintTransformedLayerI > } > > void RenderLayer::paintBackgroundForFragments(const LayerFragments& layerFragments, GraphicsContext& context, GraphicsContext& contextForTransparencyLayer, >- const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const LayerPaintingInfo& localPaintingInfo, PaintBehavior paintBehavior, >+ const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const LayerPaintingInfo& localPaintingInfo, OptionSet<PaintBehavior> paintBehavior, > RenderObject* subtreePaintRootForRenderer) > { > for (const auto& fragment : layerFragments) { >@@ -4746,7 +4746,7 @@ void RenderLayer::paintBackgroundForFrag > > // Paint the background. > // FIXME: Eventually we will collect the region from the fragment itself instead of just from the paint info. >- PaintInfo paintInfo(context, fragment.backgroundRect.rect(), PaintPhaseBlockBackground, paintBehavior, subtreePaintRootForRenderer, nullptr, nullptr, &localPaintingInfo.rootLayer->renderer(), this); >+ PaintInfo paintInfo(context, fragment.backgroundRect.rect(), PaintPhase::BlockBackground, paintBehavior, subtreePaintRootForRenderer, nullptr, nullptr, &localPaintingInfo.rootLayer->renderer(), this); > renderer().paint(paintInfo, toLayoutPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subpixelOffset)); > > if (localPaintingInfo.clipToDirtyRect) >@@ -4755,7 +4755,7 @@ void RenderLayer::paintBackgroundForFrag > } > > void RenderLayer::paintForegroundForFragments(const LayerFragments& layerFragments, GraphicsContext& context, GraphicsContext& contextForTransparencyLayer, >- const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const LayerPaintingInfo& localPaintingInfo, PaintBehavior paintBehavior, >+ const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const LayerPaintingInfo& localPaintingInfo, OptionSet<PaintBehavior> paintBehavior, > RenderObject* subtreePaintRootForRenderer) > { > // Begin transparency if we have something to paint. >@@ -4768,22 +4768,22 @@ void RenderLayer::paintForegroundForFrag > } > } > >- PaintBehavior localPaintBehavior; >- if (localPaintingInfo.paintBehavior & PaintBehaviorForceBlackText) >- localPaintBehavior = PaintBehaviorForceBlackText; >- else if (localPaintingInfo.paintBehavior & PaintBehaviorForceWhiteText) >- localPaintBehavior = PaintBehaviorForceWhiteText; >+ OptionSet<PaintBehavior> localPaintBehavior; >+ if (localPaintingInfo.paintBehavior & PaintBehavior::ForceBlackText) >+ localPaintBehavior = PaintBehavior::ForceBlackText; >+ else if (localPaintingInfo.paintBehavior & PaintBehavior::ForceWhiteText) >+ localPaintBehavior = PaintBehavior::ForceWhiteText; > else > localPaintBehavior = paintBehavior; > >- if (localPaintingInfo.paintBehavior & PaintBehaviorExcludeSelection) >- localPaintBehavior |= PaintBehaviorExcludeSelection; >+ if (localPaintingInfo.paintBehavior & PaintBehavior::ExcludeSelection) >+ localPaintBehavior |= PaintBehavior::ExcludeSelection; > >- if (localPaintingInfo.paintBehavior & PaintBehaviorSnapshotting) >- localPaintBehavior |= PaintBehaviorSnapshotting; >+ if (localPaintingInfo.paintBehavior & PaintBehavior::Snapshotting) >+ localPaintBehavior |= PaintBehavior::Snapshotting; > >- if (localPaintingInfo.paintBehavior & PaintBehaviorTileFirstPaint) >- localPaintBehavior |= PaintBehaviorTileFirstPaint; >+ if (localPaintingInfo.paintBehavior & PaintBehavior::TileFirstPaint) >+ localPaintBehavior |= PaintBehavior::TileFirstPaint; > > // Optimize clipping for the single fragment case. > bool shouldClip = localPaintingInfo.clipToDirtyRect && layerFragments.size() == 1 && layerFragments[0].shouldPaintContent && !layerFragments[0].foregroundRect.isEmpty(); >@@ -4795,14 +4795,14 @@ void RenderLayer::paintForegroundForFrag > > // We have to loop through every fragment multiple times, since we have to repaint in each specific phase in order for > // interleaving of the fragments to work properly. >- bool selectionOnly = localPaintingInfo.paintBehavior & (PaintBehaviorSelectionAndBackgroundsOnly | PaintBehaviorSelectionOnly); >- paintForegroundForFragmentsWithPhase(selectionOnly ? PaintPhaseSelection : PaintPhaseChildBlockBackgrounds, layerFragments, >+ bool selectionOnly = localPaintingInfo.paintBehavior.contains(OptionSet<PaintBehavior>(PaintBehavior::SelectionAndBackgroundsOnly) | PaintBehavior::SelectionOnly); >+ paintForegroundForFragmentsWithPhase(selectionOnly ? PaintPhase::Selection : PaintPhase::ChildBlockBackgrounds, layerFragments, > context, localPaintingInfo, localPaintBehavior, subtreePaintRootForRenderer); > > if (!selectionOnly) { >- paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments, context, localPaintingInfo, localPaintBehavior, subtreePaintRootForRenderer); >- paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragments, context, localPaintingInfo, localPaintBehavior, subtreePaintRootForRenderer); >- paintForegroundForFragmentsWithPhase(PaintPhaseChildOutlines, layerFragments, context, localPaintingInfo, localPaintBehavior, subtreePaintRootForRenderer); >+ paintForegroundForFragmentsWithPhase(PaintPhase::Float, layerFragments, context, localPaintingInfo, localPaintBehavior, subtreePaintRootForRenderer); >+ paintForegroundForFragmentsWithPhase(PaintPhase::Foreground, layerFragments, context, localPaintingInfo, localPaintBehavior, subtreePaintRootForRenderer); >+ paintForegroundForFragmentsWithPhase(PaintPhase::ChildOutlines, layerFragments, context, localPaintingInfo, localPaintBehavior, subtreePaintRootForRenderer); > } > > if (shouldClip) >@@ -4810,7 +4810,7 @@ void RenderLayer::paintForegroundForFrag > } > > void RenderLayer::paintForegroundForFragmentsWithPhase(PaintPhase phase, const LayerFragments& layerFragments, GraphicsContext& context, >- const LayerPaintingInfo& localPaintingInfo, PaintBehavior paintBehavior, RenderObject* subtreePaintRootForRenderer) >+ const LayerPaintingInfo& localPaintingInfo, OptionSet<PaintBehavior> paintBehavior, RenderObject* subtreePaintRootForRenderer) > { > bool shouldClip = localPaintingInfo.clipToDirtyRect && layerFragments.size() > 1; > >@@ -4822,7 +4822,7 @@ void RenderLayer::paintForegroundForFrag > clipToRect(context, localPaintingInfo, fragment.foregroundRect); > > PaintInfo paintInfo(context, fragment.foregroundRect.rect(), phase, paintBehavior, subtreePaintRootForRenderer, nullptr, nullptr, &localPaintingInfo.rootLayer->renderer(), this, localPaintingInfo.requireSecurityOriginAccessForWidgets); >- if (phase == PaintPhaseForeground) >+ if (phase == PaintPhase::Foreground) > paintInfo.overlapTestRequests = localPaintingInfo.overlapTestRequests; > renderer().paint(paintInfo, toLayoutPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subpixelOffset)); > >@@ -4832,14 +4832,14 @@ void RenderLayer::paintForegroundForFrag > } > > void RenderLayer::paintOutlineForFragments(const LayerFragments& layerFragments, GraphicsContext& context, const LayerPaintingInfo& localPaintingInfo, >- PaintBehavior paintBehavior, RenderObject* subtreePaintRootForRenderer) >+ OptionSet<PaintBehavior> paintBehavior, RenderObject* subtreePaintRootForRenderer) > { > for (const auto& fragment : layerFragments) { > if (fragment.backgroundRect.isEmpty()) > continue; > > // Paint our own outline >- PaintInfo paintInfo(context, fragment.backgroundRect.rect(), PaintPhaseSelfOutline, paintBehavior, subtreePaintRootForRenderer, nullptr, nullptr, &localPaintingInfo.rootLayer->renderer(), this); >+ PaintInfo paintInfo(context, fragment.backgroundRect.rect(), PaintPhase::SelfOutline, paintBehavior, subtreePaintRootForRenderer, nullptr, nullptr, &localPaintingInfo.rootLayer->renderer(), this); > clipToRect(context, localPaintingInfo, fragment.backgroundRect, DoNotIncludeSelfForBorderRadius); > renderer().paint(paintInfo, toLayoutPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subpixelOffset)); > restoreClip(context, localPaintingInfo, fragment.backgroundRect); >@@ -4847,7 +4847,7 @@ void RenderLayer::paintOutlineForFragmen > } > > void RenderLayer::paintMaskForFragments(const LayerFragments& layerFragments, GraphicsContext& context, const LayerPaintingInfo& localPaintingInfo, >- PaintBehavior paintBehavior, RenderObject* subtreePaintRootForRenderer) >+ OptionSet<PaintBehavior> paintBehavior, RenderObject* subtreePaintRootForRenderer) > { > for (const auto& fragment : layerFragments) { > if (!fragment.shouldPaintContent) >@@ -4858,7 +4858,7 @@ void RenderLayer::paintMaskForFragments( > > // Paint the mask. > // FIXME: Eventually we will collect the region from the fragment itself instead of just from the paint info. >- PaintInfo paintInfo(context, fragment.backgroundRect.rect(), PaintPhaseMask, paintBehavior, subtreePaintRootForRenderer, nullptr, nullptr, &localPaintingInfo.rootLayer->renderer(), this); >+ PaintInfo paintInfo(context, fragment.backgroundRect.rect(), PaintPhase::Mask, paintBehavior, subtreePaintRootForRenderer, nullptr, nullptr, &localPaintingInfo.rootLayer->renderer(), this); > renderer().paint(paintInfo, toLayoutPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subpixelOffset)); > > if (localPaintingInfo.clipToDirtyRect) >@@ -4866,7 +4866,7 @@ void RenderLayer::paintMaskForFragments( > } > } > >-void RenderLayer::paintChildClippingMaskForFragments(const LayerFragments& layerFragments, GraphicsContext& context, const LayerPaintingInfo& localPaintingInfo, PaintBehavior paintBehavior, RenderObject* subtreePaintRootForRenderer) >+void RenderLayer::paintChildClippingMaskForFragments(const LayerFragments& layerFragments, GraphicsContext& context, const LayerPaintingInfo& localPaintingInfo, OptionSet<PaintBehavior> paintBehavior, RenderObject* subtreePaintRootForRenderer) > { > for (const auto& fragment : layerFragments) { > if (!fragment.shouldPaintContent) >@@ -4876,7 +4876,7 @@ void RenderLayer::paintChildClippingMask > clipToRect(context, localPaintingInfo, fragment.foregroundRect, IncludeSelfForBorderRadius); // Child clipping mask painting will handle clipping to self. > > // Paint the clipped mask. >- PaintInfo paintInfo(context, fragment.backgroundRect.rect(), PaintPhaseClippingMask, paintBehavior, subtreePaintRootForRenderer, nullptr, nullptr, &localPaintingInfo.rootLayer->renderer(), this); >+ PaintInfo paintInfo(context, fragment.backgroundRect.rect(), PaintPhase::ClippingMask, paintBehavior, subtreePaintRootForRenderer, nullptr, nullptr, &localPaintingInfo.rootLayer->renderer(), this); > renderer().paint(paintInfo, toLayoutPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subpixelOffset)); > > if (localPaintingInfo.clipToDirtyRect) >@@ -5878,7 +5878,7 @@ LayoutRect RenderLayer::calculateLayerBo > bool clipExceedsBounds = false; > LayoutRect localClipRect = this->localClipRect(clipExceedsBounds); > if (!localClipRect.isInfinite() && !clipExceedsBounds) { >- if ((flags & IncludeSelfTransform) && paintsWithTransform(PaintBehaviorNormal)) >+ if ((flags & IncludeSelfTransform) && paintsWithTransform(PaintBehavior::Normal)) > localClipRect = transform()->mapRect(localClipRect); > > localClipRect.move(offsetFromAncestor(ancestorLayer)); >@@ -5934,7 +5934,7 @@ LayoutRect RenderLayer::calculateLayerBo > if (flags & IncludeLayerFilterOutsets) > renderer().style().filterOutsets().expandRect(unionBounds); > >- if ((flags & IncludeSelfTransform) && paintsWithTransform(PaintBehaviorNormal)) { >+ if ((flags & IncludeSelfTransform) && paintsWithTransform(PaintBehavior::Normal)) { > TransformationMatrix* affineTrans = transform(); > boundingBoxRect = affineTrans->mapRect(boundingBoxRect); > unionBounds = affineTrans->mapRect(unionBounds); >@@ -6012,31 +6012,31 @@ GraphicsLayer* RenderLayer::layerForScro > return m_backing ? m_backing->layerForScrollCorner() : nullptr; > } > >-bool RenderLayer::paintsWithTransform(PaintBehavior paintBehavior) const >+bool RenderLayer::paintsWithTransform(OptionSet<PaintBehavior> paintBehavior) const > { > bool paintsToWindow = !isComposited() || backing()->paintsIntoWindow(); >- return transform() && ((paintBehavior & PaintBehaviorFlattenCompositingLayers) || paintsToWindow); >+ return transform() && ((paintBehavior & PaintBehavior::FlattenCompositingLayers) || paintsToWindow); > } > >-bool RenderLayer::shouldPaintMask(PaintBehavior paintBehavior, PaintLayerFlags paintFlags) const >+bool RenderLayer::shouldPaintMask(OptionSet<PaintBehavior> paintBehavior, PaintLayerFlags paintFlags) const > { > if (!renderer().hasMask()) > return false; > > bool paintsToWindow = !isComposited() || backing()->paintsIntoWindow(); >- if (paintsToWindow || (paintBehavior & PaintBehaviorFlattenCompositingLayers)) >+ if (paintsToWindow || (paintBehavior & PaintBehavior::FlattenCompositingLayers)) > return true; > > return (paintFlags & PaintLayerPaintingCompositingMaskPhase); > } > >-bool RenderLayer::shouldApplyClipPath(PaintBehavior paintBehavior, PaintLayerFlags paintFlags) const >+bool RenderLayer::shouldApplyClipPath(OptionSet<PaintBehavior> paintBehavior, PaintLayerFlags paintFlags) const > { > if (!renderer().hasClipPath()) > return false; > > bool paintsToWindow = !isComposited() || backing()->paintsIntoWindow(); >- if (paintsToWindow || (paintBehavior & PaintBehaviorFlattenCompositingLayers)) >+ if (paintsToWindow || (paintBehavior & PaintBehavior::FlattenCompositingLayers)) > return true; > > return (paintFlags & PaintLayerPaintingCompositingClipPathPhase); >@@ -6052,7 +6052,7 @@ bool RenderLayer::backgroundIsKnownToBeO > if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) > return false; > >- if (paintsWithTransparency(PaintBehaviorNormal)) >+ if (paintsWithTransparency(PaintBehavior::Normal)) > return false; > > if (renderer().isDocumentElementRenderer()) { >@@ -6070,7 +6070,7 @@ bool RenderLayer::backgroundIsKnownToBeO > return false; > > // FIXME: Handle simple transforms. >- if (paintsWithTransform(PaintBehaviorNormal)) >+ if (paintsWithTransform(PaintBehavior::Normal)) > return false; > > // FIXME: Remove this check. >Index: Source/WebCore/rendering/RenderLayer.h >=================================================================== >--- Source/WebCore/rendering/RenderLayer.h (revision 234514) >+++ Source/WebCore/rendering/RenderLayer.h (working copy) >@@ -505,11 +505,11 @@ public: > // paints the layers that intersect the damage rect from back to > // front. The hitTest method looks for mouse events by walking > // layers that intersect the point from front to back. >- void paint(GraphicsContext&, const LayoutRect& damageRect, const LayoutSize& subpixelOffset = LayoutSize(), PaintBehavior = PaintBehaviorNormal, >+ void paint(GraphicsContext&, const LayoutRect& damageRect, const LayoutSize& subpixelOffset = LayoutSize(), OptionSet<PaintBehavior> = PaintBehavior::Normal, > RenderObject* subtreePaintRoot = nullptr, PaintLayerFlags = 0, SecurityOriginPaintPolicy = SecurityOriginPaintPolicy::AnyOrigin); > bool hitTest(const HitTestRequest&, HitTestResult&); > bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&); >- void paintOverlayScrollbars(GraphicsContext&, const LayoutRect& damageRect, PaintBehavior, RenderObject* subtreePaintRoot = nullptr); >+ void paintOverlayScrollbars(GraphicsContext&, const LayoutRect& damageRect, OptionSet<PaintBehavior>, RenderObject* subtreePaintRoot = nullptr); > > struct ClipRectsContext { > ClipRectsContext(const RenderLayer* inRootLayer, ClipRectsType inClipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize, ShouldRespectOverflowClip inRespectOverflowClip = RespectOverflowClip) >@@ -605,7 +605,7 @@ public: > // resulting transform has transform-origin baked in. If the layer does not have a transform, > // returns the identity matrix. > TransformationMatrix currentTransform(RenderStyle::ApplyTransformOrigin = RenderStyle::IncludeTransformOrigin) const; >- TransformationMatrix renderableTransform(PaintBehavior) const; >+ TransformationMatrix renderableTransform(OptionSet<PaintBehavior>) const; > > // Get the perspective transform, which is applied to transformed sublayers. > // Returns true if the layer has a -webkit-perspective. >@@ -663,14 +663,14 @@ public: > bool usesAsyncScrolling() const override; > WEBCORE_EXPORT bool needsCompositedScrolling() const; > >- bool paintsWithTransparency(PaintBehavior paintBehavior) const >+ bool paintsWithTransparency(OptionSet<PaintBehavior> paintBehavior) const > { >- return (isTransparent() || hasBlendMode() || (isolatesBlending() && !renderer().isDocumentElementRenderer())) && ((paintBehavior & PaintBehaviorFlattenCompositingLayers) || !isComposited()); >+ return (isTransparent() || hasBlendMode() || (isolatesBlending() && !renderer().isDocumentElementRenderer())) && ((paintBehavior & PaintBehavior::FlattenCompositingLayers) || !isComposited()); > } > >- bool paintsWithTransform(PaintBehavior) const; >- bool shouldPaintMask(PaintBehavior, PaintLayerFlags) const; >- bool shouldApplyClipPath(PaintBehavior, PaintLayerFlags) const; >+ bool paintsWithTransform(OptionSet<PaintBehavior>) const; >+ bool shouldPaintMask(OptionSet<PaintBehavior>, PaintLayerFlags) const; >+ bool shouldApplyClipPath(OptionSet<PaintBehavior>, PaintLayerFlags) const; > > // Returns true if background phase is painted opaque in the given rect. > // The query rect is given in local coordinates. >@@ -722,7 +722,7 @@ private: > enum CollectLayersBehavior { StopAtStackingContexts, StopAtStackingContainers }; > > struct LayerPaintingInfo { >- LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRect, PaintBehavior inPaintBehavior, const LayoutSize& inSubpixelOffset, RenderObject* inSubtreePaintRoot = nullptr, OverlapTestRequestMap* inOverlapTestRequests = nullptr, bool inRequireSecurityOriginAccessForWidgets = false) >+ LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRect, OptionSet<PaintBehavior> inPaintBehavior, const LayoutSize& inSubpixelOffset, RenderObject* inSubtreePaintRoot = nullptr, OverlapTestRequestMap* inOverlapTestRequests = nullptr, bool inRequireSecurityOriginAccessForWidgets = false) > : rootLayer(inRootLayer) > , subtreePaintRoot(inSubtreePaintRoot) > , paintDirtyRect(inDirtyRect) >@@ -737,7 +737,7 @@ private: > LayoutRect paintDirtyRect; // Relative to rootLayer; > LayoutSize subpixelOffset; > OverlapTestRequestMap* overlapTestRequests; // May be null. >- PaintBehavior paintBehavior; >+ OptionSet<PaintBehavior> paintBehavior; > bool requireSecurityOriginAccessForWidgets; > bool clipToDirtyRect { true }; > }; >@@ -843,14 +843,14 @@ private: > > void updatePaintingInfoForFragments(LayerFragments&, const LayerPaintingInfo&, PaintLayerFlags, bool shouldPaintContent, const LayoutSize& offsetFromRoot); > void paintBackgroundForFragments(const LayerFragments&, GraphicsContext&, GraphicsContext& transparencyLayerContext, >- const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer); >+ const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const LayerPaintingInfo&, OptionSet<PaintBehavior>, RenderObject* paintingRootForRenderer); > void paintForegroundForFragments(const LayerFragments&, GraphicsContext&, GraphicsContext& transparencyLayerContext, >- const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer); >- void paintForegroundForFragmentsWithPhase(PaintPhase, const LayerFragments&, GraphicsContext&, const LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer); >- void paintOutlineForFragments(const LayerFragments&, GraphicsContext&, const LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer); >+ const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const LayerPaintingInfo&, OptionSet<PaintBehavior>, RenderObject* paintingRootForRenderer); >+ void paintForegroundForFragmentsWithPhase(PaintPhase, const LayerFragments&, GraphicsContext&, const LayerPaintingInfo&, OptionSet<PaintBehavior>, RenderObject* paintingRootForRenderer); >+ void paintOutlineForFragments(const LayerFragments&, GraphicsContext&, const LayerPaintingInfo&, OptionSet<PaintBehavior>, RenderObject* paintingRootForRenderer); > void paintOverflowControlsForFragments(const LayerFragments&, GraphicsContext&, const LayerPaintingInfo&); >- void paintMaskForFragments(const LayerFragments&, GraphicsContext&, const LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer); >- void paintChildClippingMaskForFragments(const LayerFragments&, GraphicsContext&, const LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer); >+ void paintMaskForFragments(const LayerFragments&, GraphicsContext&, const LayerPaintingInfo&, OptionSet<PaintBehavior>, RenderObject* paintingRootForRenderer); >+ void paintChildClippingMaskForFragments(const LayerFragments&, GraphicsContext&, const LayerPaintingInfo&, OptionSet<PaintBehavior>, RenderObject* paintingRootForRenderer); > void paintTransformedLayerIntoFragments(GraphicsContext&, const LayerPaintingInfo&, PaintLayerFlags); > > RenderLayer* transparentPaintingAncestor(); >Index: Source/WebCore/rendering/RenderLayerBacking.cpp >=================================================================== >--- Source/WebCore/rendering/RenderLayerBacking.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderLayerBacking.cpp (working copy) >@@ -2520,7 +2520,7 @@ void RenderLayerBacking::setContentsNeed > > void RenderLayerBacking::paintIntoLayer(const GraphicsLayer* graphicsLayer, GraphicsContext& context, > const IntRect& paintDirtyRect, // In the coords of rootLayer. >- PaintBehavior paintBehavior, GraphicsLayerPaintingPhase paintingPhase) >+ OptionSet<PaintBehavior> paintBehavior, GraphicsLayerPaintingPhase paintingPhase) > { > if ((paintsIntoWindow() || paintsIntoCompositedAncestor()) && paintingPhase != GraphicsLayerPaintChildClippingMask) { > #if !PLATFORM(IOS) && !OS(WINDOWS) >@@ -2607,12 +2607,12 @@ void RenderLayerBacking::paintContents(c > dirtyRect.intersect(enclosingIntRect(compositedBoundsIncludingMargin())); > > // We have to use the same root as for hit testing, because both methods can compute and cache clipRects. >- PaintBehavior behavior = PaintBehaviorNormal; >+ OptionSet<PaintBehavior> behavior = PaintBehavior::Normal; > if (layerPaintBehavior == GraphicsLayerPaintSnapshotting) >- behavior |= PaintBehaviorSnapshotting; >+ behavior |= PaintBehavior::Snapshotting; > > if (layerPaintBehavior == GraphicsLayerPaintFirstTilePaint) >- behavior |= PaintBehaviorTileFirstPaint; >+ behavior |= PaintBehavior::TileFirstPaint; > > paintIntoLayer(graphicsLayer, context, dirtyRect, behavior, paintingPhase); > >Index: Source/WebCore/rendering/RenderLayerBacking.h >=================================================================== >--- Source/WebCore/rendering/RenderLayerBacking.h (revision 234514) >+++ Source/WebCore/rendering/RenderLayerBacking.h (working copy) >@@ -344,7 +344,7 @@ private: > bool hasTiledBackingFlatteningLayer() const { return (m_childContainmentLayer && m_isFrameLayerWithTiledBacking); } > GraphicsLayer* tileCacheFlatteningLayer() const { return m_isFrameLayerWithTiledBacking ? m_childContainmentLayer.get() : nullptr; } > >- void paintIntoLayer(const GraphicsLayer*, GraphicsContext&, const IntRect& paintDirtyRect, PaintBehavior, GraphicsLayerPaintingPhase); >+ void paintIntoLayer(const GraphicsLayer*, GraphicsContext&, const IntRect& paintDirtyRect, OptionSet<PaintBehavior>, GraphicsLayerPaintingPhase); > > static CSSPropertyID graphicsLayerToCSSProperty(AnimatedPropertyID); > static AnimatedPropertyID cssToGraphicsLayerProperty(CSSPropertyID); >Index: Source/WebCore/rendering/RenderLineBoxList.cpp >=================================================================== >--- Source/WebCore/rendering/RenderLineBoxList.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderLineBoxList.cpp (working copy) >@@ -261,7 +261,7 @@ void RenderLineBoxList::paint(RenderBoxM > } > } > >- if (info.phase == PaintPhaseOutline || info.phase == PaintPhaseSelfOutline || info.phase == PaintPhaseChildOutlines) { >+ if (info.phase == PaintPhase::Outline || info.phase == PaintPhase::SelfOutline || info.phase == PaintPhase::ChildOutlines) { > ListHashSet<RenderInline*>::iterator end = info.outlineObjects->end(); > for (ListHashSet<RenderInline*>::iterator it = info.outlineObjects->begin(); it != end; ++it) { > RenderInline* flow = *it; >Index: Source/WebCore/rendering/RenderListBox.cpp >=================================================================== >--- Source/WebCore/rendering/RenderListBox.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderListBox.cpp (working copy) >@@ -313,7 +313,7 @@ void RenderListBox::paintObject(PaintInf > if (style().visibility() != Visibility::Visible) > return; > >- if (paintInfo.phase == PaintPhaseForeground) { >+ if (paintInfo.phase == PaintPhase::Foreground) { > paintItem(paintInfo, paintOffset, [this](PaintInfo& paintInfo, const LayoutPoint& paintOffset, int listItemIndex) { > paintItemForeground(paintInfo, paintOffset, listItemIndex); > }); >@@ -325,16 +325,16 @@ void RenderListBox::paintObject(PaintInf > switch (paintInfo.phase) { > // Depending on whether we have overlay scrollbars they > // get rendered in the foreground or background phases >- case PaintPhaseForeground: >+ case PaintPhase::Foreground: > if (m_vBar->isOverlayScrollbar()) > paintScrollbar(paintInfo, paintOffset); > break; >- case PaintPhaseBlockBackground: >+ case PaintPhase::BlockBackground: > if (!m_vBar->isOverlayScrollbar()) > paintScrollbar(paintInfo, paintOffset); > break; >- case PaintPhaseChildBlockBackground: >- case PaintPhaseChildBlockBackgrounds: { >+ case PaintPhase::ChildBlockBackground: >+ case PaintPhase::ChildBlockBackgrounds: { > paintItem(paintInfo, paintOffset, [this](PaintInfo& paintInfo, const LayoutPoint& paintOffset, int listItemIndex) { > paintItemBackground(paintInfo, paintOffset, listItemIndex); > }); >Index: Source/WebCore/rendering/RenderListMarker.cpp >=================================================================== >--- Source/WebCore/rendering/RenderListMarker.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderListMarker.cpp (working copy) >@@ -1183,7 +1183,7 @@ LayoutRect RenderListMarker::localSelect > > void RenderListMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { >- if (paintInfo.phase != PaintPhaseForeground) >+ if (paintInfo.phase != PaintPhase::Foreground) > return; > > if (style().visibility() != Visibility::Visible) >Index: Source/WebCore/rendering/RenderReplaced.cpp >=================================================================== >--- Source/WebCore/rendering/RenderReplaced.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderReplaced.cpp (working copy) >@@ -170,29 +170,29 @@ void RenderReplaced::paint(PaintInfo& pa > > LayoutPoint adjustedPaintOffset = paintOffset + location(); > >- if (hasVisibleBoxDecorations() && paintInfo.phase == PaintPhaseForeground) >+ if (hasVisibleBoxDecorations() && paintInfo.phase == PaintPhase::Foreground) > paintBoxDecorations(paintInfo, adjustedPaintOffset); > >- if (paintInfo.phase == PaintPhaseMask) { >+ if (paintInfo.phase == PaintPhase::Mask) { > paintMask(paintInfo, adjustedPaintOffset); > return; > } > > LayoutRect paintRect = LayoutRect(adjustedPaintOffset, size()); >- if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) { >+ if (paintInfo.phase == PaintPhase::Outline || paintInfo.phase == PaintPhase::SelfOutline) { > if (style().outlineWidth()) > paintOutline(paintInfo, paintRect); > return; > } > >- if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection) >+ if (paintInfo.phase != PaintPhase::Foreground && paintInfo.phase != PaintPhase::Selection) > return; > > if (!paintInfo.shouldPaintWithinRoot(*this)) > return; > > bool drawSelectionTint = shouldDrawSelectionTint(); >- if (paintInfo.phase == PaintPhaseSelection) { >+ if (paintInfo.phase == PaintPhase::Selection) { > if (selectionState() == SelectionNone) > return; > drawSelectionTint = false; >@@ -231,11 +231,14 @@ void RenderReplaced::paint(PaintInfo& pa > > bool RenderReplaced::shouldPaint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { >- if ((paintInfo.paintBehavior & PaintBehaviorExcludeSelection) && isSelected()) >+ if ((paintInfo.paintBehavior.contains(PaintBehavior::ExcludeSelection)) && isSelected()) > return false; > >- if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseOutline && paintInfo.phase != PaintPhaseSelfOutline >- && paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPhaseMask) >+ if (paintInfo.phase != PaintPhase::Foreground >+ && paintInfo.phase != PaintPhase::Outline >+ && paintInfo.phase != PaintPhase::SelfOutline >+ && paintInfo.phase != PaintPhase::Selection >+ && paintInfo.phase != PaintPhase::Mask) > return false; > > if (!paintInfo.shouldPaintWithinRoot(*this)) >Index: Source/WebCore/rendering/RenderReplica.cpp >=================================================================== >--- Source/WebCore/rendering/RenderReplica.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderReplica.cpp (working copy) >@@ -66,19 +66,19 @@ void RenderReplica::computePreferredLogi > > void RenderReplica::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { >- if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseMask) >+ if (paintInfo.phase != PaintPhase::Foreground && paintInfo.phase != PaintPhase::Mask) > return; > > LayoutPoint adjustedPaintOffset = paintOffset + location(); > >- if (paintInfo.phase == PaintPhaseForeground) { >+ if (paintInfo.phase == PaintPhase::Foreground) { > // Turn around and paint the parent layer. Use temporary clipRects, so that the layer doesn't end up caching clip rects > // computing using the wrong rootLayer > RenderLayer* rootPaintingLayer = layer()->transform() ? layer()->parent() : layer()->enclosingTransformedAncestor(); >- RenderLayer::LayerPaintingInfo paintingInfo(rootPaintingLayer, paintInfo.rect, PaintBehaviorNormal, LayoutSize(), 0); >+ RenderLayer::LayerPaintingInfo paintingInfo(rootPaintingLayer, paintInfo.rect, PaintBehavior::Normal, LayoutSize(), 0); > RenderLayer::PaintLayerFlags flags = RenderLayer::PaintLayerHaveTransparency | RenderLayer::PaintLayerAppliedTransform | RenderLayer::PaintLayerTemporaryClipRects | RenderLayer::PaintLayerPaintingReflection; > layer()->parent()->paintLayer(paintInfo.context(), paintingInfo, flags); >- } else if (paintInfo.phase == PaintPhaseMask) >+ } else if (paintInfo.phase == PaintPhase::Mask) > paintMask(paintInfo, adjustedPaintOffset); > } > >Index: Source/WebCore/rendering/RenderScrollbarPart.cpp >=================================================================== >--- Source/WebCore/rendering/RenderScrollbarPart.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderScrollbarPart.cpp (working copy) >@@ -176,15 +176,15 @@ void RenderScrollbarPart::paintIntoRect( > } > > // Now do the paint. >- PaintInfo paintInfo(graphicsContext, snappedIntRect(rect), PaintPhaseBlockBackground, PaintBehaviorNormal); >+ PaintInfo paintInfo(graphicsContext, snappedIntRect(rect), PaintPhase::BlockBackground, PaintBehavior::Normal); > paint(paintInfo, paintOffset); >- paintInfo.phase = PaintPhaseChildBlockBackgrounds; >+ paintInfo.phase = PaintPhase::ChildBlockBackgrounds; > paint(paintInfo, paintOffset); >- paintInfo.phase = PaintPhaseFloat; >+ paintInfo.phase = PaintPhase::Float; > paint(paintInfo, paintOffset); >- paintInfo.phase = PaintPhaseForeground; >+ paintInfo.phase = PaintPhase::Foreground; > paint(paintInfo, paintOffset); >- paintInfo.phase = PaintPhaseOutline; >+ paintInfo.phase = PaintPhase::Outline; > paint(paintInfo, paintOffset); > > if (needsTransparencyLayer) { >Index: Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp >=================================================================== >--- Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp (working copy) >@@ -102,12 +102,12 @@ void RenderSnapshottedPlugIn::updateSnap > > void RenderSnapshottedPlugIn::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { >- if (paintInfo.phase == PaintPhaseForeground && plugInImageElement().displayState() < HTMLPlugInElement::Restarting) { >+ if (paintInfo.phase == PaintPhase::Foreground && plugInImageElement().displayState() < HTMLPlugInElement::Restarting) { > paintSnapshot(paintInfo, paintOffset); > } > >- PaintPhase newPhase = (paintInfo.phase == PaintPhaseChildOutlines) ? PaintPhaseOutline : paintInfo.phase; >- newPhase = (newPhase == PaintPhaseChildBlockBackgrounds) ? PaintPhaseChildBlockBackground : newPhase; >+ PaintPhase newPhase = (paintInfo.phase == PaintPhase::ChildOutlines) ? PaintPhase::Outline : paintInfo.phase; >+ newPhase = (newPhase == PaintPhase::ChildBlockBackgrounds) ? PaintPhase::ChildBlockBackground : newPhase; > > PaintInfo paintInfoForChild(paintInfo); > paintInfoForChild.phase = newPhase; >Index: Source/WebCore/rendering/RenderTable.cpp >=================================================================== >--- Source/WebCore/rendering/RenderTable.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderTable.cpp (working copy) >@@ -668,21 +668,21 @@ void RenderTable::paint(PaintInfo& paint > void RenderTable::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { > PaintPhase paintPhase = paintInfo.phase; >- if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) && hasVisibleBoxDecorations() && style().visibility() == Visibility::Visible) >+ if ((paintPhase == PaintPhase::BlockBackground || paintPhase == PaintPhase::ChildBlockBackground) && hasVisibleBoxDecorations() && style().visibility() == Visibility::Visible) > paintBoxDecorations(paintInfo, paintOffset); > >- if (paintPhase == PaintPhaseMask) { >+ if (paintPhase == PaintPhase::Mask) { > paintMask(paintInfo, paintOffset); > return; > } > > // We're done. We don't bother painting any children. >- if (paintPhase == PaintPhaseBlockBackground) >+ if (paintPhase == PaintPhase::BlockBackground) > return; > > // We don't paint our own background, but we do let the kids paint their backgrounds. >- if (paintPhase == PaintPhaseChildBlockBackgrounds) >- paintPhase = PaintPhaseChildBlockBackground; >+ if (paintPhase == PaintPhase::ChildBlockBackgrounds) >+ paintPhase = PaintPhase::ChildBlockBackground; > > PaintInfo info(paintInfo); > info.phase = paintPhase; >@@ -695,11 +695,11 @@ void RenderTable::paintObject(PaintInfo& > } > } > >- if (collapseBorders() && paintPhase == PaintPhaseChildBlockBackground && style().visibility() == Visibility::Visible) { >+ if (collapseBorders() && paintPhase == PaintPhase::ChildBlockBackground && style().visibility() == Visibility::Visible) { > recalcCollapsedBorders(); > // Using our cached sorted styles, we then do individual passes, > // painting each style of border from lowest precedence to highest precedence. >- info.phase = PaintPhaseCollapsedTableBorders; >+ info.phase = PaintPhase::CollapsedTableBorders; > size_t count = m_collapsedBorders.size(); > for (size_t i = 0; i < count; ++i) { > m_currentBorder = &m_collapsedBorders[i]; >@@ -712,7 +712,7 @@ void RenderTable::paintObject(PaintInfo& > } > > // Paint outline. >- if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && hasOutline() && style().visibility() == Visibility::Visible) >+ if ((paintPhase == PaintPhase::Outline || paintPhase == PaintPhase::SelfOutline) && hasOutline() && style().visibility() == Visibility::Visible) > paintOutline(paintInfo, LayoutRect(paintOffset, size())); > } > >@@ -755,7 +755,7 @@ void RenderTable::paintBoxDecorations(Pa > > void RenderTable::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { >- if (style().visibility() != Visibility::Visible || paintInfo.phase != PaintPhaseMask) >+ if (style().visibility() != Visibility::Visible || paintInfo.phase != PaintPhase::Mask) > return; > > LayoutRect rect(paintOffset, size()); >@@ -1473,7 +1473,7 @@ LayoutRect RenderTable::overflowClipRect > LayoutRect rect; > // Don't clip out the table's side of the collapsed borders if we're in the paint phase that will ask the sections to paint them. > // Likewise, if we're self-painting we avoid clipping them out as the clip rect that will be passed down to child layers from RenderLayer will do that instead. >- if (phase == PaintPhaseChildBlockBackgrounds || layer()->isSelfPaintingLayer()) { >+ if (phase == PaintPhase::ChildBlockBackgrounds || layer()->isSelfPaintingLayer()) { > rect = borderBoxRectInFragment(fragment); > rect.setLocation(location + rect.location()); > } else >Index: Source/WebCore/rendering/RenderTable.h >=================================================================== >--- Source/WebCore/rendering/RenderTable.h (revision 234514) >+++ Source/WebCore/rendering/RenderTable.h (working copy) >@@ -310,7 +310,7 @@ private: > LayoutUnit convertStyleLogicalWidthToComputedWidth(const Length& styleLogicalWidth, LayoutUnit availableWidth); > LayoutUnit convertStyleLogicalHeightToComputedHeight(const Length& styleLogicalHeight); > >- LayoutRect overflowClipRect(const LayoutPoint& location, RenderFragmentContainer*, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize, PaintPhase = PaintPhaseBlockBackground) final; >+ LayoutRect overflowClipRect(const LayoutPoint& location, RenderFragmentContainer*, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize, PaintPhase = PaintPhase::BlockBackground) final; > LayoutRect overflowClipRectForChildLayers(const LayoutPoint& location, RenderFragmentContainer* fragment, OverlayScrollbarSizeRelevancy relevancy) override { return RenderBox::overflowClipRect(location, fragment, relevancy); } > > void addOverflowFromChildren() final; >Index: Source/WebCore/rendering/RenderTableCell.cpp >=================================================================== >--- Source/WebCore/rendering/RenderTableCell.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderTableCell.cpp (working copy) >@@ -1107,7 +1107,7 @@ LayoutUnit RenderTableCell::borderHalfAf > > void RenderTableCell::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { >- ASSERT(paintInfo.phase != PaintPhaseCollapsedTableBorders); >+ ASSERT(paintInfo.phase != PaintPhase::CollapsedTableBorders); > RenderBlockFlow::paint(paintInfo, paintOffset); > } > >@@ -1198,7 +1198,7 @@ void RenderTableCell::sortBorderValues(R > > void RenderTableCell::paintCollapsedBorders(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { >- ASSERT(paintInfo.phase == PaintPhaseCollapsedTableBorders); >+ ASSERT(paintInfo.phase == PaintPhase::CollapsedTableBorders); > > if (!paintInfo.shouldPaintWithinRoot(*this) || style().visibility() != Visibility::Visible) > return; >@@ -1335,7 +1335,7 @@ void RenderTableCell::paintBoxDecoration > > void RenderTableCell::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { >- if (style().visibility() != Visibility::Visible || paintInfo.phase != PaintPhaseMask) >+ if (style().visibility() != Visibility::Visible || paintInfo.phase != PaintPhase::Mask) > return; > > RenderTable* tableElt = table(); >Index: Source/WebCore/rendering/RenderTableRow.cpp >=================================================================== >--- Source/WebCore/rendering/RenderTableRow.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderTableRow.cpp (working copy) >@@ -201,7 +201,7 @@ void RenderTableRow::paintOutlineForRowI > { > LayoutPoint adjustedPaintOffset = paintOffset + location(); > PaintPhase paintPhase = paintInfo.phase; >- if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && style().visibility() == Visibility::Visible) >+ if ((paintPhase == PaintPhase::Outline || paintPhase == PaintPhase::SelfOutline) && style().visibility() == Visibility::Visible) > paintOutline(paintInfo, LayoutRect(adjustedPaintOffset, size())); > } > >@@ -212,7 +212,7 @@ void RenderTableRow::paint(PaintInfo& pa > paintOutlineForRowIfNeeded(paintInfo, paintOffset); > for (RenderTableCell* cell = firstCell(); cell; cell = cell->nextCell()) { > // Paint the row background behind the cell. >- if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == PaintPhaseChildBlockBackground) >+ if (paintInfo.phase == PaintPhase::BlockBackground || paintInfo.phase == PaintPhase::ChildBlockBackground) > cell->paintBackgroundsBehindCell(paintInfo, paintOffset, this); > if (!cell->hasSelfPaintingLayer()) > cell->paint(paintInfo, paintOffset); >Index: Source/WebCore/rendering/RenderTableSection.cpp >=================================================================== >--- Source/WebCore/rendering/RenderTableSection.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderTableSection.cpp (working copy) >@@ -916,7 +916,7 @@ void RenderTableSection::paint(PaintInfo > if (pushedClip) > popContentsClip(paintInfo, phase, adjustedPaintOffset); > >- if ((phase == PaintPhaseOutline || phase == PaintPhaseSelfOutline) && style().visibility() == Visibility::Visible) >+ if ((phase == PaintPhase::Outline || phase == PaintPhase::SelfOutline) && style().visibility() == Visibility::Visible) > paintOutline(paintInfo, LayoutRect(adjustedPaintOffset, size())); > } > >@@ -941,7 +941,7 @@ void RenderTableSection::paintCell(Rende > PaintPhase paintPhase = paintInfo.phase; > RenderTableRow& row = downcast<RenderTableRow>(*cell->parent()); > >- if (paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) { >+ if (paintPhase == PaintPhase::BlockBackground || paintPhase == PaintPhase::ChildBlockBackground) { > // We need to handle painting a stack of backgrounds. This stack (from bottom to top) consists of > // the column group, column, row group, row, and then the cell. > RenderTableCol* column = table()->colElement(cell->col()); >@@ -1200,7 +1200,7 @@ void RenderTableSection::paintObject(Pai > > if (dirtiedColumns.start < dirtiedColumns.end) { > if (!m_hasMultipleCellLevels && !m_overflowingCells.size()) { >- if (paintInfo.phase == PaintPhaseCollapsedTableBorders) { >+ if (paintInfo.phase == PaintPhase::CollapsedTableBorders) { > // Collapsed borders are painted from the bottom right to the top left so that precedence > // due to cell position is respected. We need to paint one row beyond the topmost dirtied > // row to calculate its collapsed border value. >@@ -1293,7 +1293,7 @@ void RenderTableSection::paintObject(Pai > else > std::sort(cells.begin(), cells.end(), compareCellPositionsWithOverflowingCells); > >- if (paintInfo.phase == PaintPhaseCollapsedTableBorders) { >+ if (paintInfo.phase == PaintPhase::CollapsedTableBorders) { > for (unsigned i = cells.size(); i > 0; --i) { > LayoutPoint cellPoint = flipForWritingModeForChild(cells[i - 1], paintOffset); > cells[i - 1]->paintCollapsedBorders(paintInfo, cellPoint); >Index: Source/WebCore/rendering/RenderThemeMac.mm >=================================================================== >--- Source/WebCore/rendering/RenderThemeMac.mm (revision 234514) >+++ Source/WebCore/rendering/RenderThemeMac.mm (working copy) >@@ -2091,7 +2091,7 @@ bool RenderThemeMac::paintSearchFieldRes > > bool RenderThemeMac::paintSnapshottedPluginOverlay(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect&) > { >- if (paintInfo.phase != PaintPhaseBlockBackground) >+ if (paintInfo.phase != PaintPhase::BlockBackground) > return true; > > if (!is<RenderBlock>(renderer)) >@@ -2303,7 +2303,7 @@ NSServicesRolloverButtonCell* RenderThem > > bool RenderThemeMac::paintImageControlsButton(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect) > { >- if (paintInfo.phase != PaintPhaseBlockBackground) >+ if (paintInfo.phase != PaintPhase::BlockBackground) > return true; > > #if HAVE(APPKIT_SERVICE_CONTROLS_SUPPORT) >Index: Source/WebCore/rendering/RenderVideo.cpp >=================================================================== >--- Source/WebCore/rendering/RenderVideo.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderVideo.cpp (working copy) >@@ -177,20 +177,20 @@ void RenderVideo::paintReplaced(PaintInf > bool displayingPoster = videoElement().shouldDisplayPosterImage(); > > if (!displayingPoster && !mediaPlayer) { >- if (paintInfo.phase == PaintPhaseForeground) >+ if (paintInfo.phase == PaintPhase::Foreground) > page().addRelevantUnpaintedObject(this, visualOverflowRect()); > return; > } > > LayoutRect rect = videoBox(); > if (rect.isEmpty()) { >- if (paintInfo.phase == PaintPhaseForeground) >+ if (paintInfo.phase == PaintPhase::Foreground) > page().addRelevantUnpaintedObject(this, visualOverflowRect()); > return; > } > rect.moveBy(paintOffset); > >- if (paintInfo.phase == PaintPhaseForeground) >+ if (paintInfo.phase == PaintPhase::Foreground) > page().addRelevantRepaintedObject(this, rect); > > LayoutRect contentRect = contentBoxRect(); >@@ -204,7 +204,7 @@ void RenderVideo::paintReplaced(PaintInf > if (displayingPoster) > paintIntoRect(paintInfo, rect); > else if (!videoElement().isFullscreen() || !mediaPlayer->supportsAcceleratedRendering()) { >- if (paintInfo.paintBehavior & PaintBehaviorFlattenCompositingLayers) >+ if (paintInfo.paintBehavior.contains(PaintBehavior::FlattenCompositingLayers)) > mediaPlayer->paintCurrentFrameInContext(context, rect); > else > mediaPlayer->paint(context, rect); >Index: Source/WebCore/rendering/RenderWidget.cpp >=================================================================== >--- Source/WebCore/rendering/RenderWidget.cpp (revision 234514) >+++ Source/WebCore/rendering/RenderWidget.cpp (working copy) >@@ -231,11 +231,11 @@ void RenderWidget::paintContents(PaintIn > // to paint itself. That way it will composite properly with z-indexed layers. > LayoutRect paintRect = paintInfo.rect; > >- PaintBehavior oldBehavior = PaintBehaviorNormal; >- if (is<FrameView>(*m_widget) && (paintInfo.paintBehavior & PaintBehaviorTileFirstPaint)) { >+ OptionSet<PaintBehavior> oldBehavior = PaintBehavior::Normal; >+ if (is<FrameView>(*m_widget) && (paintInfo.paintBehavior & PaintBehavior::TileFirstPaint)) { > FrameView& frameView = downcast<FrameView>(*m_widget); > oldBehavior = frameView.paintBehavior(); >- frameView.setPaintBehavior(oldBehavior | PaintBehaviorTileFirstPaint); >+ frameView.setPaintBehavior(oldBehavior | PaintBehavior::TileFirstPaint); > } > > IntPoint widgetLocation = m_widget->frameRect().location(); >@@ -259,7 +259,7 @@ void RenderWidget::paintContents(PaintIn > ASSERT(!paintInfo.overlapTestRequests->contains(this) || (paintInfo.overlapTestRequests->get(this) == m_widget->frameRect())); > paintInfo.overlapTestRequests->set(this, m_widget->frameRect()); > } >- if (paintInfo.paintBehavior & PaintBehaviorTileFirstPaint) >+ if (paintInfo.paintBehavior & PaintBehavior::TileFirstPaint) > frameView.setPaintBehavior(oldBehavior); > } > } >@@ -271,18 +271,18 @@ void RenderWidget::paint(PaintInfo& pain > > LayoutPoint adjustedPaintOffset = paintOffset + location(); > >- if (hasVisibleBoxDecorations() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection)) >+ if (hasVisibleBoxDecorations() && (paintInfo.phase == PaintPhase::Foreground || paintInfo.phase == PaintPhase::Selection)) > paintBoxDecorations(paintInfo, adjustedPaintOffset); > >- if (paintInfo.phase == PaintPhaseMask) { >+ if (paintInfo.phase == PaintPhase::Mask) { > paintMask(paintInfo, adjustedPaintOffset); > return; > } > >- if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && hasOutline()) >+ if ((paintInfo.phase == PaintPhase::Outline || paintInfo.phase == PaintPhase::SelfOutline) && hasOutline()) > paintOutline(paintInfo, LayoutRect(adjustedPaintOffset, size())); > >- if (paintInfo.phase != PaintPhaseForeground) >+ if (paintInfo.phase != PaintPhase::Foreground) > return; > > if (style().hasBorderRadius()) { >Index: Source/WebCore/rendering/RootInlineBox.cpp >=================================================================== >--- Source/WebCore/rendering/RootInlineBox.cpp (revision 234514) >+++ Source/WebCore/rendering/RootInlineBox.cpp (working copy) >@@ -159,8 +159,7 @@ float RootInlineBox::placeEllipsisBox(bo > > void RootInlineBox::paintEllipsisBox(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom) const > { >- if (hasEllipsisBox() && paintInfo.shouldPaintWithinRoot(renderer()) && renderer().style().visibility() == Visibility::Visible >- && paintInfo.phase == PaintPhaseForeground) >+ if (hasEllipsisBox() && paintInfo.shouldPaintWithinRoot(renderer()) && renderer().style().visibility() == Visibility::Visible && paintInfo.phase == PaintPhase::Foreground) > ellipsisBox()->paint(paintInfo, paintOffset, lineTop, lineBottom); > } > >Index: Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp >=================================================================== >--- Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp (revision 234514) >+++ Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp (working copy) >@@ -76,7 +76,7 @@ FloatRect computeOverflow(const RenderBl > > void paintFlow(const RenderBlockFlow& flow, const Layout& layout, PaintInfo& paintInfo, const LayoutPoint& paintOffset) > { >- if (paintInfo.phase != PaintPhaseForeground) >+ if (paintInfo.phase != PaintPhase::Foreground) > return; > > auto& style = flow.style(); >Index: Source/WebCore/rendering/mathml/MathOperator.cpp >=================================================================== >--- Source/WebCore/rendering/mathml/MathOperator.cpp (revision 234514) >+++ Source/WebCore/rendering/mathml/MathOperator.cpp (working copy) >@@ -708,7 +708,7 @@ void MathOperator::paintHorizontalGlyphA > > void MathOperator::paint(const RenderStyle& style, PaintInfo& info, const LayoutPoint& paintOffset) > { >- if (info.context().paintingDisabled() || info.phase != PaintPhaseForeground || style.visibility() != Visibility::Visible) >+ if (info.context().paintingDisabled() || info.phase != PaintPhase::Foreground || style.visibility() != Visibility::Visible) > return; > > // Make a copy of the PaintInfo because applyTransform will modify its rect. >Index: Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp >=================================================================== >--- Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp (revision 234514) >+++ Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp (working copy) >@@ -110,7 +110,7 @@ void RenderMathMLBlock::paint(PaintInfo& > { > RenderBlock::paint(info, paintOffset); > >- if (info.context().paintingDisabled() || info.phase != PaintPhaseForeground) >+ if (info.context().paintingDisabled() || info.phase != PaintPhase::Foreground) > return; > > IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset + location()); >Index: Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp >=================================================================== >--- Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp (revision 234514) >+++ Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp (working copy) >@@ -255,7 +255,7 @@ void RenderMathMLFraction::paint(PaintIn > { > RenderMathMLBlock::paint(info, paintOffset); > LayoutUnit thickness = lineThickness(); >- if (info.context().paintingDisabled() || info.phase != PaintPhaseForeground || style().visibility() != Visibility::Visible || !isValid() || !thickness) >+ if (info.context().paintingDisabled() || info.phase != PaintPhase::Foreground || style().visibility() != Visibility::Visible || !isValid() || !thickness) > return; > > IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset + location() + LayoutPoint(0, ascentOverHorizontalAxis())); >Index: Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp >=================================================================== >--- Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp (revision 234514) >+++ Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp (working copy) >@@ -207,7 +207,7 @@ void RenderMathMLMenclose::paint(PaintIn > { > RenderMathMLRow::paint(info, paintOffset); > >- if (info.context().paintingDisabled() || info.phase != PaintPhaseForeground || style().visibility() != Visibility::Visible) >+ if (info.context().paintingDisabled() || info.phase != PaintPhase::Foreground || style().visibility() != Visibility::Visible) > return; > > LayoutUnit thickness = ruleThickness(); >Index: Source/WebCore/rendering/mathml/RenderMathMLToken.cpp >=================================================================== >--- Source/WebCore/rendering/mathml/RenderMathMLToken.cpp (revision 234514) >+++ Source/WebCore/rendering/mathml/RenderMathMLToken.cpp (working copy) >@@ -594,7 +594,7 @@ void RenderMathMLToken::paint(PaintInfo& > RenderMathMLBlock::paint(info, paintOffset); > > // FIXME: Instead of using DrawGlyph, we may consider using the more general TextPainter so that we can apply mathvariant to strings with an arbitrary number of characters and preserve advanced CSS effects (text-shadow, etc). >- if (info.context().paintingDisabled() || info.phase != PaintPhaseForeground || style().visibility() != Visibility::Visible || !m_mathVariantCodePoint) >+ if (info.context().paintingDisabled() || info.phase != PaintPhase::Foreground || style().visibility() != Visibility::Visible || !m_mathVariantCodePoint) > return; > > auto mathVariantGlyph = style().fontCascade().glyphDataForCharacter(m_mathVariantCodePoint.value(), m_mathVariantIsMirrored); >Index: Source/WebCore/rendering/svg/RenderSVGContainer.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGContainer.cpp (revision 234514) >+++ Source/WebCore/rendering/svg/RenderSVGContainer.cpp (working copy) >@@ -118,7 +118,7 @@ void RenderSVGContainer::paint(PaintInfo > > SVGRenderingContext renderingContext; > bool continueRendering = true; >- if (childPaintInfo.phase == PaintPhaseForeground) { >+ if (childPaintInfo.phase == PaintPhase::Foreground) { > renderingContext.prepareToRenderSVGContent(*this, childPaintInfo); > continueRendering = renderingContext.isRenderingPrepared(); > } >@@ -134,8 +134,8 @@ void RenderSVGContainer::paint(PaintInfo > // to avoid our clip killing our outline rect. Thus we translate our > // outline rect into parent coords before drawing. > // FIXME: This means our focus ring won't share our rotation like it should. >- // We should instead disable our clip during PaintPhaseOutline >- if (paintInfo.phase == PaintPhaseSelfOutline && style().outlineWidth() && style().visibility() == Visibility::Visible) { >+ // We should instead disable our clip during PaintPhase::Outline >+ if (paintInfo.phase == PaintPhase::SelfOutline && style().outlineWidth() && style().visibility() == Visibility::Visible) { > IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRect(repaintRect)); > paintOutline(paintInfo, paintRectInParent); > } >Index: Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp (revision 234514) >+++ Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp (working copy) >@@ -56,7 +56,7 @@ void RenderSVGForeignObject::paint(Paint > if (paintInfo.context().paintingDisabled()) > return; > >- if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection) >+ if (paintInfo.phase != PaintPhase::Foreground && paintInfo.phase != PaintPhase::Selection) > return; > > PaintInfo childPaintInfo(paintInfo); >@@ -67,29 +67,29 @@ void RenderSVGForeignObject::paint(Paint > childPaintInfo.context().clip(m_viewport); > > SVGRenderingContext renderingContext; >- if (paintInfo.phase == PaintPhaseForeground) { >+ if (paintInfo.phase == PaintPhase::Foreground) { > renderingContext.prepareToRenderSVGContent(*this, childPaintInfo); > if (!renderingContext.isRenderingPrepared()) > return; > } > > LayoutPoint childPoint = IntPoint(); >- if (paintInfo.phase == PaintPhaseSelection) { >+ if (paintInfo.phase == PaintPhase::Selection) { > RenderBlock::paint(childPaintInfo, childPoint); > return; > } > > // Paint all phases of FO elements atomically, as though the FO element established its > // own stacking context. >- childPaintInfo.phase = PaintPhaseBlockBackground; >+ childPaintInfo.phase = PaintPhase::BlockBackground; > RenderBlock::paint(childPaintInfo, childPoint); >- childPaintInfo.phase = PaintPhaseChildBlockBackgrounds; >+ childPaintInfo.phase = PaintPhase::ChildBlockBackgrounds; > RenderBlock::paint(childPaintInfo, childPoint); >- childPaintInfo.phase = PaintPhaseFloat; >+ childPaintInfo.phase = PaintPhase::Float; > RenderBlock::paint(childPaintInfo, childPoint); >- childPaintInfo.phase = PaintPhaseForeground; >+ childPaintInfo.phase = PaintPhase::Foreground; > RenderBlock::paint(childPaintInfo, childPoint); >- childPaintInfo.phase = PaintPhaseOutline; >+ childPaintInfo.phase = PaintPhase::Outline; > RenderBlock::paint(childPaintInfo, childPoint); > } > >Index: Source/WebCore/rendering/svg/RenderSVGImage.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGImage.cpp (revision 234514) >+++ Source/WebCore/rendering/svg/RenderSVGImage.cpp (working copy) >@@ -139,7 +139,7 @@ void RenderSVGImage::layout() > > void RenderSVGImage::paint(PaintInfo& paintInfo, const LayoutPoint&) > { >- if (paintInfo.context().paintingDisabled() || paintInfo.phase != PaintPhaseForeground >+ if (paintInfo.context().paintingDisabled() || paintInfo.phase != PaintPhase::Foreground > || style().visibility() == Visibility::Hidden || !imageResource().cachedImage()) > return; > >@@ -151,7 +151,7 @@ void RenderSVGImage::paint(PaintInfo& pa > GraphicsContextStateSaver stateSaver(childPaintInfo.context()); > childPaintInfo.applyTransform(m_localTransform); > >- if (childPaintInfo.phase == PaintPhaseForeground) { >+ if (childPaintInfo.phase == PaintPhase::Foreground) { > SVGRenderingContext renderingContext(*this, childPaintInfo); > > if (renderingContext.isRenderingPrepared()) { >Index: Source/WebCore/rendering/svg/RenderSVGResource.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGResource.cpp (revision 234514) >+++ Source/WebCore/rendering/svg/RenderSVGResource.cpp (working copy) >@@ -51,7 +51,7 @@ static inline RenderSVGResource* request > { > const SVGRenderStyle& svgStyle = style.svgStyle(); > >- bool isRenderingMask = renderer.view().frameView().paintBehavior() & PaintBehaviorRenderingSVGMask; >+ bool isRenderingMask = renderer.view().frameView().paintBehavior().contains(PaintBehavior::RenderingSVGMask); > > // If we have no fill/stroke, return nullptr. > if (mode == RenderSVGResourceMode::ApplyToFill) { >Index: Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp (revision 234514) >+++ Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp (working copy) >@@ -193,8 +193,8 @@ bool RenderSVGResourceClipper::drawConte > // - masker/filter not applied when rendering the children > // - fill is set to the initial fill paint server (solid, black) > // - stroke is set to the initial stroke paint server (none) >- PaintBehavior oldBehavior = view().frameView().paintBehavior(); >- view().frameView().setPaintBehavior(oldBehavior | PaintBehaviorRenderingSVGMask); >+ auto oldBehavior = view().frameView().paintBehavior(); >+ view().frameView().setPaintBehavior(oldBehavior | PaintBehavior::RenderingSVGMask); > > // Draw all clipPath children into a global mask. > for (auto& child : childrenOfType<SVGElement>(clipPathElement())) { >Index: Source/WebCore/rendering/svg/RenderSVGResourceSolidColor.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGResourceSolidColor.cpp (revision 234514) >+++ Source/WebCore/rendering/svg/RenderSVGResourceSolidColor.cpp (working copy) >@@ -39,7 +39,7 @@ bool RenderSVGResourceSolidColor::applyR > > const SVGRenderStyle& svgStyle = style.svgStyle(); > >- bool isRenderingMask = renderer.view().frameView().paintBehavior() & PaintBehaviorRenderingSVGMask; >+ bool isRenderingMask = renderer.view().frameView().paintBehavior().contains(PaintBehavior::RenderingSVGMask); > > if (resourceMode.contains(RenderSVGResourceMode::ApplyToFill)) { > if (!isRenderingMask) >Index: Source/WebCore/rendering/svg/RenderSVGRoot.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGRoot.cpp (revision 234514) >+++ Source/WebCore/rendering/svg/RenderSVGRoot.cpp (working copy) >@@ -215,8 +215,8 @@ void RenderSVGRoot::paintReplaced(PaintI > if (paintInfo.context().paintingDisabled()) > return; > >- // SVG outlines are painted during PaintPhaseForeground. >- if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) >+ // SVG outlines are painted during PaintPhase::Foreground. >+ if (paintInfo.phase == PaintPhase::Outline || paintInfo.phase == PaintPhase::SelfOutline) > return; > > // An empty viewBox also disables rendering. >@@ -228,13 +228,13 @@ void RenderSVGRoot::paintReplaced(PaintI > if (!firstChild()) { > auto* resources = SVGResourcesCache::cachedResourcesForRenderer(*this); > if (!resources || !resources->filter()) { >- if (paintInfo.phase == PaintPhaseForeground) >+ if (paintInfo.phase == PaintPhase::Foreground) > page().addRelevantUnpaintedObject(this, visualOverflowRect()); > return; > } > } > >- if (paintInfo.phase == PaintPhaseForeground) >+ if (paintInfo.phase == PaintPhase::Foreground) > page().addRelevantRepaintedObject(this, visualOverflowRect()); > > // Make a copy of the PaintInfo because applyTransform will modify the damage rect. >@@ -255,7 +255,7 @@ void RenderSVGRoot::paintReplaced(PaintI > { > SVGRenderingContext renderingContext; > bool continueRendering = true; >- if (childPaintInfo.phase == PaintPhaseForeground) { >+ if (childPaintInfo.phase == PaintPhase::Foreground) { > renderingContext.prepareToRenderSVGContent(*this, childPaintInfo); > continueRendering = renderingContext.isRenderingPrepared(); > } >Index: Source/WebCore/rendering/svg/RenderSVGShape.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGShape.cpp (revision 234514) >+++ Source/WebCore/rendering/svg/RenderSVGShape.cpp (working copy) >@@ -296,7 +296,7 @@ void RenderSVGShape::fillStrokeMarkers(P > > void RenderSVGShape::paint(PaintInfo& paintInfo, const LayoutPoint&) > { >- if (paintInfo.context().paintingDisabled() || paintInfo.phase != PaintPhaseForeground >+ if (paintInfo.context().paintingDisabled() || paintInfo.phase != PaintPhase::Foreground > || style().visibility() == Visibility::Hidden || isEmpty()) > return; > FloatRect boundingBox = repaintRectInLocalCoordinates(); >@@ -307,7 +307,7 @@ void RenderSVGShape::paint(PaintInfo& pa > GraphicsContextStateSaver stateSaver(childPaintInfo.context()); > childPaintInfo.applyTransform(m_localTransform); > >- if (childPaintInfo.phase == PaintPhaseForeground) { >+ if (childPaintInfo.phase == PaintPhase::Foreground) { > SVGRenderingContext renderingContext(*this, childPaintInfo); > > if (renderingContext.isRenderingPrepared()) { >Index: Source/WebCore/rendering/svg/RenderSVGText.cpp >=================================================================== >--- Source/WebCore/rendering/svg/RenderSVGText.cpp (revision 234514) >+++ Source/WebCore/rendering/svg/RenderSVGText.cpp (working copy) >@@ -481,8 +481,7 @@ void RenderSVGText::paint(PaintInfo& pai > if (paintInfo.context().paintingDisabled()) > return; > >- if (paintInfo.phase != PaintPhaseForeground >- && paintInfo.phase != PaintPhaseSelection) >+ if (paintInfo.phase != PaintPhase::Foreground && paintInfo.phase != PaintPhase::Selection) > return; > > PaintInfo blockInfo(paintInfo); >@@ -491,8 +490,8 @@ void RenderSVGText::paint(PaintInfo& pai > RenderBlock::paint(blockInfo, LayoutPoint()); > > // Paint the outlines, if any >- if (paintInfo.phase == PaintPhaseForeground) { >- blockInfo.phase = PaintPhaseSelfOutline; >+ if (paintInfo.phase == PaintPhase::Foreground) { >+ blockInfo.phase = PaintPhase::SelfOutline; > RenderBlock::paint(blockInfo, LayoutPoint()); > } > } >Index: Source/WebCore/rendering/svg/SVGInlineFlowBox.cpp >=================================================================== >--- Source/WebCore/rendering/svg/SVGInlineFlowBox.cpp (revision 234514) >+++ Source/WebCore/rendering/svg/SVGInlineFlowBox.cpp (working copy) >@@ -35,7 +35,7 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(SVGInlineFlo > > void SVGInlineFlowBox::paintSelectionBackground(PaintInfo& paintInfo) > { >- ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection); >+ ASSERT(paintInfo.phase == PaintPhase::Foreground || paintInfo.phase == PaintPhase::Selection); > ASSERT(!paintInfo.context().paintingDisabled()); > > PaintInfo childPaintInfo(paintInfo); >@@ -49,7 +49,7 @@ void SVGInlineFlowBox::paintSelectionBac > > void SVGInlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit, LayoutUnit) > { >- ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection); >+ ASSERT(paintInfo.phase == PaintPhase::Foreground || paintInfo.phase == PaintPhase::Selection); > ASSERT(!paintInfo.context().paintingDisabled()); > > SVGRenderingContext renderingContext(renderer(), paintInfo, SVGRenderingContext::SaveGraphicsContext); >Index: Source/WebCore/rendering/svg/SVGInlineTextBox.cpp >=================================================================== >--- Source/WebCore/rendering/svg/SVGInlineTextBox.cpp (revision 234514) >+++ Source/WebCore/rendering/svg/SVGInlineTextBox.cpp (working copy) >@@ -178,7 +178,7 @@ static inline bool textShouldBePainted(c > void SVGInlineTextBox::paintSelectionBackground(PaintInfo& paintInfo) > { > ASSERT(paintInfo.shouldPaintWithinRoot(renderer())); >- ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection); >+ ASSERT(paintInfo.phase == PaintPhase::Foreground || paintInfo.phase == PaintPhase::Selection); > ASSERT(truncation() == cNoTruncation); > > if (renderer().style().visibility() != Visibility::Visible) >@@ -188,7 +188,7 @@ void SVGInlineTextBox::paintSelectionBac > ASSERT(!parentRenderer.document().printing()); > > // Determine whether or not we're selected. >- bool paintSelectedTextOnly = paintInfo.phase == PaintPhaseSelection; >+ bool paintSelectedTextOnly = paintInfo.phase == PaintPhase::Selection; > bool hasSelection = selectionState() != RenderObject::SelectionNone; > if (!hasSelection || paintSelectedTextOnly) > return; >@@ -236,7 +236,7 @@ void SVGInlineTextBox::paintSelectionBac > void SVGInlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit, LayoutUnit) > { > ASSERT(paintInfo.shouldPaintWithinRoot(renderer())); >- ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection); >+ ASSERT(paintInfo.phase == PaintPhase::Foreground || paintInfo.phase == PaintPhase::Selection); > ASSERT(truncation() == cNoTruncation); > > if (renderer().style().visibility() != Visibility::Visible) >@@ -247,8 +247,8 @@ void SVGInlineTextBox::paint(PaintInfo& > > auto& parentRenderer = parent()->renderer(); > >- bool paintSelectedTextOnly = paintInfo.phase == PaintPhaseSelection; >- bool shouldPaintSelectionHighlight = !(paintInfo.paintBehavior & PaintBehaviorSkipSelectionHighlight); >+ bool paintSelectedTextOnly = paintInfo.phase == PaintPhase::Selection; >+ bool shouldPaintSelectionHighlight = !(paintInfo.paintBehavior.contains(PaintBehavior::SkipSelectionHighlight)); > bool hasSelection = !parentRenderer.document().printing() && selectionState() != RenderObject::SelectionNone; > if (!hasSelection && paintSelectedTextOnly) > return; >@@ -277,7 +277,7 @@ void SVGInlineTextBox::paint(PaintInfo& > selectionStyle = &style; > } > >- if (renderer().view().frameView().paintBehavior() & PaintBehaviorRenderingSVGMask) { >+ if (renderer().view().frameView().paintBehavior().contains(PaintBehavior::RenderingSVGMask)) { > hasFill = true; > hasVisibleStroke = false; > } >Index: Source/WebCore/rendering/svg/SVGRenderingContext.cpp >=================================================================== >--- Source/WebCore/rendering/svg/SVGRenderingContext.cpp (revision 234514) >+++ Source/WebCore/rendering/svg/SVGRenderingContext.cpp (working copy) >@@ -43,7 +43,7 @@ namespace WebCore { > > static inline bool isRenderingMaskImage(const RenderObject& object) > { >- return object.view().frameView().paintBehavior() & PaintBehaviorRenderingSVGMask; >+ return object.view().frameView().paintBehavior().contains(PaintBehavior::RenderingSVGMask); > } > > SVGRenderingContext::~SVGRenderingContext() >@@ -285,7 +285,7 @@ void SVGRenderingContext::renderSubtreeT > > // Rendering into a buffer implies we're being used for masking, clipping, patterns or filters. In each of these > // cases we don't want to paint the selection. >- PaintInfo info(image->context(), LayoutRect::infiniteRect(), PaintPhaseForeground, PaintBehaviorSkipSelectionHighlight); >+ PaintInfo info(image->context(), LayoutRect::infiniteRect(), PaintPhase::Foreground, PaintBehavior::SkipSelectionHighlight); > > AffineTransform& contentTransformation = currentContentTransformation(); > AffineTransform savedContentTransformation = contentTransformation; >Index: Source/WebCore/rendering/svg/SVGRootInlineBox.cpp >=================================================================== >--- Source/WebCore/rendering/svg/SVGRootInlineBox.cpp (revision 234514) >+++ Source/WebCore/rendering/svg/SVGRootInlineBox.cpp (working copy) >@@ -51,12 +51,12 @@ RenderSVGText& SVGRootInlineBox::renderS > > void SVGRootInlineBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit, LayoutUnit) > { >- ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection); >+ ASSERT(paintInfo.phase == PaintPhase::Foreground || paintInfo.phase == PaintPhase::Selection); > ASSERT(!paintInfo.context().paintingDisabled()); > > bool isPrinting = renderSVGText().document().printing(); > bool hasSelection = !isPrinting && selectionState() != RenderObject::SelectionNone; >- bool shouldPaintSelectionHighlight = !(paintInfo.paintBehavior & PaintBehaviorSkipSelectionHighlight); >+ bool shouldPaintSelectionHighlight = !(paintInfo.paintBehavior.contains(PaintBehavior::SkipSelectionHighlight)); > > PaintInfo childPaintInfo(paintInfo); > if (hasSelection && shouldPaintSelectionHighlight) { >Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 234566) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,17 @@ >+2018-08-03 Alex Christensen <achristensen@webkit.org> >+ >+ Use enum classes and OptionSets for PaintPhase and PaintBehavior >+ https://bugs.webkit.org/show_bug.cgi?id=188323 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: >+ (WebKit::imageForRect): >+ * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: >+ (WebKit::InjectedBundleRangeHandle::renderedImage): >+ * WebProcess/Plugins/PluginView.cpp: >+ (WebKit::PluginView::shouldCreateTransientPaintingSnapshot const): >+ > 2018-08-03 Alex Christensen <achristensen@webkit.org> > > Fix spelling of "overridden" >Index: Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp >=================================================================== >--- Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp (revision 234514) >+++ Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp (working copy) >@@ -169,13 +169,13 @@ static RefPtr<WebImage> imageForRect(Fra > if (options & SnapshotOptionsExcludeSelectionHighlighting) > shouldPaintSelection = FrameView::ExcludeSelection; > >- PaintBehavior paintBehavior = frameView->paintBehavior() | (PaintBehaviorFlattenCompositingLayers | PaintBehaviorSnapshotting); >+ auto paintBehavior = frameView->paintBehavior() | PaintBehavior::FlattenCompositingLayers | PaintBehavior::Snapshotting; > if (options & SnapshotOptionsForceBlackText) >- paintBehavior |= PaintBehaviorForceBlackText; >+ paintBehavior |= PaintBehavior::ForceBlackText; > if (options & SnapshotOptionsForceWhiteText) >- paintBehavior |= PaintBehaviorForceWhiteText; >+ paintBehavior |= PaintBehavior::ForceWhiteText; > >- PaintBehavior oldPaintBehavior = frameView->paintBehavior(); >+ auto oldPaintBehavior = frameView->paintBehavior(); > frameView->setPaintBehavior(paintBehavior); > frameView->paintContentsForSnapshot(*graphicsContext.get(), paintingRect, shouldPaintSelection, FrameView::DocumentCoordinates); > frameView->setPaintBehavior(oldPaintBehavior); >Index: Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp >=================================================================== >--- Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp (revision 234514) >+++ Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp (working copy) >@@ -150,12 +150,12 @@ RefPtr<WebImage> InjectedBundleRangeHand > > graphicsContext->translate(-paintRect.location()); > >- PaintBehavior oldPaintBehavior = frameView->paintBehavior(); >- PaintBehavior paintBehavior = oldPaintBehavior | PaintBehaviorSelectionOnly | PaintBehaviorFlattenCompositingLayers | PaintBehaviorSnapshotting; >+ OptionSet<PaintBehavior> oldPaintBehavior = frameView->paintBehavior(); >+ OptionSet<PaintBehavior> paintBehavior = oldPaintBehavior | PaintBehavior::SelectionOnly | PaintBehavior::FlattenCompositingLayers | PaintBehavior::Snapshotting; > if (options & SnapshotOptionsForceBlackText) >- paintBehavior |= PaintBehaviorForceBlackText; >+ paintBehavior |= PaintBehavior::ForceBlackText; > if (options & SnapshotOptionsForceWhiteText) >- paintBehavior |= PaintBehaviorForceWhiteText; >+ paintBehavior |= PaintBehavior::ForceWhiteText; > > frameView->setPaintBehavior(paintBehavior); > ownerDocument.updateLayout(); >Index: Source/WebKit/WebProcess/Plugins/PluginView.cpp >=================================================================== >--- Source/WebKit/WebProcess/Plugins/PluginView.cpp (revision 234514) >+++ Source/WebKit/WebProcess/Plugins/PluginView.cpp (working copy) >@@ -1847,7 +1847,7 @@ bool PluginView::shouldCreateTransientPa > return false; > > if (FrameView* frameView = frame()->view()) { >- if (frameView->paintBehavior() & (PaintBehaviorSelectionOnly | PaintBehaviorSelectionAndBackgroundsOnly | PaintBehaviorForceBlackText)) { >+ if (frameView->paintBehavior().contains(OptionSet<PaintBehavior>(PaintBehavior::SelectionOnly) | PaintBehavior::SelectionAndBackgroundsOnly | PaintBehavior::ForceBlackText)) { > // This paint behavior is used when drawing the find indicator and there's no need to > // snapshot plug-ins, because they can never be painted as part of the find indicator. > return false; >Index: Source/WebKitLegacy/mac/ChangeLog >=================================================================== >--- Source/WebKitLegacy/mac/ChangeLog (revision 234514) >+++ Source/WebKitLegacy/mac/ChangeLog (working copy) >@@ -1,3 +1,19 @@ >+2018-08-03 Alex Christensen <achristensen@webkit.org> >+ >+ Use enum classes and OptionSets for PaintPhase and PaintBehavior >+ https://bugs.webkit.org/show_bug.cgi?id=188323 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebCoreSupport/WebContextMenuClient.mm: >+ (WebContextMenuClient::imageForCurrentSharingServicePickerItem): >+ * WebView/WebFrame.mm: >+ (-[WebFrame _paintBehaviorForDestinationContext:]): >+ (-[WebFrame _drawRect:contentsOnly:]): >+ * WebView/WebHTMLView.mm: >+ (imageFromRect): >+ (selectionImage): >+ > 2018-08-01 Nan Wang <n_wang@apple.com> > > AX: AOM: Add ARIA IDL Attribute Reflection >Index: Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm >=================================================================== >--- Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm (revision 234514) >+++ Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm (working copy) >@@ -213,8 +213,8 @@ RetainPtr<NSImage> WebContextMenuClient: > RefPtr<Range> range = Range::create(node->document(), Position(node, Position::PositionIsBeforeAnchor), Position(node, Position::PositionIsAfterAnchor)); > frameView->frame().selection().setSelection(VisibleSelection(*range), FrameSelection::DoNotSetFocus); > >- PaintBehavior oldPaintBehavior = frameView->paintBehavior(); >- frameView->setPaintBehavior(PaintBehaviorSelectionOnly); >+ OptionSet<PaintBehavior> oldPaintBehavior = frameView->paintBehavior(); >+ frameView->setPaintBehavior(PaintBehavior::SelectionOnly); > > buffer->context().translate(-toFloatSize(rect.location())); > frameView->paintContents(buffer->context(), roundedIntRect(rect)); >Index: Source/WebKitLegacy/mac/WebView/WebFrame.mm >=================================================================== >--- Source/WebKitLegacy/mac/WebView/WebFrame.mm (revision 234514) >+++ Source/WebKitLegacy/mac/WebView/WebFrame.mm (working copy) >@@ -591,30 +591,30 @@ - (NSString *)_stringForRange:(DOMRange > return plainText(core(range), TextIteratorDefaultBehavior, true); > } > >-- (PaintBehavior)_paintBehaviorForDestinationContext:(CGContextRef)context >+- (OptionSet<PaintBehavior>)_paintBehaviorForDestinationContext:(CGContextRef)context > { > #if PLATFORM(MAC) > // -currentContextDrawingToScreen returns YES for bitmap contexts. > BOOL isPrinting = ![NSGraphicsContext currentContextDrawingToScreen]; > if (isPrinting) >- return PaintBehaviorFlattenCompositingLayers | PaintBehaviorSnapshotting; >+ return OptionSet<PaintBehavior>(PaintBehavior::FlattenCompositingLayers) | PaintBehavior::Snapshotting; > #endif > > if (CGContextGetType(context) != kCGContextTypeBitmap) >- return PaintBehaviorNormal; >+ return PaintBehavior::Normal; > > // If we're drawing into a bitmap, we could be snapshotting or drawing into a layer-backed view. > if (WebHTMLView *documentView = [self _webHTMLDocumentView]) { > #if PLATFORM(IOS) >- return [[documentView window] isInSnapshottingPaint] ? PaintBehaviorSnapshotting : PaintBehaviorNormal; >+ return [[documentView window] isInSnapshottingPaint] ? PaintBehavior::Snapshotting : PaintBehavior::Normal; > #endif > #if PLATFORM(MAC) > if ([documentView _web_isDrawingIntoLayer]) >- return PaintBehaviorNormal; >+ return PaintBehavior::Normal; > #endif > } > >- return PaintBehaviorFlattenCompositingLayers | PaintBehaviorSnapshotting; >+ return OptionSet<PaintBehavior>(PaintBehavior::FlattenCompositingLayers) | PaintBehavior::Snapshotting; > } > > - (void)_drawRect:(NSRect)rect contentsOnly:(BOOL)contentsOnly >@@ -642,20 +642,20 @@ - (void)_drawRect:(NSRect)rect contentsO > > FrameView* view = _private->coreFrame->view(); > >- PaintBehavior oldBehavior = view->paintBehavior(); >- PaintBehavior paintBehavior = oldBehavior; >+ OptionSet<PaintBehavior> oldBehavior = view->paintBehavior(); >+ OptionSet<PaintBehavior> paintBehavior = oldBehavior; > > if (Frame* parentFrame = _private->coreFrame->tree().parent()) { > // For subframes, we need to inherit the paint behavior from our parent > if (FrameView* parentView = parentFrame ? parentFrame->view() : nullptr) { >- if (parentView->paintBehavior() & PaintBehaviorFlattenCompositingLayers) >- paintBehavior |= PaintBehaviorFlattenCompositingLayers; >+ if (parentView->paintBehavior().contains(PaintBehavior::FlattenCompositingLayers)) >+ paintBehavior |= PaintBehavior::FlattenCompositingLayers; > >- if (parentView->paintBehavior() & PaintBehaviorSnapshotting) >- paintBehavior |= PaintBehaviorSnapshotting; >+ if (parentView->paintBehavior().contains(PaintBehavior::Snapshotting)) >+ paintBehavior |= PaintBehavior::Snapshotting; > >- if (parentView->paintBehavior() & PaintBehaviorTileFirstPaint) >- paintBehavior |= PaintBehaviorTileFirstPaint; >+ if (parentView->paintBehavior().contains(PaintBehavior::TileFirstPaint)) >+ paintBehavior |= PaintBehavior::TileFirstPaint; > } > } else > paintBehavior |= [self _paintBehaviorForDestinationContext:ctx]; >Index: Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >=================================================================== >--- Source/WebKitLegacy/mac/WebView/WebHTMLView.mm (revision 234514) >+++ Source/WebKitLegacy/mac/WebView/WebHTMLView.mm (working copy) >@@ -7011,8 +7011,8 @@ static CGImageRef imageFromRect(Frame* f > > WebHTMLView *view = (WebHTMLView *)documentView; > >- PaintBehavior oldPaintBehavior = frame->view()->paintBehavior(); >- frame->view()->setPaintBehavior(oldPaintBehavior | PaintBehaviorFlattenCompositingLayers | PaintBehaviorSnapshotting); >+ OptionSet<PaintBehavior> oldPaintBehavior = frame->view()->paintBehavior(); >+ frame->view()->setPaintBehavior(oldPaintBehavior | PaintBehavior::FlattenCompositingLayers | PaintBehavior::Snapshotting); > > BEGIN_BLOCK_OBJC_EXCEPTIONS; > >@@ -7067,10 +7067,10 @@ static CGImageRef imageFromRect(Frame* f > static CGImageRef selectionImage(Frame* frame, bool forceBlackText) > { > ASSERT(!WebThreadIsEnabled() || WebThreadIsLocked()); >- frame->view()->setPaintBehavior(PaintBehaviorSelectionOnly | (forceBlackText ? PaintBehaviorForceBlackText : 0)); >+ frame->view()->setPaintBehavior(PaintBehavior::SelectionOnly | (forceBlackText ? PaintBehavior::ForceBlackText : 0)); > frame->document()->updateLayout(); > CGImageRef result = imageFromRect(frame, frame->selection().selectionBounds()); >- frame->view()->setPaintBehavior(PaintBehaviorNormal); >+ frame->view()->setPaintBehavior(PaintBehavior::Normal); > return result; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188323
:
346568
|
346573
|
346576
|
346637
|
346641