[Webkit-unassigned] [Bug 181716] Parse calc() in CSS media queries

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 21 09:53:09 PST 2018


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

--- Comment #37 from Chris Nardi <christopherncarmel at hotmail.com> ---
Comment on attachment 331736
  --> https://bugs.webkit.org/attachment.cgi?id=331736
Patch

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

>> Source/WebCore/css/MediaQueryExpression.cpp:185
>> +        return firstValue;
> 
> These could be written somewhat more compactly as
> 
> if (auto value = CSSPropertyParserHelpers::consumeLength(range, HTMLStandardMode, ValueRangeNonNegative)) 
>     return value;

Done.

>> Source/WebCore/css/parser/MediaQueryParser.cpp:252
>> +        ((this)->*(m_state))(type, token, range);
> 
> I think a good refactoring would be to make State a normal enum class instead of a function pointer and replace this code with a switch (m_state) that simply invokes the right function. Then different cases could have different arguments (eliminating unused parameters and the no-op done() function) and the whole thing would be more readable.
> 
> That can be left for future patches though.

Yeah, makes sense; I can try for a follow-up patch with this.

-- 
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/20180121/b2139300/attachment.html>


More information about the webkit-unassigned mailing list