chromium/third_party/blink/renderer/core/css/resolver/style_resolver_test.cc

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/frame/user_activation_notification_type.mojom-blink.h"
#include "third_party/blink/public/web/web_print_page_description.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_cssnumericvalue_double.h"
#include "third_party/blink/renderer/core/animation/animation_test_helpers.h"
#include "third_party/blink/renderer/core/animation/document_timeline.h"
#include "third_party/blink/renderer/core/animation/element_animations.h"
#include "third_party/blink/renderer/core/css/cascade_layer_map.h"
#include "third_party/blink/renderer/core/css/css_flip_revert_value.h"
#include "third_party/blink/renderer/core/css/css_image_set_value.h"
#include "third_party/blink/renderer/core/css/css_image_value.h"
#include "third_party/blink/renderer/core/css/css_test_helpers.h"
#include "third_party/blink/renderer/core/css/css_value_list.h"
#include "third_party/blink/renderer/core/css/out_of_flow_data.h"
#include "third_party/blink/renderer/core/css/parser/css_parser_local_context.h"
#include "third_party/blink/renderer/core/css/post_style_update_scope.h"
#include "third_party/blink/renderer/core/css/properties/computed_style_utils.h"
#include "third_party/blink/renderer/core/css/properties/css_property_ref.h"
#include "third_party/blink/renderer/core/css/properties/longhands.h"
#include "third_party/blink/renderer/core/css/resolver/scoped_style_resolver.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver_state.h"
#include "third_party/blink/renderer/core/css/style_change_reason.h"
#include "third_party/blink/renderer/core/css/style_engine.h"
#include "third_party/blink/renderer/core/css/style_sheet_contents.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/dom/pseudo_element.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/dom/text.h"
#include "third_party/blink/renderer/core/execution_context/security_context.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/fullscreen/fullscreen.h"
#include "third_party/blink/renderer/core/html/html_dialog_element.h"
#include "third_party/blink/renderer/core/html/html_style_element.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/style/anchor_specifier_value.h"
#include "third_party/blink/renderer/core/style/computed_style_constants.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/geometry/calculation_value.h"
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"

namespace blink {

CreateSimpleKeyframeEffectForTest;

class StyleResolverTest : public PageTestBase {};

class StyleResolverTestCQ : public StyleResolverTest {};

TEST_F(StyleResolverTest, StyleForTextInDisplayNone) {}

TEST_F(StyleResolverTest, AnimationBaseComputedStyle) {}

TEST_F(StyleResolverTest, HasEmUnits) {}

TEST_F(StyleResolverTest, BaseReusableIfFontRelativeUnitsAbsent) {}

TEST_F(StyleResolverTest, AnimationNotMaskedByImportant) {}

TEST_F(StyleResolverTest, AnimationNotMaskedWithoutElementAnimations) {}

TEST_F(StyleResolverTest, AnimationNotMaskedWithoutBitset) {}

TEST_F(StyleResolverTest, AnimationMaskedByImportant) {}

TEST_F(StyleResolverTest,
       TransitionRetargetRelativeFontSizeOnParentlessElement) {}

class StyleResolverFontRelativeUnitTest
    : public testing::WithParamInterface<const char*>,
      public StyleResolverTest {};

TEST_P(StyleResolverFontRelativeUnitTest,
       BaseNotReusableIfFontRelativeUnitPresent) {}

TEST_P(StyleResolverFontRelativeUnitTest,
       BaseReusableIfNoFontAffectingAnimation) {}

INSTANTIATE_TEST_SUITE_P();

namespace {

const CSSImageValue& GetBackgroundImageValue(const ComputedStyle& style) {}

const CSSImageValue& GetBackgroundImageValue(const Element* element) {}

const CSSImageSetValue& GetBackgroundImageSetValue(const ComputedStyle& style) {}

const CSSImageSetValue& GetBackgroundImageSetValue(const Element* element) {}

}  // namespace

TEST_F(StyleResolverTest, BackgroundImageFetch) {}

TEST_F(StyleResolverTest, FetchForAtPage) {}

TEST_F(StyleResolverTest, NoFetchForAtPage) {}

// The computed style for a page context isn't web-exposed, so here's a unit
// test for it. See https://drafts.csswg.org/css-page-3/#page-property-list for
// applicable properties within a page context.
TEST_F(StyleResolverTest, PageComputedStyle) {}

TEST_F(StyleResolverTest, PageComputedStyleLimited) {}

TEST_F(StyleResolverTest, NoFetchForHighlightPseudoElements) {}

TEST_F(StyleResolverTest, CSSMarkerPseudoElement) {}

TEST_F(StyleResolverTest, ApplyInheritedOnlyCustomPropertyChange) {}

TEST_F(StyleResolverTest, CssRulesForElementIncludedRules) {}

TEST_F(StyleResolverTest, NestedPseudoElement) {}

TEST_F(StyleResolverTest, CascadedValuesForElement) {}

TEST_F(StyleResolverTest, CascadedValuesForPseudoElement) {}

TEST_F(StyleResolverTestCQ, CascadedValuesForElementInContainer) {}

TEST_F(StyleResolverTestCQ, CascadedValuesForPseudoElementInContainer) {}

TEST_F(StyleResolverTest, EnsureComputedStyleSlotFallback) {}

TEST_F(StyleResolverTest, EnsureComputedStyleOutsideFlatTree) {}

TEST_F(StyleResolverTest, ComputeValueStandardProperty) {}

namespace {

const CSSValue* ParseCustomProperty(Document& document,
                                    const CustomProperty& property,
                                    const String& value) {}

}  // namespace

TEST_F(StyleResolverTest, ComputeValueCustomProperty) {}

TEST_F(StyleResolverTest, TreeScopedReferences) {}

TEST_F(StyleResolverTest, InheritStyleImagesFromDisplayContents) {}

TEST_F(StyleResolverTest, TextShadowInHighlightPseudoNotCounted1) {}

TEST_F(StyleResolverTest, TextShadowInHighlightPseudoNotCounted2) {}

TEST_F(StyleResolverTest, TextShadowInHighlightPseudotNone) {}

TEST_F(StyleResolverTest, TextShadowInHighlightPseudoNotNone1) {}

TEST_F(StyleResolverTest, TextShadowInHighlightPseudoNotNone2) {}

TEST_F(StyleResolverTestCQ, DependsOnSizeContainerQueries) {}

TEST_F(StyleResolverTestCQ, DependsOnSizeContainerQueriesPseudo) {}

// Verify that the ComputedStyle::DependsOnSizeContainerQuery flag does
// not end up in the MatchedPropertiesCache (MPC).
TEST_F(StyleResolverTestCQ, DependsOnSizeContainerQueriesMPC) {}

TEST_F(StyleResolverTestCQ, DependsOnStyleContainerQueries) {}

TEST_F(StyleResolverTest, AnchorQueriesMPC) {}

TEST_F(StyleResolverTest, AnchorQueryNoOldStyle) {}

TEST_F(StyleResolverTest, AnchorQueryStoreOldStyle) {}

TEST_F(StyleResolverTest, AnchorQueryBaseComputedStyle) {}

TEST_F(StyleResolverTest, NoCascadeLayers) {}

TEST_F(StyleResolverTest, CascadeLayersInDifferentSheets) {}

TEST_F(StyleResolverTest, CascadeLayersInDifferentTreeScopes) {}

// https://crbug.com/1313357
TEST_F(StyleResolverTest, CascadeLayersAfterModifyingAnotherSheet) {}

// https://crbug.com/1326791
TEST_F(StyleResolverTest, CascadeLayersAddLayersWithImportantDeclarations) {}

TEST_F(StyleResolverTest, BodyPropagationLayoutImageContain) {}

TEST_F(StyleResolverTest, IsInertWithAttributeAndDialog) {}

TEST_F(StyleResolverTest, IsInertWithDialogs) {}

static void EnterFullscreen(Document& document, Element& element) {}

static void ExitFullscreen(Document& document) {}

TEST_F(StyleResolverTest, IsInertWithFullscreen) {}

TEST_F(StyleResolverTest, IsInertWithFrameAndFullscreen) {}

TEST_F(StyleResolverTest, IsInertWithBackdrop) {}

TEST_F(StyleResolverTest, IsInertWithDialogAndFullscreen) {}

TEST_F(StyleResolverTestCQ, StyleRulesForElementContainerQuery) {}

TEST_F(StyleResolverTest, LegacyOverlapPerspectiveOrigin_Single) {}

TEST_F(StyleResolverTest, LegacyOverlapPerspectiveOrigin_Order) {}

TEST_F(StyleResolverTest, LegacyOverlapPerspectiveOrigin_Values) {}

TEST_F(StyleResolverTest, LegacyOverlapPerspectiveOrigin_Last) {}

TEST_F(StyleResolverTest, LegacyOverlapTransformOrigin_Single) {}

TEST_F(StyleResolverTest, LegacyOverlapTransformOrigin_Order) {}

TEST_F(StyleResolverTest, LegacyOverlapTransformOrigin_Values) {}

TEST_F(StyleResolverTest, LegacyOverlapTransformOrigin_Last) {}

TEST_F(StyleResolverTest, LegacyOverlapBorderImage_Single) {}

TEST_F(StyleResolverTest, LegacyOverlapBorderImage_Order) {}

TEST_F(StyleResolverTest, LegacyOverlapBorderImage_Values) {}

TEST_F(StyleResolverTest, LegacyOverlapBorderImage_Last_Source) {}

TEST_F(StyleResolverTest, LegacyOverlapBorderImage_Last_Slice) {}

TEST_F(StyleResolverTest, LegacyOverlapBorderImage_Last_SliceFill) {}

TEST_F(StyleResolverTest, LegacyOverlapBorderImage_SliceFillImplicit) {}

TEST_F(StyleResolverTest, LegacyOverlapBorderImage_Last_Width) {}

TEST_F(StyleResolverTest, LegacyOverlapBorderImage_Last_Outset) {}

TEST_F(StyleResolverTest, LegacyOverlapBorderImage_Last_Repeat) {}

TEST_F(StyleResolverTest, LegacyOverlapBorderImageWidth_Single) {}

TEST_F(StyleResolverTest, LegacyOverlapBorderImageWidth_Order) {}

TEST_F(StyleResolverTest, LegacyOverlapBorderImageWidth_Values) {}

TEST_F(StyleResolverTest, LegacyOverlapBorderImageWidth_Last_Border) {}

TEST_F(StyleResolverTest, LegacyOverlapBorderImageWidth_Last_Style) {}

TEST_F(StyleResolverTest, PositionTryStylesBasic_Cascade) {}

TEST_F(StyleResolverTest, PositionTryStylesResolveLogicalProperties_Cascade) {}

TEST_F(StyleResolverTest, PositionTryStylesResolveRelativeLengthUnits_Cascade) {}

TEST_F(StyleResolverTest, PositionTryStylesInBeforePseudoElement_Cascade) {}

TEST_F(StyleResolverTest, PositionTryStylesCSSWideKeywords_Cascade) {}

TEST_F(StyleResolverTest, PositionTryPropertyValueChange_Cascade) {}

TEST_F(StyleResolverTest, PositionTry_PaintInvalidation) {}

TEST_F(StyleResolverTest, TrySet_Basic) {}

TEST_F(StyleResolverTest, TrySet_RevertLayer) {}

TEST_F(StyleResolverTest, TrySet_Revert) {}

TEST_F(StyleResolverTest, TrySet_NonAbsPos) {}

TEST_F(StyleResolverTest, TrySet_NonAbsPosDynamic) {}

TEST_F(StyleResolverTest, TryTacticsSet_Flip) {}

TEST_F(StyleResolverTest,
       PseudoElementWithAnimationAndOriginatingElementStyleChange) {}

TEST_F(StyleResolverTestCQ, ContainerUnitContext) {}

TEST_F(StyleResolverTest, ScopedAnchorName) {}

TEST_F(StyleResolverTest, ScopedPositionAnchor) {}

TEST_F(StyleResolverTest, NoAnchorFunction) {}

TEST_F(StyleResolverTest, HasAnchorFunction) {}

TEST_F(StyleResolverTest, HasAnchorFunctionImplicit) {}

TEST_F(StyleResolverTest, HasAnchorSizeFunction) {}

TEST_F(StyleResolverTest, HasAnchorSizeFunctionImplicit) {}

TEST_F(StyleResolverTestCQ, CanAffectAnimationsMPC) {}

TEST_F(StyleResolverTest, CssRulesForElementExcludeStartingStyle) {}

TEST_F(StyleResolverTest, PseudoCSSRulesForElementExcludeStartingStyle) {}

TEST_F(StyleResolverTest, ResizeAutoInUANotCounted) {}

TEST_F(StyleResolverTest, ResizeAutoCounted) {}

TEST_F(StyleResolverTest, NoCursorHandIfNoCursor) {}

TEST_F(StyleResolverTest, CursorHandIsCounted) {}

TEST_F(StyleResolverTest, CursorHandInStandardsModeIsIgnored) {}

TEST_F(StyleResolverTest, IEIgnoreSyntaxForCursorHandIsIgnored) {}

TEST_F(StyleResolverTest, CursorHandThatLoses) {}

TEST_F(StyleResolverTest, CursorHandThatWouldNotMatterIfWeIgnored) {}

TEST_F(StyleResolverTest, CursorHandNotApplied) {}

TEST_F(StyleResolverTest, TextSizeAdjustUseCounter) {}

}  // namespace blink