RESOLVED FIXED 238181
Parsing of contain-intrinsic-size and adding a runtime flag for it
https://bugs.webkit.org/show_bug.cgi?id=238181
Summary Parsing of contain-intrinsic-size and adding a runtime flag for it
Attachments
Patch (42.93 KB, patch)
2022-03-21 19:18 PDT, cathiechen
no flags
Patch (118.13 KB, patch)
2022-03-22 06:14 PDT, cathiechen
no flags
Patch (171.87 KB, patch)
2022-03-25 07:36 PDT, cathiechen
no flags
Patch (171.27 KB, patch)
2022-03-28 06:18 PDT, cathiechen
no flags
Patch (171.17 KB, patch)
2022-04-06 07:54 PDT, Rob Buis
no flags
Patch (171.11 KB, patch)
2022-04-06 10:48 PDT, Rob Buis
no flags
Patch (172.23 KB, patch)
2022-04-07 01:38 PDT, Rob Buis
no flags
Patch (170.80 KB, patch)
2022-04-08 01:29 PDT, Rob Buis
no flags
Patch (170.90 KB, patch)
2022-04-13 10:09 PDT, Rob Buis
no flags
Patch (170.97 KB, patch)
2022-04-15 11:37 PDT, Rob Buis
no flags
Patch (170.97 KB, patch)
2022-04-20 03:05 PDT, cathiechen
no flags
Patch (171.03 KB, patch)
2022-04-20 03:30 PDT, cathiechen
no flags
cathiechen
Comment 1 2022-03-21 19:18:59 PDT
cathiechen
Comment 2 2022-03-22 06:14:02 PDT
Rob Buis
Comment 3 2022-03-23 04:10:14 PDT
Comment on attachment 455367 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=455367&action=review > Source/WebCore/ChangeLog:11 > + value for Length and AutoAndLenght type. AutoAndLength. > Source/WebCore/css/parser/CSSPropertyParser.cpp:4101 > + list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueAuto)); Better here to use autoValue I think.
cathiechen
Comment 4 2022-03-25 07:36:38 PDT
Rob Buis
Comment 5 2022-03-25 10:26:53 PDT
Patch LGTM to me :) I will leave it for an Apple person to do the final review though.
Simon Fraser (smfr)
Comment 6 2022-03-25 10:53:48 PDT
Comment on attachment 455758 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=455758&action=review > Source/WebCore/css/parser/CSSParserContext.cpp:219 > + uint64_t bits2 = context.containIntrinsicSizeEnabled << 0 > + | (unsigned long long)context.mode << 1; // This is multiple bits, so keep it last. Why the need for bits2? bits is 64 bit, so we should be able to go up to 1 << 63.
cathiechen
Comment 7 2022-03-28 05:37:37 PDT
Comment on attachment 455758 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=455758&action=review >> Source/WebCore/css/parser/CSSParserContext.cpp:219 >> + | (unsigned long long)context.mode << 1; // This is multiple bits, so keep it last. > > Why the need for bits2? bits is 64 bit, so we should be able to go up to 1 << 63. Yes, sizeof(uint64_t) is 8. But I got this compiling error, not sure why... ``` ./css/parser/CSSParserContext.cpp:217:61: error: shift count >= width of type [-Werror,-Wshift-count-overflow] | context.containIntrinsicSizeEnabled << 32 ^ ~~ 1 error generated ```
cathiechen
Comment 8 2022-03-28 06:05:18 PDT
Comment on attachment 455758 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=455758&action=review >>> Source/WebCore/css/parser/CSSParserContext.cpp:219 >>> + | (unsigned long long)context.mode << 1; // This is multiple bits, so keep it last. >> >> Why the need for bits2? bits is 64 bit, so we should be able to go up to 1 << 63. > > Yes, sizeof(uint64_t) is 8. But I got this compiling error, not sure why... > > ``` > ./css/parser/CSSParserContext.cpp:217:61: error: shift count >= width of type [-Werror,-Wshift-count-overflow] > | context.containIntrinsicSizeEnabled << 32 > ^ ~~ > 1 error generated > ``` Done! Thanks, Rob, for pointing out context.containIntrinsicSizeEnabled is only 32 bit, I just need to add a cast here.
cathiechen
Comment 9 2022-03-28 06:18:59 PDT
Radar WebKit Bug Importer
Comment 10 2022-03-28 06:41:43 PDT
cathiechen
Comment 11 2022-03-29 06:31:55 PDT
Comment on attachment 455911 [details] Patch Hi, I think the patch is ready for review, please take a look. Thanks!
Rob Buis
Comment 12 2022-04-06 07:54:47 PDT
Rob Buis
Comment 13 2022-04-06 10:48:30 PDT
Rob Buis
Comment 15 2022-04-07 01:38:13 PDT
Rob Buis
Comment 16 2022-04-07 01:39:06 PDT
(In reply to Tim Nguyen (:ntim) from comment #14) > Can you fix the assert: > > https://ews-build.s3-us-west-2.amazonaws.com/macOS-AppleSilicon-Big-Sur- > Debug-WK2-Tests-EWS/456837-28300-rerun/accessibility/mac/media-role- > descriptions-stderr.txt > > ? Seems like this needs animation support. Thanks for the heads up, the latest patch should fix it.
Rob Buis
Comment 17 2022-04-08 01:29:21 PDT
Rob Buis
Comment 18 2022-04-13 10:09:41 PDT
Rob Buis
Comment 19 2022-04-14 11:01:14 PDT
This is now ready for review :)
Tim Nguyen (:ntim)
Comment 20 2022-04-15 09:58:27 PDT
Comment on attachment 457541 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=457541&action=review > Source/WebCore/css/parser/CSSParserContext.cpp:217 > + | (unsigned long long)context.containIntrinsicSizeEnabled << 32 Why does this need to be (unsigned long long)? I assume this is bad copy paste? > Source/WebCore/css/parser/CSSPropertyParser.cpp:4097 > + break; Why not `return nullptr;`? > Source/WebCore/rendering/style/StyleRareNonInheritedData.h:240 > + unsigned containIntrinsicWidthType : 3; > + unsigned containIntrinsicHeightType : 3; Does this not fit in 2? The enum only has 3 values and 2**2 == 4
Rob Buis
Comment 21 2022-04-15 11:37:07 PDT
Rob Buis
Comment 22 2022-04-15 11:38:06 PDT
Comment on attachment 457541 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=457541&action=review >> Source/WebCore/css/parser/CSSParserContext.cpp:217 >> + | (unsigned long long)context.containIntrinsicSizeEnabled << 32 > > Why does this need to be (unsigned long long)? I assume this is bad copy paste? Yes that was a bit lazy, fixed. >> Source/WebCore/css/parser/CSSPropertyParser.cpp:4097 >> + break; > > Why not `return nullptr;`? Why not indeed. Fixed. >> Source/WebCore/rendering/style/StyleRareNonInheritedData.h:240 >> + unsigned containIntrinsicHeightType : 3; > > Does this not fit in 2? The enum only has 3 values and 2**2 == 4 It should fit indeed. Fixed.
Simon Fraser (smfr)
Comment 23 2022-04-19 11:43:07 PDT
Comment on attachment 457708 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=457708&action=review Don't forget to fix RenderStyle::diff() in this or a future patch. > Source/WebCore/rendering/style/StyleRareNonInheritedData.h:240 > + unsigned containIntrinsicWidthType : 2; > + unsigned containIntrinsicHeightType : 2; Add a `// ContainIntrinsicSizeType` comment on both lines > Source/WebCore/style/StyleBuilderCustom.h:2167 > + CSSPropertyID newId = CSSProperty::resolveDirectionAwareProperty(CSSPropertyContainIntrinsicBlockSize, style.direction(), style.writingMode()); Maybe `auto resolvedID = `
Tim Nguyen (:ntim)
Comment 24 2022-04-19 12:43:49 PDT
Comment on attachment 457708 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=457708&action=review > Source/WebCore/css/parser/CSSParserContext.cpp:217 > + | (uint64_t)context.containIntrinsicSizeEnabled << 32 Does: | context.containIntrinsicSizeEnabled << 32 just work here? (just for consistency for the other *Enabled flags)
cathiechen
Comment 25 2022-04-19 23:05:18 PDT
Comment on attachment 457708 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=457708&action=review >> Source/WebCore/css/parser/CSSParserContext.cpp:217 >> + | (uint64_t)context.containIntrinsicSizeEnabled << 32 > > Does: > | context.containIntrinsicSizeEnabled << 32 > > just work here? (just for consistency for the other *Enabled flags) Looks like not, we will get the following error: ``` ./css/parser/CSSParserContext.cpp:217:61: error: shift count >= width of type [-Werror,-Wshift-count-overflow] | context.containIntrinsicSizeEnabled << 32 ^ ~~ 1 error generated ``` For context.containIntrinsicSizeEnabled is 32 bit, we need to extend it to 64 bit, then it could be moved 32.
cathiechen
Comment 26 2022-04-20 02:59:05 PDT
Comment on attachment 457708 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=457708&action=review >> Source/WebCore/rendering/style/StyleRareNonInheritedData.h:240 >> + unsigned containIntrinsicHeightType : 2; > > Add a `// ContainIntrinsicSizeType` comment on both lines Done >> Source/WebCore/style/StyleBuilderCustom.h:2167 >> + CSSPropertyID newId = CSSProperty::resolveDirectionAwareProperty(CSSPropertyContainIntrinsicBlockSize, style.direction(), style.writingMode()); > > Maybe `auto resolvedID = ` Done
cathiechen
Comment 27 2022-04-20 03:00:03 PDT
(In reply to Simon Fraser (smfr) from comment #23) > Comment on attachment 457708 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=457708&action=review > > Don't forget to fix RenderStyle::diff() in this or a future patch. > Thanks! We will handle this in the implementing patch:)
cathiechen
Comment 28 2022-04-20 03:05:45 PDT
cathiechen
Comment 29 2022-04-20 03:30:37 PDT
EWS
Comment 30 2022-04-20 04:52:56 PDT
Committed r293090 (249801@main): <https://commits.webkit.org/249801@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 457971 [details].
Oriol Brufau
Comment 31 2022-05-30 09:47:03 PDT
Comment on attachment 457971 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=457971&action=review > Source/WebCore/css/CSSProperties.json:5327 > + "logical-property-group": { Logical properties are resolved into physical before being applied. So you can use skip-builder:true and then remove the logical BuilderCustom methods. That's what other logical properties do.
Brent Fulgham
Comment 32 2022-07-01 15:12:39 PDT
*** Bug 204316 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.