[Webkit-unassigned] [Bug 218093] [css-logical] Implement logical border-radius

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 7 13:39:09 PST 2021


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

--- Comment #42 from Oriol Brufau <obrufau at igalia.com> ---
Comment on attachment 417005
  --> https://bugs.webkit.org/attachment.cgi?id=417005
Patch

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

> Source/WebCore/platform/text/WritingMode.h:90
> +    return isFlippedTextFlow(textflow) != isVerticalTextFlow(textflow);

You could make isFlippedLinesWritingMode call this function to avoid duplicating the logic:

    constexpr inline bool isFlippedLinesWritingMode(WritingMode writingMode)
    {
        return isFlippedLinesTextFlow(makeTextFlow(writingMode, TextDirection::LTR));
    }

> Source/WebCore/platform/text/WritingMode.h:190
> +    BoxCorner physicalCorner = static_cast<BoxCorner>(logicalBoxCorner);

physicalCorner doesn't seem needed.

> Source/WebCore/platform/text/WritingMode.h:229
> +    return physicalCorner;

So I guess you are returning physicalCorner because some compiler was failing to notice that all cases are covered?
Then I would add an ASSERT_NOT_REACHED() and just return some random corner like BoxCorner::TopLeft.
I don't think static_cast<BoxCorner>(logicalBoxCorner) makes much sense.

Or just replace the entire switch with

    bool isBlockStart = logicalBoxCorner == LogicalBoxCorner::StartStart || logicalBoxCorner == LogicalBoxCorner::StartEnd;
    bool isInlineStart = logicalBoxCorner == LogicalBoxCorner::StartStart || logicalBoxCorner == LogicalBoxCorner::EndStart;
    if (isBlockStart == isFlippedTextFlow(textflow)) {
        if (isInlineStart == isReversedTextFlow(textflow))
            return BoxCorner::BottomRight;
    } else if (isInlineStart != isReversedTextFlow(textflow)) {
       return BoxCorner::TopLeft;
    }
    if (isBlockStart == isFlippedLinesTextFlow(textflow))
        return BoxCorner::BottomLeft;
    return BoxCorner::TopRight;

-- 
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/20210107/530d299d/attachment.htm>


More information about the webkit-unassigned mailing list