Diff
Modified: trunk/LayoutTests/TestExpectations (295674 => 295675)
--- trunk/LayoutTests/TestExpectations 2022-06-20 13:04:59 UTC (rev 295674)
+++ trunk/LayoutTests/TestExpectations 2022-06-20 14:45:19 UTC (rev 295675)
@@ -4793,8 +4793,6 @@
# Container queries
webkit.org/b/229659 imported/w3c/web-platform-tests/css/css-contain/container-queries/custom-layout-container-001.https.html [ ImageOnlyFailure ]
webkit.org/b/229659 imported/w3c/web-platform-tests/css/css-contain/container-queries/inline-size-bfc-floats.html [ ImageOnlyFailure ]
-webkit.org/b/229659 imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-gradient-invalidation.html [ ImageOnlyFailure ]
-webkit.org/b/229659 imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-gradient.html [ ImageOnlyFailure ]
webkit.org/b/241778 [ Debug ] imported/w3c/web-platform-tests/css/css-contain/container-queries/svg-foreignobject-no-size-container.html [ Skip ]
# Flaky css-contain test
Modified: trunk/Source/WebCore/css/CSSGradientValue.cpp (295674 => 295675)
--- trunk/Source/WebCore/css/CSSGradientValue.cpp 2022-06-20 13:04:59 UTC (rev 295674)
+++ trunk/Source/WebCore/css/CSSGradientValue.cpp 2022-06-20 14:45:19 UTC (rev 295675)
@@ -883,7 +883,7 @@
if (auto* documentElement = renderer.document().documentElement())
rootStyle = documentElement->renderStyle();
- CSSToLengthConversionData conversionData(renderer.style(), rootStyle, renderer.parentStyle(), &renderer.view());
+ CSSToLengthConversionData conversionData(renderer.style(), rootStyle, renderer.parentStyle(), &renderer.view(), renderer.generatingElement());
FloatPoint firstPoint;
FloatPoint secondPoint;
@@ -1141,7 +1141,7 @@
if (auto* documentElement = renderer.document().documentElement())
rootStyle = documentElement->renderStyle();
- CSSToLengthConversionData conversionData(renderer.style(), rootStyle, renderer.parentStyle(), &renderer.view());
+ CSSToLengthConversionData conversionData(renderer.style(), rootStyle, renderer.parentStyle(), &renderer.view(), renderer.generatingElement());
FloatPoint firstPoint = computeEndPoint(firstX(), firstY(), conversionData, size);
if (!firstX())
@@ -1334,7 +1334,7 @@
if (auto* documentElement = renderer.document().documentElement())
rootStyle = documentElement->renderStyle();
- CSSToLengthConversionData conversionData(renderer.style(), rootStyle, renderer.parentStyle(), &renderer.view());
+ CSSToLengthConversionData conversionData(renderer.style(), rootStyle, renderer.parentStyle(), &renderer.view(), renderer.generatingElement());
FloatPoint centerPoint = computeEndPoint(firstX(), firstY(), conversionData, size);
if (!firstX())
Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.cpp (295674 => 295675)
--- trunk/Source/WebCore/css/CSSPrimitiveValue.cpp 2022-06-20 13:04:59 UTC (rev 295674)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.cpp 2022-06-20 14:45:19 UTC (rev 295675)
@@ -825,10 +825,11 @@
{
auto selectContainerRenderer = [&](CQ::Axis axis) -> const RenderBox* {
conversionData.setUsesContainerUnits();
- if (!conversionData.element())
+ auto* element = conversionData.elementForContainerUnitResolution();
+ if (!element)
return nullptr;
// FIXME: Use cached query containers when available.
- auto* container = Style::ContainerQueryEvaluator::selectContainer(axis, nullString(), *conversionData.element());
+ auto* container = Style::ContainerQueryEvaluator::selectContainer(axis, nullString(), *element);
if (!container)
return nullptr;
return dynamicDowncast<RenderBox>(container->renderer());
Modified: trunk/Source/WebCore/css/CSSToLengthConversionData.cpp (295674 => 295675)
--- trunk/Source/WebCore/css/CSSToLengthConversionData.cpp 2022-06-20 13:04:59 UTC (rev 295674)
+++ trunk/Source/WebCore/css/CSSToLengthConversionData.cpp 2022-06-20 14:45:19 UTC (rev 295675)
@@ -43,16 +43,17 @@
, m_rootStyle(builderContext.rootElementStyle)
, m_parentStyle(&builderContext.parentStyle)
, m_renderView(builderContext.document->renderView())
- , m_element(builderContext.element)
+ , m_elementForContainerUnitResolution(builderContext.element)
, m_viewportDependencyDetectionStyle(const_cast<RenderStyle*>(m_style))
{
}
-CSSToLengthConversionData::CSSToLengthConversionData(const RenderStyle& style, const RenderStyle* rootStyle, const RenderStyle* parentStyle, const RenderView* renderView)
+CSSToLengthConversionData::CSSToLengthConversionData(const RenderStyle& style, const RenderStyle* rootStyle, const RenderStyle* parentStyle, const RenderView* renderView, const Element* elementForContainerUnitResolution)
: m_style(&style)
, m_rootStyle(rootStyle)
, m_parentStyle(parentStyle)
, m_renderView(renderView)
+ , m_elementForContainerUnitResolution(elementForContainerUnitResolution)
, m_zoom(1.f)
, m_viewportDependencyDetectionStyle(const_cast<RenderStyle*>(m_style))
{
Modified: trunk/Source/WebCore/css/CSSToLengthConversionData.h (295674 => 295675)
--- trunk/Source/WebCore/css/CSSToLengthConversionData.h 2022-06-20 13:04:59 UTC (rev 295674)
+++ trunk/Source/WebCore/css/CSSToLengthConversionData.h 2022-06-20 14:45:19 UTC (rev 295675)
@@ -51,7 +51,7 @@
// This is used during style building. The 'zoom' property is taken into account.
CSSToLengthConversionData(const RenderStyle&, const Style::BuilderContext&);
// This constructor ignores the `zoom` property.
- CSSToLengthConversionData(const RenderStyle&, const RenderStyle* rootStyle, const RenderStyle* parentStyle, const RenderView*);
+ CSSToLengthConversionData(const RenderStyle&, const RenderStyle* rootStyle, const RenderStyle* parentStyle, const RenderView*, const Element* elementForContainerUnitResolution = nullptr);
CSSToLengthConversionData() = default;
@@ -63,7 +63,7 @@
bool computingLineHeight() const { return m_propertyToCompute == CSSPropertyLineHeight; }
CSSPropertyID propertyToCompute() const { return m_propertyToCompute.value_or(CSSPropertyInvalid); }
const RenderView* renderView() const { return m_renderView; }
- const Element* element() const { return m_element.get(); }
+ const Element* elementForContainerUnitResolution() const { return m_elementForContainerUnitResolution.get(); }
FloatSize defaultViewportFactor() const;
FloatSize smallViewportFactor() const;
@@ -101,7 +101,7 @@
const RenderStyle* m_rootStyle { nullptr };
const RenderStyle* m_parentStyle { nullptr };
const RenderView* m_renderView { nullptr };
- RefPtr<const Element> m_element;
+ RefPtr<const Element> m_elementForContainerUnitResolution;
std::optional<float> m_zoom;
std::optional<CSSPropertyID> m_propertyToCompute;
// FIXME: Remove this hack.