[Webkit-unassigned] [Bug 203312] Implement the CSS exponent functions: pow(), sqrt(), hypot()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 17 19:22:04 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=203312

--- Comment #12 from Kevin Turner <kevinturner at utexas.edu> ---
Comment on attachment 417738
  --> https://bugs.webkit.org/attachment.cgi?id=417738
Patch

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

>>> Source/WebCore/css/CSSCalculationValue.cpp:792
>>> +    bool canHaveOnlyChild() const { return m_operator == CalcOperator::Hypot || m_operator == CalcOperator::Sqrt; }
>> 
>> This name is a bit ambiguous. Is it "can have only one child"? Maybe allowsSingleChild()?
> 
> I think this name isn’t quite right. This returns true for operators that are not identity functions when they have a single child. Not, as the title implies, the only operators that allow a single child. So we should use a different name. Maybe we should also reverse the sense of the function. It’s about an optimization in how we implement the other functions like min and max.

Perhaps something like 'canBehaveAsIdentity()'? hypot() and sqrt() can not behave as identity functions under any circumstance whereas min/max() can when it has one parameter. Would a direct check like 'isIdentity()' be inappropriate here? We could check that the m_children vector is of size 1 and the operator either min or max.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210118/97f6cea0/attachment.htm>


More information about the webkit-unassigned mailing list