Bug 186965 - transform-origin should not accept 4 lengths
Summary: transform-origin should not accept 4 lengths
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 11
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Joonghun Park
URL:
Keywords: FromImplementor, InRadar
Depends on:
Blocks:
 
Reported: 2018-06-23 03:21 PDT by Eric Willigers
Modified: 2021-09-13 14:34 PDT (History)
12 users (show)

See Also:


Attachments
Patch (3.63 KB, patch)
2021-09-13 08:18 PDT, Joonghun Park
no flags Details | Formatted Diff | Diff
Move range.atEnd() into consumeTransformOrigin() (3.71 KB, patch)
2021-09-13 08:58 PDT, Joonghun Park
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>