Bug 186965

Summary: transform-origin should not accept 4 lengths
Product: WebKit Reporter: Eric Willigers <ericwilligers>
Component: CSSAssignee: Joonghun Park <jh718.park>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, dino, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, jh718.park, koivisto, macpherson, menard, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: FromImplementor, InRadar
Version: Safari 11   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Move range.atEnd() into consumeTransformOrigin() none

Description Eric Willigers 2018-06-23 03:21:42 PDT
transform-origin accepts 1, 2, or 3 values.
https://drafts.csswg.org/css-transforms/#propdef-transform-origin

Unfortunately, WebKit allows '1px 2px 3px 4x' and silently discards the last length.

Example:
http://jsfiddle.net/ericwilligers/me38g7ax/

Found while preparing Web Platform Test
https://github.com/web-platform-tests/wpt/pull/11633
Comment 1 Joonghun Park 2021-09-13 08:18:17 PDT
Created attachment 438040 [details]
Patch
Comment 2 Simon Fraser (smfr) 2021-09-13 08:35:06 PDT
Comment on attachment 438040 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=438040&action=review

> Source/WebCore/css/parser/CSSPropertyParser.cpp:6139
> +        return consumeTransformOrigin(important) && m_range.atEnd();

I think the range.atEnd() check should move inside consumeTransformOrigin().
Comment 3 Joonghun Park 2021-09-13 08:40:45 PDT
(In reply to Simon Fraser (smfr) from comment #2)
> Comment on attachment 438040 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=438040&action=review
> 
> > Source/WebCore/css/parser/CSSPropertyParser.cpp:6139
> > +        return consumeTransformOrigin(important) && m_range.atEnd();
> 
> I think the range.atEnd() check should move inside consumeTransformOrigin().

Ok, I will move the range.atEnd() into consumeTransformOrigin().
Comment 4 Joonghun Park 2021-09-13 08:58:46 PDT
Created attachment 438045 [details]
Move range.atEnd() into consumeTransformOrigin()
Comment 5 EWS 2021-09-13 14:33:05 PDT
Committed r282359 (241622@main): <https://commits.webkit.org/241622@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 438045 [details].
Comment 6 Radar WebKit Bug Importer 2021-09-13 14:34:21 PDT
<rdar://problem/83072923>