Changeset 238420 in webkit


Ignore:
Timestamp:
Nov 21, 2018 9:36:32 AM (5 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Use contains and containsAll in InlineFormattingContext::splitInlineRunIfNeeded consistently
https://bugs.webkit.org/show_bug.cgi?id=191890

Rearrange the comment numbers to match the logic below.

Reviewed by Antti Koivisto.

  • layout/inlineformatting/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r238419 r238420  
     12018-11-21  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Use contains and containsAll in InlineFormattingContext::splitInlineRunIfNeeded consistently
     4        https://bugs.webkit.org/show_bug.cgi?id=191890
     5
     6        Rearrange the comment numbers to match the logic below.
     7
     8        Reviewed by Antti Koivisto.
     9
     10        * layout/inlineformatting/InlineFormattingContext.cpp:
     11        (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
     12
    1132018-11-20  Dean Jackson  <dino@apple.com>
    214
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp

    r238415 r238420  
    180180        };
    181181
    182         // 1. Inline element does not require run breaking -> add current inline element to uncommitted. Jump to the next element.
     182        // 1. Break before/after -> requires dedicated run -> commit what we've got so far and also commit the current inline element as a separate inline run.
    183183        // 2. Break at the beginning of the inline element -> commit what we've got so far. Current element becomes the first uncommitted.
    184184        // 3. Break at the end of the inline element -> commit what we've got so far including the current element.
    185         // 4. Break before/after -> requires dedicated run -> commit what we've got so far and also commit the current inline element as a separate inline run.
     185        // 4. Inline element does not require run breaking -> add current inline element to uncommitted. Jump to the next element.
    186186        auto detachingRules = inlineItem.detachingRules();
    187187
    188         // #4
     188        // #1
    189189        if (detachingRules.containsAll({ InlineItem::DetachingRule::BreakAtStart, InlineItem::DetachingRule::BreakAtEnd })) {
    190190            commit();
     
    195195
    196196        // #2
    197         if (detachingRules == InlineItem::DetachingRule::BreakAtStart)
     197        if (detachingRules.contains(InlineItem::DetachingRule::BreakAtStart))
    198198            commit();
    199199
    200200        // Add current inline item to uncommitted.
     201        // #3 and #4
    201202        if (!uncommitted)
    202203            uncommitted = Uncommitted { &inlineItem, &inlineItem, 0 };
     
    205206
    206207        // #3
    207         if (detachingRules == InlineItem::DetachingRule::BreakAtEnd)
     208        if (detachingRules.contains(InlineItem::DetachingRule::BreakAtEnd))
    208209            commit();
    209210    }
Note: See TracChangeset for help on using the changeset viewer.