Bug 233109

Summary: Implement parsing and animation support for offset shorthand
Product: WebKit Reporter: Kiet Ho <kiet.ho>
Component: CSSAssignee: Kiet Ho <kiet.ho>
Status: RESOLVED FIXED    
Severity: Normal CC: clopez, dino, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, joepeck, jonlee, kyle.bavender, macpherson, menard, nmouchtaris, simon.fraser, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 233108    
Bug Blocks: 203847    
Attachments:
Description Flags
WIP
none
WIP
none
WIP
none
Patch
none
Patch
dino: review+, ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch none

Kiet Ho
Reported 2021-11-14 13:39:55 PST
Implement parsing and animation support for offset shorthand
Attachments
WIP (45.46 KB, patch)
2021-11-15 16:38 PST, Kiet Ho
no flags
WIP (45.33 KB, patch)
2021-11-15 18:00 PST, Kiet Ho
no flags
WIP (46.45 KB, patch)
2021-11-19 10:54 PST, Kiet Ho
no flags
Patch (46.90 KB, patch)
2022-02-10 23:56 PST, Nikos Mouchtaris
no flags
Patch (48.27 KB, patch)
2022-02-11 10:58 PST, Nikos Mouchtaris
dino: review+
ews-feeder: commit-queue-
Patch (47.78 KB, patch)
2022-02-15 15:03 PST, Nikos Mouchtaris
ews-feeder: commit-queue-
Patch (47.78 KB, patch)
2022-02-15 16:47 PST, Nikos Mouchtaris
no flags
Kiet Ho
Comment 1 2021-11-15 16:38:06 PST
EWS Watchlist
Comment 2 2021-11-15 16:38:55 PST
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Kiet Ho
Comment 3 2021-11-15 16:40:35 PST
*** Bug 232760 has been marked as a duplicate of this bug. ***
Kiet Ho
Comment 4 2021-11-15 18:00:24 PST
Kiet Ho
Comment 5 2021-11-19 10:54:34 PST
Kiet Ho
Comment 6 2021-11-19 10:58:56 PST
Still needs to figure out what is the correct serialization format. In particular, is it needed to make the serialization as short as possible? For example, Chrome and this patch serializes "auto none" to "auto none". However, "auto" is equivalent and shorter. On the other hand, "auto none reverse" must be serialized to "auto none reverse" and not "auto reverse", because according to the grammar, if offset-rotate is serialized, then so is offset-path.
Radar WebKit Bug Importer
Comment 7 2021-11-19 11:06:18 PST
Nikos Mouchtaris
Comment 8 2022-02-10 23:56:01 PST
Nikos Mouchtaris
Comment 9 2022-02-11 10:58:37 PST
Dean Jackson
Comment 10 2022-02-15 12:57:26 PST
Comment on attachment 451727 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=451727&action=review > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:2640 > + { > + auto innerList = CSSValueList::createSpaceSeparated(); > + innerList->append(valueForPositionOrAuto(style, style.offsetPosition())); > + innerList->append(valueForPathOperation(style, style.offsetPath(), SVGPathConversion::ForceAbsolute)); > + innerList->append(CSSValuePool::singleton().createValue(style.offsetDistance(), style)); > + innerList->append(valueForOffsetRotate(style.offsetRotate())); > + > + outerList->append(WTFMove(innerList)); > + } Any reason for this being in its own scope? > Source/WebCore/css/StyleProperties.cpp:466 > +static bool isAutoKeyword(const CSSValue& value) > +{ > + if (!is<CSSPrimitiveValue>(value)) > + return false; > + > + auto& primitiveValue = downcast<CSSPrimitiveValue>(value); > + return primitiveValue.isValueID() && primitiveValue.valueID() == CSSValueAuto; > +} Is this really the first/only time we're checking for this keyword in the file? > Source/WebCore/css/StyleProperties.cpp:508 > + if (!offsetDistance.value() || !is<CSSPrimitiveValue>(offsetDistance.value())) Maybe a local variable for offsetDistance.value() to avoid calling it multiple times? > Source/WebCore/css/StyleProperties.cpp:527 > + if (!offsetRotate.value() || !is<CSSOffsetRotateValue>(offsetRotate.value())) Same with this .value()
Nikos Mouchtaris
Comment 11 2022-02-15 15:03:13 PST
Nikos Mouchtaris
Comment 12 2022-02-15 15:04:32 PST
(In reply to Dean Jackson from comment #10) > Comment on attachment 451727 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=451727&action=review > > > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:2640 > > + { > > + auto innerList = CSSValueList::createSpaceSeparated(); > > + innerList->append(valueForPositionOrAuto(style, style.offsetPosition())); > > + innerList->append(valueForPathOperation(style, style.offsetPath(), SVGPathConversion::ForceAbsolute)); > > + innerList->append(CSSValuePool::singleton().createValue(style.offsetDistance(), style)); > > + innerList->append(valueForOffsetRotate(style.offsetRotate())); > > + > > + outerList->append(WTFMove(innerList)); > > + } > > Any reason for this being in its own scope? Fixed. > > > Source/WebCore/css/StyleProperties.cpp:466 > > +static bool isAutoKeyword(const CSSValue& value) > > +{ > > + if (!is<CSSPrimitiveValue>(value)) > > + return false; > > + > > + auto& primitiveValue = downcast<CSSPrimitiveValue>(value); > > + return primitiveValue.isValueID() && primitiveValue.valueID() == CSSValueAuto; > > +} > > Is this really the first/only time we're checking for this keyword in the > file? No reason for this to be its own function. > > > Source/WebCore/css/StyleProperties.cpp:508 > > + if (!offsetDistance.value() || !is<CSSPrimitiveValue>(offsetDistance.value())) > > Maybe a local variable for offsetDistance.value() to avoid calling it > multiple times? Fixed. > > > Source/WebCore/css/StyleProperties.cpp:527 > > + if (!offsetRotate.value() || !is<CSSOffsetRotateValue>(offsetRotate.value())) > > Same with this .value() Fixed.
Nikos Mouchtaris
Comment 13 2022-02-15 16:47:47 PST
EWS
Comment 14 2022-02-15 21:28:19 PST
Committed r289876 (247314@main): <https://commits.webkit.org/247314@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 452109 [details].
Note You need to log in before you can comment on or make changes to this bug.