WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
202501
Support percentages in the scale() transform functions, and the scale property
https://bugs.webkit.org/show_bug.cgi?id=202501
Summary
Support percentages in the scale() transform functions, and the scale property
Dean Jackson
Reported
2019-10-02 16:34:37 PDT
https://github.com/w3c/csswg-drafts/issues/3399
transform: scale(ABC) can now take percentage values for ABC.
Attachments
Patch
(22.29 KB, patch)
2021-09-07 09:57 PDT
,
Simon Fraser (smfr)
sam
: review+
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(22.98 KB, patch)
2021-09-07 13:05 PDT
,
Simon Fraser (smfr)
no flags
Details
Formatted Diff
Diff
Patch
(30.73 KB, patch)
2021-09-07 20:25 PDT
,
Simon Fraser (smfr)
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2019-10-02 16:35:01 PDT
<
rdar://problem/55929521
>
Simon Fraser (smfr)
Comment 2
2021-09-07 09:57:22 PDT
Created
attachment 437518
[details]
Patch
Simon Fraser (smfr)
Comment 3
2021-09-07 10:36:09 PDT
Looks like I have an issue about losing calc() in computed style.
Sam Weinig
Comment 4
2021-09-07 10:39:18 PDT
Comment on
attachment 437518
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=437518&action=review
> Source/WebCore/ChangeLog:9 > + on the scale property. These value are converted by numbers by dividing by 100
"converted by numbers" -> "converted to numbers".
> Source/WebCore/css/parser/CSSPropertyParser.cpp:1796 > +static bool consumeNumbersOrPercentsDividedBy100(CSSParserTokenRange& args, RefPtr<CSSFunctionValue>& transformValue, unsigned numberOfArguments)
RefPtr<CSSFunctionValue> -> Ref<CSSFunctionValue>. I think also naming this something about being a comma separated list would be good.
> Source/WebCore/css/parser/CSSPropertyParser.cpp:1799 > + RefPtr<CSSPrimitiveValue> parsedValue = consumeNumberOrPercentDividedBy100(args, ValueRange::All);
I would use auto here.
> Source/WebCore/css/parser/CSSPropertyParser.cpp:1805 > + } while (numberOfArguments);
You could make this a tad more efficient (remove a branch) if you did it like: auto parseNumberAndAppend = [&] { auto parsedValue = consumeNumberOrPercentDividedBy100(args, ValueRange::All); if (!parsedValue) return false; transformValue->append(parsedValue.releaseNonNull()); --numberOfArguments; return true; }; if (!parseNumberAndAppend()) return false; while (numberOfArguments) { if (!consumeCommaIncludingWhitespace(args)) return false; if (!parseNumberAndAppend()) return false; } return true;
Simon Fraser (smfr)
Comment 5
2021-09-07 13:05:30 PDT
Created
attachment 437547
[details]
Patch
Simon Fraser (smfr)
Comment 6
2021-09-07 20:25:37 PDT
Created
attachment 437588
[details]
Patch
EWS
Comment 7
2021-09-08 08:34:45 PDT
Committed
r282144
(
241441@main
): <
https://commits.webkit.org/241441@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 437588
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug