| Differences between
and this patch
- a/Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h -16 / +6 lines
Lines 55-63 public: a/Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h_sec1
55
55
56
        InlineLayoutUnit height() const { return ascent + descent; }
56
        InlineLayoutUnit height() const { return ascent + descent; }
57
        friend bool operator==(const AscentAndDescent&, const AscentAndDescent&) = default;
57
        friend bool operator==(const AscentAndDescent&, const AscentAndDescent&) = default;
58
        // FIXME: Remove this.
59
        // We need floor/ceil to match legacy layout integral positioning.
60
        void round();
61
    };
58
    };
62
    InlineLayoutUnit ascent() const { return m_ascentAndDescent.ascent; }
59
    InlineLayoutUnit ascent() const { return m_ascentAndDescent.ascent; }
63
    InlineLayoutUnit descent() const { return m_ascentAndDescent.descent; }
60
    InlineLayoutUnit descent() const { return m_ascentAndDescent.descent; }
Lines 134-146 private: a/Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h_sec2
134
    InlineLayoutUnit logicalWidth() const { return m_logicalRect.width(); }
131
    InlineLayoutUnit logicalWidth() const { return m_logicalRect.width(); }
135
    InlineLayoutUnit logicalHeight() const { return m_logicalRect.height(); }
132
    InlineLayoutUnit logicalHeight() const { return m_logicalRect.height(); }
136
133
137
    // FIXME: Remove legacy rounding.
138
    void setLogicalWidth(InlineLayoutUnit logicalWidth) { m_logicalRect.setWidth(logicalWidth); }
134
    void setLogicalWidth(InlineLayoutUnit logicalWidth) { m_logicalRect.setWidth(logicalWidth); }
139
    void setLogicalHeight(InlineLayoutUnit logicalHeight) { m_logicalRect.setHeight(roundToInt(logicalHeight)); }
135
    void setLogicalHeight(InlineLayoutUnit logicalHeight) { m_logicalRect.setHeight(logicalHeight); }
140
    void setLogicalTop(InlineLayoutUnit logicalTop) { m_logicalRect.setTop(logicalTop >= 0 ? roundToInt(logicalTop) : -roundToInt(-logicalTop)); }
136
    void setLogicalTop(InlineLayoutUnit logicalTop) { m_logicalRect.setTop(logicalTop); }
141
    void setLogicalLeft(InlineLayoutUnit logicalLeft) { m_logicalRect.setLeft(logicalLeft); }
137
    void setLogicalLeft(InlineLayoutUnit logicalLeft) { m_logicalRect.setLeft(logicalLeft); }
142
    void setAscentAndDescent(AscentAndDescent ascentAndDescent) { m_ascentAndDescent = { InlineLayoutUnit(roundToInt(ascentAndDescent.ascent)), InlineLayoutUnit(roundToInt(ascentAndDescent.descent)) }; }
138
    void setAscentAndDescent(AscentAndDescent ascentAndDescent) { m_ascentAndDescent = { InlineLayoutUnit(ascentAndDescent.ascent), InlineLayoutUnit(ascentAndDescent.descent) }; }
143
    void setLayoutBounds(const AscentAndDescent& layoutBounds) { m_layoutBounds = { InlineLayoutUnit(roundToInt(layoutBounds.ascent)), InlineLayoutUnit(roundToInt(layoutBounds.descent)) }; }
139
    void setLayoutBounds(const AscentAndDescent& layoutBounds) { m_layoutBounds = { InlineLayoutUnit(layoutBounds.ascent), InlineLayoutUnit(layoutBounds.descent) }; }
144
    void setInlineBoxContentOffsetForTextBoxTrim(InlineLayoutUnit offset) { m_inlineBoxContentOffsetForTextBoxTrim = offset; }
140
    void setInlineBoxContentOffsetForTextBoxTrim(InlineLayoutUnit offset) { m_inlineBoxContentOffsetForTextBoxTrim = offset; }
145
141
146
    void setIsFirstBox() { m_isFirstWithinLayoutBox = true; }
142
    void setIsFirstBox() { m_isFirstWithinLayoutBox = true; }
Lines 191-198 inline InlineLayoutUnit InlineLevelBox::preferredLineHeight() const a/Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h_sec3
191
        return primarymetricsOfPrimaryFont().lineSpacing();
187
        return primarymetricsOfPrimaryFont().lineSpacing();
192
188
193
    if (m_style.lineHeight.isPercentOrCalculated())
189
    if (m_style.lineHeight.isPercentOrCalculated())
194
        return floorf(minimumValueForLength(m_style.lineHeight, fontSize()));
190
        return minimumValueForLength(m_style.lineHeight, fontSize());
195
    return floorf(m_style.lineHeight.value());
191
    return m_style.lineHeight.value();
196
}
192
}
197
193
198
inline bool InlineLevelBox::hasLineBoxRelativeAlignment() const
194
inline bool InlineLevelBox::hasLineBoxRelativeAlignment() const
Lines 201-212 inline bool InlineLevelBox::hasLineBoxRelativeAlignment() const a/Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h_sec4
201
    return verticalAlignment == VerticalAlign::Top || verticalAlignment == VerticalAlign::Bottom;
197
    return verticalAlignment == VerticalAlign::Top || verticalAlignment == VerticalAlign::Bottom;
202
}
198
}
203
199
204
inline void InlineLevelBox::AscentAndDescent::round()
205
{
206
    ascent = floorf(ascent);
207
    descent = ceilf(descent);
208
}
209
210
}
200
}
211
}
201
}
212
202
- a/Source/WebCore/layout/formattingContexts/inline/InlineLevelBoxInlines.h -1 / +1 lines
Lines 67-73 inline InlineLevelBox::InlineLevelBox(const Box& layoutBox, const RenderStyle& s a/Source/WebCore/layout/formattingContexts/inline/InlineLevelBoxInlines.h_sec1
67
        }
67
        }
68
68
69
        if (hasAboveTextEmphasis || hasUnderTextEmphasis) {
69
        if (hasAboveTextEmphasis || hasUnderTextEmphasis) {
70
            InlineLayoutUnit annotationSize = roundToInt(style.fontCascade().floatEmphasisMarkHeight(style.textEmphasisMarkString()));
70
            InlineLayoutUnit annotationSize = style.fontCascade().floatEmphasisMarkHeight(style.textEmphasisMarkString());
71
            m_annotation = { hasAboveTextEmphasis ? annotationSize : 0, hasAboveTextEmphasis ? 0 : annotationSize };
71
            m_annotation = { hasAboveTextEmphasis ? annotationSize : 0, hasAboveTextEmphasis ? 0 : annotationSize };
72
        }
72
        }
73
    };
73
    };
- a/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp -9 / +6 lines
Lines 179-186 InlineLevelBox::AscentAndDescent LineBoxBuilder::enclosingAscentDescentWithFallb a/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp_sec1
179
        maxAscent = std::max(maxAscent, ascentAndDescent.ascent);
179
        maxAscent = std::max(maxAscent, ascentAndDescent.ascent);
180
        maxDescent = std::max(maxDescent, ascentAndDescent.descent);
180
        maxDescent = std::max(maxDescent, ascentAndDescent.descent);
181
    }
181
    }
182
    // We need floor/ceil to match legacy layout integral positioning.
182
    return { maxAscent, maxDescent };
183
    return { floorf(maxAscent), ceilf(maxDescent) };
184
}
183
}
185
184
186
void LineBoxBuilder::setLayoutBoundsForInlineBox(InlineLevelBox& inlineBox, FontBaseline fontBaseline) const
185
void LineBoxBuilder::setLayoutBoundsForInlineBox(InlineLevelBox& inlineBox, FontBaseline fontBaseline) const
Lines 223-236 void LineBoxBuilder::setLayoutBoundsForInlineBox(InlineLevelBox& inlineBox, Font a/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp_sec2
223
        ascent += inlineBoxGeometry.marginBorderAndPaddingBefore();
222
        ascent += inlineBoxGeometry.marginBorderAndPaddingBefore();
224
        descent += inlineBoxGeometry.marginBorderAndPaddingAfter();
223
        descent += inlineBoxGeometry.marginBorderAndPaddingAfter();
225
    }
224
    }
226
    inlineBox.setLayoutBounds({ floorf(ascent), ceilf(descent) });
225
    inlineBox.setLayoutBounds({ ascent, descent });
227
}
226
}
228
227
229
void LineBoxBuilder::setVerticalPropertiesForInlineLevelBox(const LineBox& lineBox, InlineLevelBox& inlineLevelBox) const
228
void LineBoxBuilder::setVerticalPropertiesForInlineLevelBox(const LineBox& lineBox, InlineLevelBox& inlineLevelBox) const
230
{
229
{
231
    auto setVerticalProperties = [&] (InlineLevelBox::AscentAndDescent ascentAndDescent, bool applyLegacyRounding = true) {
230
    auto setVerticalProperties = [&] (InlineLevelBox::AscentAndDescent ascentAndDescent) {
232
        if (applyLegacyRounding)
233
            ascentAndDescent.round();
234
        inlineLevelBox.setAscentAndDescent(ascentAndDescent);
231
        inlineLevelBox.setAscentAndDescent(ascentAndDescent);
235
        inlineLevelBox.setLayoutBounds(ascentAndDescent);
232
        inlineLevelBox.setLayoutBounds(ascentAndDescent);
236
        inlineLevelBox.setLogicalHeight(ascentAndDescent.height());
233
        inlineLevelBox.setLogicalHeight(ascentAndDescent.height());
Lines 314-320 void LineBoxBuilder::setVerticalPropertiesForInlineLevelBox(const LineBox& lineB a/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp_sec3
314
            }
311
            }
315
            return marginBoxHeight;
312
            return marginBoxHeight;
316
        }();
313
        }();
317
        setVerticalProperties({ ascent, marginBoxHeight - ascent }, false);
314
        setVerticalProperties({ ascent, marginBoxHeight - ascent });
318
        return;
315
        return;
319
    }
316
    }
320
    ASSERT_NOT_REACHED();
317
    ASSERT_NOT_REACHED();
Lines 538-544 void LineBoxBuilder::adjustInlineBoxHeightsForLineBoxContainIfApplicable(LineBox a/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp_sec4
538
        auto mayShrinkLineBox = inlineBox->isRootInlineBox() ? !lineBoxContain.contains(LineBoxContain::Block) : true;
535
        auto mayShrinkLineBox = inlineBox->isRootInlineBox() ? !lineBoxContain.contains(LineBoxContain::Block) : true;
539
        auto ascent = mayShrinkLineBox ? enclosingAscentDescentForInlineBox.ascent : std::max(enclosingAscentDescentForInlineBox.ascent, inlineBoxLayoutBounds.ascent);
536
        auto ascent = mayShrinkLineBox ? enclosingAscentDescentForInlineBox.ascent : std::max(enclosingAscentDescentForInlineBox.ascent, inlineBoxLayoutBounds.ascent);
540
        auto descent = mayShrinkLineBox ? enclosingAscentDescentForInlineBox.descent : std::max(enclosingAscentDescentForInlineBox.descent, inlineBoxLayoutBounds.descent);
537
        auto descent = mayShrinkLineBox ? enclosingAscentDescentForInlineBox.descent : std::max(enclosingAscentDescentForInlineBox.descent, inlineBoxLayoutBounds.descent);
541
        inlineBox->setLayoutBounds({ ceilf(ascent), ceilf(descent) });
538
        inlineBox->setLayoutBounds({ ascent, descent });
542
    }
539
    }
543
}
540
}
544
541
Lines 583-589 void LineBoxBuilder::adjustIdeographicBaselineIfApplicable(LineBox& lineBox) a/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp_sec5
583
            setVerticalPropertiesForInlineLevelBox(lineBox, inlineLevelBox);
580
            setVerticalPropertiesForInlineLevelBox(lineBox, inlineLevelBox);
584
        else if (inlineLevelBox.isAtomicInlineLevelBox()) {
581
        else if (inlineLevelBox.isAtomicInlineLevelBox()) {
585
            auto inlineLevelBoxHeight = inlineLevelBox.logicalHeight();
582
            auto inlineLevelBoxHeight = inlineLevelBox.logicalHeight();
586
            InlineLayoutUnit ideographicBaseline = roundToInt(inlineLevelBoxHeight / 2);
583
            InlineLayoutUnit ideographicBaseline = inlineLevelBoxHeight / 2;
587
            // Move the baseline position but keep the same logical height.
584
            // Move the baseline position but keep the same logical height.
588
            inlineLevelBox.setAscentAndDescent({ ideographicBaseline, inlineLevelBoxHeight - ideographicBaseline });
585
            inlineLevelBox.setAscentAndDescent({ ideographicBaseline, inlineLevelBoxHeight - ideographicBaseline });
589
            inlineLevelBox.setLayoutBounds({ ideographicBaseline, inlineLevelBoxHeight - ideographicBaseline });
586
            inlineLevelBox.setLayoutBounds({ ideographicBaseline, inlineLevelBoxHeight - ideographicBaseline });
- a/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp -3 / +3 lines
Lines 185-191 void InlineDisplayContentBuilder::appendTextDisplayBox(const Line::Run& lineRun, a/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp_sec1
185
        addLetterSpacingOverflow();
185
        addLetterSpacingOverflow();
186
186
187
        auto addStrokeOverflow = [&] {
187
        auto addStrokeOverflow = [&] {
188
            inkOverflow.inflate(ceilf(style.computedStrokeWidth(m_initialContaingBlockSize)));
188
            inkOverflow.inflate(style.computedStrokeWidth(m_initialContaingBlockSize));
189
        };
189
        };
190
        addStrokeOverflow();
190
        addStrokeOverflow();
191
191
Lines 203-210 void InlineDisplayContentBuilder::appendTextDisplayBox(const Line::Run& lineRun, a/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp_sec2
203
            auto enclosingAscentAndDescent = TextUtil::enclosingGlyphBoundsForText(StringView(content).substring(text->start, text->length), style);
203
            auto enclosingAscentAndDescent = TextUtil::enclosingGlyphBoundsForText(StringView(content).substring(text->start, text->length), style);
204
            // FIXME: Take fallback fonts into account.
204
            // FIXME: Take fallback fonts into account.
205
            auto& fontMetrics = style.metricsOfPrimaryFont();
205
            auto& fontMetrics = style.metricsOfPrimaryFont();
206
            auto topOverflow = std::max(0.f, ceilf(-enclosingAscentAndDescent.ascent) - fontMetrics.ascent());
206
            auto topOverflow = std::max(0.f, -enclosingAscentAndDescent.ascent - fontMetrics.ascent());
207
            auto bottomOverflow = std::max(0.f, ceilf(enclosingAscentAndDescent.descent) - fontMetrics.descent());
207
            auto bottomOverflow = std::max(0.f, enclosingAscentAndDescent.descent - fontMetrics.descent());
208
            inkOverflow.inflate(topOverflow, { }, bottomOverflow, { });
208
            inkOverflow.inflate(topOverflow, { }, bottomOverflow, { });
209
        };
209
        };
210
        addGlyphOverflow();
210
        addGlyphOverflow();
- a/Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp -1 / +1 lines
Lines 427-433 void LineLayout::updateLayoutBoxDimensions(const RenderBox& replacedOrInlineBloc a/Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp_sec1
427
    }();
427
    }();
428
    if (hasNonSyntheticBaseline) {
428
    if (hasNonSyntheticBaseline) {
429
        auto baseline = replacedOrInlineBlock.baselinePosition(AlphabeticBaseline, false /* firstLine */, blockFlowDirection == BlockFlowDirection::TopToBottom || blockFlowDirection == BlockFlowDirection::BottomToTop ? HorizontalLine : VerticalLine, PositionOnContainingLine);
429
        auto baseline = replacedOrInlineBlock.baselinePosition(AlphabeticBaseline, false /* firstLine */, blockFlowDirection == BlockFlowDirection::TopToBottom || blockFlowDirection == BlockFlowDirection::BottomToTop ? HorizontalLine : VerticalLine, PositionOnContainingLine);
430
        layoutBox.setBaselineForIntegration(roundToInt(baseline));
430
        layoutBox.setBaselineForIntegration(baseline);
431
    }
431
    }
432
432
433
    if (auto* shapeOutsideInfo = replacedOrInlineBlock.shapeOutsideInfo())
433
    if (auto* shapeOutsideInfo = replacedOrInlineBlock.shapeOutsideInfo())
- a/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py +1 lines
Lines 212-217 class LayoutTestRunner(object): a/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py_sec1
212
                self._mark_interrupted_tests_as_skipped(run_results)
212
                self._mark_interrupted_tests_as_skipped(run_results)
213
                raise TestRunInterruptedException(message)
213
                raise TestRunInterruptedException(message)
214
214
215
        self._options.exit_after_n_failures = None
215
        interrupt_if_at_failure_limit(
216
        interrupt_if_at_failure_limit(
216
            self._options.exit_after_n_failures,
217
            self._options.exit_after_n_failures,
217
            run_results.unexpected_failures,
218
            run_results.unexpected_failures,

Return to Bug 261212