#include "third_party/blink/renderer/core/paint/paint_property_tree_builder_test.h"
#include "cc/test/fake_layer_tree_host_client.h"
#include "cc/trees/effect_node.h"
#include "cc/trees/scroll_node.h"
#include "cc/trees/transform_node.h"
#include "third_party/blink/renderer/core/frame/frame_test_helpers.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/html/html_iframe_element.h"
#include "third_party/blink/renderer/core/layout/layout_flow_thread.h"
#include "third_party/blink/renderer/core/layout/layout_image.h"
#include "third_party/blink/renderer/core/layout/layout_multi_column_flow_thread.h"
#include "third_party/blink/renderer/core/layout/layout_tree_as_text.h"
#include "third_party/blink/renderer/core/layout/physical_box_fragment.h"
#include "third_party/blink/renderer/core/layout/svg/layout_svg_root.h"
#include "third_party/blink/renderer/core/paint/fragment_data_iterator.h"
#include "third_party/blink/renderer/core/paint/object_paint_properties.h"
#include "third_party/blink/renderer/core/paint/paint_property_tree_printer.h"
#include "third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h"
#include "third_party/blink/renderer/platform/graphics/paint/geometry_mapper.h"
#include "third_party/blink/renderer/platform/testing/layer_tree_host_embedder.h"
#include "third_party/blink/renderer/platform/testing/paint_property_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/testing_platform_support.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#include "ui/gfx/geometry/test/geometry_util.h"
namespace blink {
void PaintPropertyTreeBuilderTest::LoadTestData(const char* file_name) { … }
const TransformPaintPropertyNode*
PaintPropertyTreeBuilderTest::DocPreTranslation(const Document* document) { … }
const TransformPaintPropertyNode*
PaintPropertyTreeBuilderTest::DocScrollTranslation(const Document* document) { … }
const ClipPaintPropertyNode* PaintPropertyTreeBuilderTest::DocContentClip(
const Document* document) { … }
const ScrollPaintPropertyNode* PaintPropertyTreeBuilderTest::DocScroll(
const Document* document) { … }
const ObjectPaintProperties*
PaintPropertyTreeBuilderTest::PaintPropertiesForElement(const char* name) { … }
const GeometryMapperTransformCache&
PaintPropertyTreeBuilderTest::GetTransformCache(
const TransformPaintPropertyNode& transform) { … }
void PaintPropertyTreeBuilderTest::SetUp() { … }
#define CHECK_VISUAL_RECT(expected, source_object, ancestor, slop_factor) …
#define CHECK_EXACT_VISUAL_RECT(expected, source_object, ancestor) …
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(PaintPropertyTreeBuilderTest, FixedPosition) { … }
TEST_P(PaintPropertyTreeBuilderTest, PositionAndScroll) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverflowScrollExcludeScrollbars) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverlapNoPaintOffsetTranslation) { … }
TEST_P(PaintPropertyTreeBuilderTest, AssumeOverlapNoPaintOffsetTranslation) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverflowScrollExcludeScrollbarsSubpixel) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverflowScrollExcludeCssOverlayScrollbar) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverflowScrollVerticalRL) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverflowScrollRTL) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverflowScrollVerticalRLMulticol) { … }
TEST_P(PaintPropertyTreeBuilderTest, DocScrollingTraditional) { … }
TEST_P(PaintPropertyTreeBuilderTest, Perspective) { … }
TEST_P(PaintPropertyTreeBuilderTest, Transform) { … }
TEST_P(PaintPropertyTreeBuilderTest, Preserve3D3DTransformedDescendant) { … }
TEST_P(PaintPropertyTreeBuilderTest, Perspective3DTransformedDescendant) { … }
TEST_P(PaintPropertyTreeBuilderTest,
TransformPerspective3DTransformedDescendant) { … }
TEST_P(PaintPropertyTreeBuilderTest,
TransformNodeWithActiveAnimationHasDirectCompositingReason) { … }
TEST_P(PaintPropertyTreeBuilderTest,
TransformAnimationDoesNotCreateEffectAndFilterNodes) { … }
TEST_P(PaintPropertyTreeBuilderTest,
OpacityAnimationDoesNotCreateTransformAndFilterNodes) { … }
TEST_P(PaintPropertyTreeBuilderTest,
EffectNodeWithActiveAnimationHasDirectCompositingReason) { … }
TEST_P(PaintPropertyTreeBuilderTest, WillChangeTransform) { … }
TEST_P(PaintPropertyTreeBuilderTest, WillChangeContents) { … }
TEST_P(PaintPropertyTreeBuilderTest,
BackfaceVisibilityWithPseudoStacking3DChildren) { … }
TEST_P(PaintPropertyTreeBuilderTest, NoEffectAndFilterForNonStackingContext) { … }
TEST_P(PaintPropertyTreeBuilderTest, RelativePositionInline) { … }
TEST_P(PaintPropertyTreeBuilderTest, NestedOpacityEffect) { … }
TEST_P(PaintPropertyTreeBuilderTest, TransformNodeDoesNotAffectEffectNodes) { … }
TEST_P(PaintPropertyTreeBuilderTest, EffectNodesAcrossStackingContext) { … }
TEST_P(PaintPropertyTreeBuilderTest, EffectNodesInSVG) { … }
TEST_P(PaintPropertyTreeBuilderTest, EffectNodesAcrossHTMLSVGBoundary) { … }
TEST_P(PaintPropertyTreeBuilderTest, EffectNodesAcrossSVGHTMLBoundary) { … }
TEST_P(PaintPropertyTreeBuilderTest, TransformNodesInSVG) { … }
TEST_P(PaintPropertyTreeBuilderTest, SVGViewBoxTransform) { … }
TEST_P(PaintPropertyTreeBuilderTest, SVGRootPaintOffsetTransformNode) { … }
TEST_P(PaintPropertyTreeBuilderTest, SVGRootLocalToBorderBoxTransformNode) { … }
TEST_P(PaintPropertyTreeBuilderTest, SVGNestedViewboxTransforms) { … }
TEST_P(PaintPropertyTreeBuilderTest, TransformNodesAcrossSVGHTMLBoundary) { … }
TEST_P(PaintPropertyTreeBuilderTest, ForeignObjectWithTransformAndOffset) { … }
TEST_P(PaintPropertyTreeBuilderTest, ForeignObjectWithMask) { … }
TEST_P(PaintPropertyTreeBuilderTest, PaintOffsetTranslationSVGHTMLBoundary) { … }
TEST_P(PaintPropertyTreeBuilderTest, SVGViewportContainer) { … }
TEST_P(PaintPropertyTreeBuilderTest, SVGForeignObjectOverflowClip) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverflowClipWithEmptyVisualOverflow) { … }
TEST_P(PaintPropertyTreeBuilderTest,
PaintOffsetTranslationSVGHTMLBoundaryMulticol) { … }
TEST_P(PaintPropertyTreeBuilderTest,
FixedTransformAncestorAcrossSVGHTMLBoundary) { … }
TEST_P(PaintPropertyTreeBuilderTest, ControlClip) { … }
TEST_P(PaintPropertyTreeBuilderTest, ControlClipInsideForeignObject) { … }
TEST_P(PaintPropertyTreeBuilderTest, BorderRadiusClip) { … }
TEST_P(PaintPropertyTreeBuilderTest, SubpixelBorderRadiusClip) { … }
TEST_P(PaintPropertyTreeBuilderTest, TransformNodesAcrossSubframes) { … }
TEST_P(PaintPropertyTreeBuilderTest, FramesEstablishIsolation) { … }
TEST_P(PaintPropertyTreeBuilderTest, TransformNodesInTransformedSubframes) { … }
TEST_P(PaintPropertyTreeBuilderTest, TreeContextClipByNonStackingContext) { … }
TEST_P(PaintPropertyTreeBuilderTest,
TreeContextUnclipFromParentStackingContext) { … }
TEST_P(PaintPropertyTreeBuilderTest, TableCellLayoutLocation) { … }
TEST_P(PaintPropertyTreeBuilderTest, CSSClipFixedPositionDescendant) { … }
TEST_P(PaintPropertyTreeBuilderTest, CSSClipAbsPositionDescendant) { … }
TEST_P(PaintPropertyTreeBuilderTest, CSSClipSubpixel) { … }
TEST_P(PaintPropertyTreeBuilderTest, CSSClipFixedPositionDescendantNonShared) { … }
TEST_P(PaintPropertyTreeBuilderTest, ColumnSpannerUnderRelativePositioned) { … }
TEST_P(PaintPropertyTreeBuilderTest, FractionalPaintOffset) { … }
TEST_P(PaintPropertyTreeBuilderTest, PaintOffsetWithBasicPixelSnapping) { … }
TEST_P(PaintPropertyTreeBuilderTest,
PaintOffsetWithPixelSnappingThroughTransform) { … }
TEST_P(PaintPropertyTreeBuilderTest,
NonTranslationTransformShouldResetSubpixelPaintOffset) { … }
TEST_P(PaintPropertyTreeBuilderTest,
WillChangeTransformShouldResetSubpixelPaintOffset) { … }
TEST_P(PaintPropertyTreeBuilderTest,
TransformAnimationShouldResetSubpixelPaintOffset) { … }
TEST_P(PaintPropertyTreeBuilderTest,
PaintOffsetWithPixelSnappingThroughMultipleTransforms) { … }
TEST_P(PaintPropertyTreeBuilderTest, PaintOffsetWithPixelSnappingWithFixedPos) { … }
TEST_P(PaintPropertyTreeBuilderTest, SvgPixelSnappingShouldResetPaintOffset) { … }
TEST_P(PaintPropertyTreeBuilderTest, SvgRootAndForeignObjectPixelSnapping) { … }
TEST_P(PaintPropertyTreeBuilderTest, NoRenderingContextByDefault) { … }
TEST_P(PaintPropertyTreeBuilderTest, Preserve3DCreatesSharedRenderingContext) { … }
TEST_P(PaintPropertyTreeBuilderTest,
IntermediateElementPreventsSharedRenderingContext) { … }
TEST_P(PaintPropertyTreeBuilderTest,
IntermediateElementWithPropertiesPreventsSharedRenderingContext) { … }
TEST_P(PaintPropertyTreeBuilderTest, FlatTransformStyleEndsRenderingContext) { … }
TEST_P(PaintPropertyTreeBuilderTest, NestedRenderingContexts) { … }
static bool SomeNodeFlattensTransform(
const TransformPaintPropertyNode* node,
const TransformPaintPropertyNode* ancestor) { … }
TEST_P(PaintPropertyTreeBuilderTest, FlatTransformStylePropagatesToChildren) { … }
TEST_P(PaintPropertyTreeBuilderTest,
Preserve3DTransformStylePropagatesToChildren) { … }
TEST_P(PaintPropertyTreeBuilderTest, PerspectiveIsNotFlattened) { … }
TEST_P(PaintPropertyTreeBuilderTest, FlatteningIn3DContext) { … }
TEST_P(PaintPropertyTreeBuilderTest,
PerspectiveDoesNotEstablishRenderingContext) { … }
TEST_P(PaintPropertyTreeBuilderTest, CachedProperties) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverflowClipContentsTreeState) { … }
TEST_P(PaintPropertyTreeBuilderTest, ReplacedSvgContentWithIsolation) { … }
TEST_P(PaintPropertyTreeBuilderTest, ReplacedContentTransformFlattening) { … }
TEST_P(PaintPropertyTreeBuilderTest, ContainPaintOrStyleLayoutTreeState) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverflowScrollContentsTreeState) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverflowScrollWithRoundedRect) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverflowScrollWithSubpixelBorder) { … }
TEST_P(PaintPropertyTreeBuilderTest, CssClipContentsTreeState) { … }
TEST_P(PaintPropertyTreeBuilderTest,
ReplacedContentTransformContentsTreeState) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverflowHiddenScrollProperties) { … }
TEST_P(PaintPropertyTreeBuilderTest, FrameOverflowHiddenScrollProperties) { … }
TEST_P(PaintPropertyTreeBuilderTest, NestedScrollProperties) { … }
TEST_P(PaintPropertyTreeBuilderTest, PositionedScrollerIsNotNested) { … }
TEST_P(PaintPropertyTreeBuilderTest, NestedPositionedScrollProperties) { … }
TEST_P(PaintPropertyTreeBuilderTest, SVGRootClip) { … }
TEST_P(PaintPropertyTreeBuilderTest, SVGRootNoClip) { … }
TEST_P(PaintPropertyTreeBuilderTest, MainThreadScrollReasonsWithoutScrolling) { … }
TEST_P(PaintPropertyTreeBuilderTest, PaintOffsetsUnderMultiColumnScrolled) { … }
TEST_P(PaintPropertyTreeBuilderTest,
PaintOffsetsUnderMultiColumnWithVisualOverflow) { … }
TEST_P(PaintPropertyTreeBuilderTest,
PaintOffsetsUnderMultiColumnWithScrollableOverflow) { … }
TEST_P(PaintPropertyTreeBuilderTest, SpanFragmentsLimitedToSize) { … }
TEST_P(PaintPropertyTreeBuilderTest,
PaintOffsetUnderMulticolumnScrollFixedPos) { … }
TEST_P(PaintPropertyTreeBuilderTest, FragmentsUnderMultiColumn) { … }
TEST_P(PaintPropertyTreeBuilderTest,
FragmentsUnderMultiColumnVerticalRLWithOverflow) { … }
TEST_P(PaintPropertyTreeBuilderTest, LayerUnderOverflowClipUnderMultiColumn) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverflowClipUnderMultiColumn) { … }
TEST_P(PaintPropertyTreeBuilderTest, CompositedUnderMultiColumn) { … }
TEST_P(PaintPropertyTreeBuilderTest,
MultiColumnInlineRelativeAndSpannerAndAbsPos) { … }
TEST_P(PaintPropertyTreeBuilderTest, FrameUnderMulticol) { … }
TEST_P(PaintPropertyTreeBuilderTest, CompositedMulticolFrameUnderMulticol) { … }
TEST_P(PaintPropertyTreeBuilderTest, BecomingUnfragmented) { … }
TEST_P(PaintPropertyTreeBuilderTest, Reflection) { … }
TEST_P(PaintPropertyTreeBuilderTest, SimpleFilter) { … }
TEST_P(PaintPropertyTreeBuilderTest, PixelMovingFilter) { … }
TEST_P(PaintPropertyTreeBuilderTest, SimpleFilterWithWillChangeTransform) { … }
TEST_P(PaintPropertyTreeBuilderTest, WillChangeFilterCreatesClipExpander) { … }
TEST_P(PaintPropertyTreeBuilderTest, FilterReparentClips) { … }
TEST_P(PaintPropertyTreeBuilderTest, TransformOriginWithAndWithoutTransform) { … }
TEST_P(PaintPropertyTreeBuilderTest, TransformOriginWithAndWithoutMotionPath) { … }
TEST_P(PaintPropertyTreeBuilderTest, ChangePositionUpdateDescendantProperties) { … }
TEST_P(PaintPropertyTreeBuilderTest,
TransformNodeNotAnimatedStillHasCompositorElementId) { … }
TEST_P(PaintPropertyTreeBuilderTest,
EffectNodeNotAnimatedStillHasCompositorElementId) { … }
TEST_P(PaintPropertyTreeBuilderTest,
TransformNodeAnimatedHasCompositorElementId) { … }
TEST_P(PaintPropertyTreeBuilderTest, EffectNodeAnimatedHasCompositorElementId) { … }
TEST_P(PaintPropertyTreeBuilderTest, FloatUnderInline) { … }
TEST_P(PaintPropertyTreeBuilderTest, ScrollNodeHasCompositorElementId) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverflowClipSubpixelPosition) { … }
TEST_P(PaintPropertyTreeBuilderTest, MaskSimple) { … }
TEST_P(PaintPropertyTreeBuilderTest, MaskWithOutset) { … }
TEST_P(PaintPropertyTreeBuilderTest, MaskEscapeClip) { … }
TEST_P(PaintPropertyTreeBuilderTest, MaskInline) { … }
TEST_P(PaintPropertyTreeBuilderTest, SVGResource) { … }
TEST_P(PaintPropertyTreeBuilderTest, SVGHiddenResource) { … }
TEST_P(PaintPropertyTreeBuilderTest, SVGBlending) { … }
TEST_P(PaintPropertyTreeBuilderTest, SVGRootBlending) { … }
TEST_P(PaintPropertyTreeBuilderTest, ScrollBoundsOffset) { … }
TEST_P(PaintPropertyTreeBuilderTest, BackfaceHidden) { … }
TEST_P(PaintPropertyTreeBuilderTest, FrameBorderRadius) { … }
TEST_P(PaintPropertyTreeBuilderTest, NoPropertyForSVGTextWithReflection) { … }
TEST_P(PaintPropertyTreeBuilderTest, ImageBorderRadius) { … }
TEST_P(PaintPropertyTreeBuilderTest, FrameClipWhenPrinting) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverflowControlsClip) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverflowControlsClipSubpixel) { … }
TEST_P(PaintPropertyTreeBuilderTest, FragmentPaintOffsetUnderOverflowScroll) { … }
TEST_P(PaintPropertyTreeBuilderTest, SVGRootWithMask) { … }
TEST_P(PaintPropertyTreeBuilderTest, SVGRootWithCSSMask) { … }
TEST_P(PaintPropertyTreeBuilderTest, ElementCaptureEffectNode) { … }
TEST_P(PaintPropertyTreeBuilderTest, ClearClipPathEffectNode) { … }
TEST_P(PaintPropertyTreeBuilderTest, EmptyClipPathSubpixelOffset) { … }
TEST_P(PaintPropertyTreeBuilderTest, EmptyMaskSubpixelOffset) { … }
TEST_P(PaintPropertyTreeBuilderTest, RootHasCompositedScrolling) { … }
TEST_P(PaintPropertyTreeBuilderTest, IframeDoesNotRequireCompositedScrolling) { … }
TEST_P(PaintPropertyTreeBuilderTest, ClipHitTestChangeDoesNotCauseFullRepaint) { … }
TEST_P(PaintPropertyTreeBuilderTest, ClipPathInheritanceWithoutMutation) { … }
TEST_P(PaintPropertyTreeBuilderTest, CompositedLayerSkipsFragmentClip) { … }
TEST_P(PaintPropertyTreeBuilderTest, CompositedLayerUnderClipUnderMulticol) { … }
TEST_P(PaintPropertyTreeBuilderTest, RepeatingFixedPositionInPagedMedia) { … }
TEST_P(PaintPropertyTreeBuilderTest,
RepeatingFixedPositionWithTransformInPagedMedia) { … }
TEST_P(PaintPropertyTreeBuilderTest,
FloatPaintOffsetInContainerWithScrollbars) { … }
TEST_P(PaintPropertyTreeBuilderTest, PaintOffsetForTextareaWithResizer) { … }
TEST_P(PaintPropertyTreeBuilderTest, SubpixelPositionedScrollNode) { … }
TEST_P(PaintPropertyTreeBuilderTest,
LayoutMenuListHasOverlowAndLocalBorderBoxProperties) { … }
TEST_P(PaintPropertyTreeBuilderTest, EmptyClipFragments) { … }
TEST_P(PaintPropertyTreeBuilderTest, StickyConstraintChain) { … }
TEST_P(PaintPropertyTreeBuilderTest, StickyUnderOverflowHidden) { … }
TEST_P(PaintPropertyTreeBuilderTest, StickyUnderScrollerWithoutOverflow) { … }
TEST_P(PaintPropertyTreeBuilderTest, WillChangeOpacityInducesAnEffectNode) { … }
TEST_P(PaintPropertyTreeBuilderTest, EffectOutputClipWithFixedDescendant) { … }
TEST_P(PaintPropertyTreeBuilderTest, TableColOpacity) { … }
TEST_P(PaintPropertyTreeBuilderTest, MainFrameDoesntClipContent) { … }
TEST_P(PaintPropertyTreeBuilderTest, SVGRootCompositedClipPathSimple) { … }
TEST_P(PaintPropertyTreeBuilderTest, SVGRootCompositedClipPathComplex) { … }
TEST_P(PaintPropertyTreeBuilderTest, SimpleOpacityChangeDoesNotCausePacUpdate) { … }
TEST_P(PaintPropertyTreeBuilderTest, SimpleScrollChangeDoesNotCausePacUpdate) { … }
TEST_P(PaintPropertyTreeBuilderTest,
SimpleStickyTranslationChangeDoesNotCausePacUpdate) { … }
TEST_P(PaintPropertyTreeBuilderTest,
NonCompositedTransformChangeCausesPacUpdate) { … }
TEST_P(PaintPropertyTreeBuilderTest, VideoClipRect) { … }
#define ALL_PROPERTY_STYLES …
TEST_P(PaintPropertyTreeBuilderTest, NoPaintPropertyForBlockText) { … }
TEST_P(PaintPropertyTreeBuilderTest, NoPaintPropertyForInlineText) { … }
TEST_P(PaintPropertyTreeBuilderTest, NoPaintPropertyForSVGText) { … }
TEST_P(PaintPropertyTreeBuilderTest, IsAffectedByOuterViewportBoundsDelta) { … }
TEST_P(PaintPropertyTreeBuilderTest, TransformAnimationAxisAlignment) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverflowScrollPropertyHierarchy) { … }
TEST_P(PaintPropertyTreeBuilderTest, CompositedInline) { … }
TEST_P(PaintPropertyTreeBuilderTest, OutOfFlowContainedInMulticol) { … }
TEST_P(PaintPropertyTreeBuilderTest, SVGChildBackdropFilter) { … }
TEST_P(PaintPropertyTreeBuilderTest, SVGTransformAnimationAndOrigin) { … }
TEST_P(PaintPropertyTreeBuilderTest, WillChangeBackdropFilter) { … }
TEST_P(PaintPropertyTreeBuilderTest,
WillChangeBackdropFilterWithTransformAndFilter) { … }
TEST_P(PaintPropertyTreeBuilderTest, WillChangeFilter) { … }
TEST_P(PaintPropertyTreeBuilderTest, WillChangeFilterWithTransformAndOpacity) { … }
TEST_P(PaintPropertyTreeBuilderTest, EffectCanUseCurrentClipAsOutputClipCrash) { … }
TEST_P(PaintPropertyTreeBuilderTest, EffectOutputClipOfMissedOutOfFlow) { … }
TEST_P(PaintPropertyTreeBuilderTest, TransformChangesInvalidateGeometryMapper) { … }
TEST_P(PaintPropertyTreeBuilderTest,
GeometryMapperCacheInvalidationAcrossIsolationNodes) { … }
TEST_P(PaintPropertyTreeBuilderTest, PromoteTrivial3DWithHighEndDevice) { … }
TEST_P(PaintPropertyTreeBuilderTest, DontPromoteTrivial3DWithLowEndDevice) { … }
#define EXPECT_BACKGROUND_CLIP(properties, rect) …
TEST_P(PaintPropertyTreeBuilderTest, BackgroundClip) { … }
TEST_P(PaintPropertyTreeBuilderTest, BackgroundClipFragmented) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverlayScrollbarEffects) { … }
TEST_P(PaintPropertyTreeBuilderTest, OverlayScrollbarEffectsWithRadius) { … }
}