Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement StylePropertyMap::set() #5912

Merged
merged 1 commit into from Nov 3, 2022

Conversation

cdumez
Copy link
Contributor

@cdumez cdumez commented Oct 28, 2022

9d69bb3

Implement StylePropertyMap::set()
https://bugs.webkit.org/show_bug.cgi?id=247199

Reviewed by Antti Koivisto.

Implement StylePropertyMap::set():
- https://drafts.css-houdini.org/css-typed-om/#dom-stylepropertymap-set

* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/declared-styleMap-accepts-inherit-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/set-var-reference-thcrash-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/declared.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/set-shorthand-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/set.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/set-shorthand-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/set.tentative-expected.txt:
* Source/WebCore/css/CSSProperty.cpp:
(WebCore::CSSProperty::createListForProperty):
* Source/WebCore/css/CSSProperty.h:
* Source/WebCore/css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::setProperty):
* Source/WebCore/css/StyleProperties.h:
* Source/WebCore/css/calc/CSSCalcValue.cpp:
(WebCore::CSSCalcValue::create):
* Source/WebCore/css/calc/CSSCalcValue.h:
* Source/WebCore/css/typedom/CSSKeywordValue.cpp:
(WebCore::CSSKeywordValue::toCSSValue const):
* Source/WebCore/css/typedom/CSSKeywordValue.h:
* Source/WebCore/css/typedom/CSSNumericValue.h:
* Source/WebCore/css/typedom/CSSStyleImageValue.cpp:
(WebCore::CSSStyleImageValue::toCSSValue const):
* Source/WebCore/css/typedom/CSSStyleImageValue.h:
* Source/WebCore/css/typedom/CSSStyleValue.h:
(WebCore::CSSStyleValue::toCSSValue const):
(WebCore::CSSStyleValue::associatedProperty const):
* Source/WebCore/css/typedom/CSSStyleValueFactory.cpp:
(WebCore::CSSStyleValueFactory::vectorFromStyleValuesOrStrings):
* Source/WebCore/css/typedom/CSSStyleValueFactory.h:
* Source/WebCore/css/typedom/CSSUnitValue.cpp:
(WebCore::CSSUnitValue::toCSSValue const):
(WebCore::CSSUnitValue::toCalcExpressionNode const):
* Source/WebCore/css/typedom/CSSUnitValue.h:
* Source/WebCore/css/typedom/CSSUnparsedValue.cpp:
(WebCore::CSSUnparsedValue::toCSSValue const):
* Source/WebCore/css/typedom/CSSUnparsedValue.h:
* Source/WebCore/css/typedom/DeclaredStylePropertyMap.cpp:
(WebCore::DeclaredStylePropertyMap::setShorthandProperty):
(WebCore::DeclaredStylePropertyMap::setProperty):
(WebCore::DeclaredStylePropertyMap::setCustomProperty):
* Source/WebCore/css/typedom/DeclaredStylePropertyMap.h:
* Source/WebCore/css/typedom/StylePropertyMap.cpp:
(WebCore::cssValueFromStyleValues):
(WebCore::StylePropertyMap::set):
* Source/WebCore/css/typedom/StylePropertyMap.h:
* Source/WebCore/css/typedom/color/CSSColorValue.cpp:
(WebCore::CSSColorValue::toCSSValue const):
* Source/WebCore/css/typedom/color/CSSColorValue.h:
* Source/WebCore/css/typedom/numeric/CSSMathClamp.cpp:
(WebCore::CSSMathClamp::toCalcExpressionNode const):
* Source/WebCore/css/typedom/numeric/CSSMathClamp.h:
* Source/WebCore/css/typedom/numeric/CSSMathInvert.cpp:
(WebCore::CSSMathInvert::toCalcExpressionNode const):
* Source/WebCore/css/typedom/numeric/CSSMathInvert.h:
* Source/WebCore/css/typedom/numeric/CSSMathMax.cpp:
(WebCore::CSSMathMax::toCalcExpressionNode const):
* Source/WebCore/css/typedom/numeric/CSSMathMax.h:
* Source/WebCore/css/typedom/numeric/CSSMathMin.cpp:
(WebCore::CSSMathMin::toCalcExpressionNode const):
* Source/WebCore/css/typedom/numeric/CSSMathMin.h:
* Source/WebCore/css/typedom/numeric/CSSMathNegate.cpp:
(WebCore::CSSMathNegate::equals const):
(WebCore::CSSMathNegate::toCalcExpressionNode const):
* Source/WebCore/css/typedom/numeric/CSSMathNegate.h:
* Source/WebCore/css/typedom/numeric/CSSMathProduct.cpp:
(WebCore::CSSMathProduct::toCalcExpressionNode const):
* Source/WebCore/css/typedom/numeric/CSSMathProduct.h:
* Source/WebCore/css/typedom/numeric/CSSMathSum.cpp:
(WebCore::CSSMathSum::toCalcExpressionNode const):
* Source/WebCore/css/typedom/numeric/CSSMathSum.h:
* Source/WebCore/css/typedom/numeric/CSSMathValue.h:
(WebCore::CSSMathValue::equalsImpl const):
* Source/WebCore/css/typedom/transform/CSSMatrixComponent.cpp:
(WebCore::CSSMatrixComponent::toCSSValue const):
* Source/WebCore/css/typedom/transform/CSSMatrixComponent.h:
* Source/WebCore/css/typedom/transform/CSSPerspective.cpp:
(WebCore::CSSPerspective::toCSSValue const):
* Source/WebCore/css/typedom/transform/CSSPerspective.h:
* Source/WebCore/css/typedom/transform/CSSRotate.cpp:
(WebCore::CSSRotate::toCSSValue const):
* Source/WebCore/css/typedom/transform/CSSRotate.h:
* Source/WebCore/css/typedom/transform/CSSScale.cpp:
(WebCore::CSSScale::toCSSValue const):
* Source/WebCore/css/typedom/transform/CSSScale.h:
* Source/WebCore/css/typedom/transform/CSSSkew.cpp:
(WebCore::CSSSkew::toCSSValue const):
* Source/WebCore/css/typedom/transform/CSSSkew.h:
* Source/WebCore/css/typedom/transform/CSSSkewX.cpp:
(WebCore::CSSSkewX::toCSSValue const):
* Source/WebCore/css/typedom/transform/CSSSkewX.h:
* Source/WebCore/css/typedom/transform/CSSSkewY.cpp:
(WebCore::CSSSkewY::toCSSValue const):
* Source/WebCore/css/typedom/transform/CSSSkewY.h:
* Source/WebCore/css/typedom/transform/CSSTransformComponent.h:
* Source/WebCore/css/typedom/transform/CSSTransformValue.cpp:
(WebCore::CSSTransformValue::toCSSValue const):
* Source/WebCore/css/typedom/transform/CSSTransformValue.h:
* Source/WebCore/css/typedom/transform/CSSTranslate.cpp:
(WebCore::CSSTranslate::toCSSValue const):
* Source/WebCore/css/typedom/transform/CSSTranslate.h:
* Source/WebCore/dom/StyledElement.cpp:
(WebCore::StyledElement::setInlineStyleProperty):
(WebCore::StyledElement::setInlineStyleCustomProperty):
* Source/WebCore/dom/StyledElement.h:

Canonical link: https://commits.webkit.org/256258@main

f379384

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios   πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  πŸ§ͺ win
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-debug βœ… πŸ›  gtk βœ… πŸ›  wincairo
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios   πŸ§ͺ api-mac βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv   πŸ§ͺ mac-wk1
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2
βœ… πŸ›  watch   πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  πŸ§ͺ unsafe-merge βœ… πŸ›  watch-sim βœ… πŸ§ͺ mac-wk2-stress

@cdumez cdumez self-assigned this Oct 28, 2022
@cdumez cdumez added CSS Cascading Style Sheets implementation WebKit Nightly Build labels Oct 28, 2022
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 28, 2022
@cdumez cdumez removed the merging-blocked Applied to prevent a change from being merged label Oct 28, 2022
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 28, 2022
@cdumez cdumez removed the merging-blocked Applied to prevent a change from being merged label Oct 29, 2022
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 29, 2022
@cdumez cdumez removed the merging-blocked Applied to prevent a change from being merged label Oct 30, 2022

return computeNonCalcLengthDouble(conversionData, primitiveType(), m_value.num);
// FIXME: Without this, imported/w3c/web-platform-tests/css/css-properties-values-api/unit-cycles.html would
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anttijk & @litherum I could really use your help here understanding what I am doing wrong. I have no idea why FontCascade::m_fonts is uninitialized here and how to fix it.

Note that that test in question was relying on StylePropertyMap::set() to actually run so there is also a small chance this exposed a pre-existing bug.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can just skip the test. The crash involves the unrelated and less-than-complete registerProperty feature that is not a shipping configuration. I plan to work on it later.

@cdumez cdumez marked this pull request as ready for review October 31, 2022 23:32
@cdumez cdumez requested a review from rniwa as a code owner October 31, 2022 23:32
@cdumez
Copy link
Contributor Author

cdumez commented Nov 1, 2022

Patch is ready for review.

@cdumez cdumez added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Nov 2, 2022
@cdumez cdumez removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Nov 2, 2022
@cdumez cdumez added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Nov 3, 2022
https://bugs.webkit.org/show_bug.cgi?id=247199

Reviewed by Antti Koivisto.

Implement StylePropertyMap::set():
- https://drafts.css-houdini.org/css-typed-om/#dom-stylepropertymap-set

* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/declared-styleMap-accepts-inherit-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/set-var-reference-thcrash-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/declared.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/set-shorthand-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/set.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/set-shorthand-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/set.tentative-expected.txt:
* Source/WebCore/css/CSSProperty.cpp:
(WebCore::CSSProperty::createListForProperty):
* Source/WebCore/css/CSSProperty.h:
* Source/WebCore/css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::setProperty):
* Source/WebCore/css/StyleProperties.h:
* Source/WebCore/css/calc/CSSCalcValue.cpp:
(WebCore::CSSCalcValue::create):
* Source/WebCore/css/calc/CSSCalcValue.h:
* Source/WebCore/css/typedom/CSSKeywordValue.cpp:
(WebCore::CSSKeywordValue::toCSSValue const):
* Source/WebCore/css/typedom/CSSKeywordValue.h:
* Source/WebCore/css/typedom/CSSNumericValue.h:
* Source/WebCore/css/typedom/CSSStyleImageValue.cpp:
(WebCore::CSSStyleImageValue::toCSSValue const):
* Source/WebCore/css/typedom/CSSStyleImageValue.h:
* Source/WebCore/css/typedom/CSSStyleValue.h:
(WebCore::CSSStyleValue::toCSSValue const):
(WebCore::CSSStyleValue::associatedProperty const):
* Source/WebCore/css/typedom/CSSStyleValueFactory.cpp:
(WebCore::CSSStyleValueFactory::vectorFromStyleValuesOrStrings):
* Source/WebCore/css/typedom/CSSStyleValueFactory.h:
* Source/WebCore/css/typedom/CSSUnitValue.cpp:
(WebCore::CSSUnitValue::toCSSValue const):
(WebCore::CSSUnitValue::toCalcExpressionNode const):
* Source/WebCore/css/typedom/CSSUnitValue.h:
* Source/WebCore/css/typedom/CSSUnparsedValue.cpp:
(WebCore::CSSUnparsedValue::toCSSValue const):
* Source/WebCore/css/typedom/CSSUnparsedValue.h:
* Source/WebCore/css/typedom/DeclaredStylePropertyMap.cpp:
(WebCore::DeclaredStylePropertyMap::setShorthandProperty):
(WebCore::DeclaredStylePropertyMap::setProperty):
(WebCore::DeclaredStylePropertyMap::setCustomProperty):
* Source/WebCore/css/typedom/DeclaredStylePropertyMap.h:
* Source/WebCore/css/typedom/StylePropertyMap.cpp:
(WebCore::cssValueFromStyleValues):
(WebCore::StylePropertyMap::set):
* Source/WebCore/css/typedom/StylePropertyMap.h:
* Source/WebCore/css/typedom/color/CSSColorValue.cpp:
(WebCore::CSSColorValue::toCSSValue const):
* Source/WebCore/css/typedom/color/CSSColorValue.h:
* Source/WebCore/css/typedom/numeric/CSSMathClamp.cpp:
(WebCore::CSSMathClamp::toCalcExpressionNode const):
* Source/WebCore/css/typedom/numeric/CSSMathClamp.h:
* Source/WebCore/css/typedom/numeric/CSSMathInvert.cpp:
(WebCore::CSSMathInvert::toCalcExpressionNode const):
* Source/WebCore/css/typedom/numeric/CSSMathInvert.h:
* Source/WebCore/css/typedom/numeric/CSSMathMax.cpp:
(WebCore::CSSMathMax::toCalcExpressionNode const):
* Source/WebCore/css/typedom/numeric/CSSMathMax.h:
* Source/WebCore/css/typedom/numeric/CSSMathMin.cpp:
(WebCore::CSSMathMin::toCalcExpressionNode const):
* Source/WebCore/css/typedom/numeric/CSSMathMin.h:
* Source/WebCore/css/typedom/numeric/CSSMathNegate.cpp:
(WebCore::CSSMathNegate::equals const):
(WebCore::CSSMathNegate::toCalcExpressionNode const):
* Source/WebCore/css/typedom/numeric/CSSMathNegate.h:
* Source/WebCore/css/typedom/numeric/CSSMathProduct.cpp:
(WebCore::CSSMathProduct::toCalcExpressionNode const):
* Source/WebCore/css/typedom/numeric/CSSMathProduct.h:
* Source/WebCore/css/typedom/numeric/CSSMathSum.cpp:
(WebCore::CSSMathSum::toCalcExpressionNode const):
* Source/WebCore/css/typedom/numeric/CSSMathSum.h:
* Source/WebCore/css/typedom/numeric/CSSMathValue.h:
(WebCore::CSSMathValue::equalsImpl const):
* Source/WebCore/css/typedom/transform/CSSMatrixComponent.cpp:
(WebCore::CSSMatrixComponent::toCSSValue const):
* Source/WebCore/css/typedom/transform/CSSMatrixComponent.h:
* Source/WebCore/css/typedom/transform/CSSPerspective.cpp:
(WebCore::CSSPerspective::toCSSValue const):
* Source/WebCore/css/typedom/transform/CSSPerspective.h:
* Source/WebCore/css/typedom/transform/CSSRotate.cpp:
(WebCore::CSSRotate::toCSSValue const):
* Source/WebCore/css/typedom/transform/CSSRotate.h:
* Source/WebCore/css/typedom/transform/CSSScale.cpp:
(WebCore::CSSScale::toCSSValue const):
* Source/WebCore/css/typedom/transform/CSSScale.h:
* Source/WebCore/css/typedom/transform/CSSSkew.cpp:
(WebCore::CSSSkew::toCSSValue const):
* Source/WebCore/css/typedom/transform/CSSSkew.h:
* Source/WebCore/css/typedom/transform/CSSSkewX.cpp:
(WebCore::CSSSkewX::toCSSValue const):
* Source/WebCore/css/typedom/transform/CSSSkewX.h:
* Source/WebCore/css/typedom/transform/CSSSkewY.cpp:
(WebCore::CSSSkewY::toCSSValue const):
* Source/WebCore/css/typedom/transform/CSSSkewY.h:
* Source/WebCore/css/typedom/transform/CSSTransformComponent.h:
* Source/WebCore/css/typedom/transform/CSSTransformValue.cpp:
(WebCore::CSSTransformValue::toCSSValue const):
* Source/WebCore/css/typedom/transform/CSSTransformValue.h:
* Source/WebCore/css/typedom/transform/CSSTranslate.cpp:
(WebCore::CSSTranslate::toCSSValue const):
* Source/WebCore/css/typedom/transform/CSSTranslate.h:
* Source/WebCore/dom/StyledElement.cpp:
(WebCore::StyledElement::setInlineStyleProperty):
(WebCore::StyledElement::setInlineStyleCustomProperty):
* Source/WebCore/dom/StyledElement.h:

Canonical link: https://commits.webkit.org/256258@main
@webkit-commit-queue
Copy link
Collaborator

Committed 256258@main (9d69bb3): https://commits.webkit.org/256258@main

Reviewed commits have been landed. Closing PR #5912 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 9d69bb3 into WebKit:main Nov 3, 2022
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Cascading Style Sheets implementation
Projects
None yet
5 participants