Changeset 282202 in webkit
- Timestamp:
- Sep 9, 2021, 1:17:06 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/editing/selection/doubleclick-beside-cr-span.html (modified) (2 diffs)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeft-empty-inline-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeft-leading-space-inline-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (modified) (1 diff)
-
Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderInline.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderInline.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r282198 r282202 1 2021-09-09 Antti Koivisto <antti@apple.com> 2 3 RenderInline offsetTop/Left should not switch to legacy layout 4 https://bugs.webkit.org/show_bug.cgi?id=230040 5 6 Reviewed by Alan Bujtas. 7 8 * editing/selection/doubleclick-beside-cr-span.html: 9 10 Update the test for more standards compliant first inline box position. 11 1 12 2021-09-09 Youenn Fablet <youenn@apple.com> 2 13 -
trunk/LayoutTests/editing/selection/doubleclick-beside-cr-span.html
r145849 r282202 150 150 doTest("totest_tab_out", "select4\t"); 151 151 doTest("totest_multiple_whitespaces_out", "select5 "); 152 doTest("totest_linebreak_in", "select6\n" );153 doTest("totest_tab_in", "select7\t" );154 doTest("totest_multiple_whitespaces_in", "select8 " );152 doTest("totest_linebreak_in", "select6\n", getPositionOfNextLineHeadOf("totest_linebreak_in")); 153 doTest("totest_tab_in", "select7\t", getPositionOfNextLineHeadOf("totest_tab_in")); 154 doTest("totest_multiple_whitespaces_in", "select8 ", getPositionOfNextLineHeadOf("totest_multiple_whitespaces_in")); 155 155 156 156 doTest("totest_multiple_word_in_span", "select9 "); … … 177 177 doTest("totest_multiple_whitespaces_out_preline", "select3 "); 178 178 doTest("totest_linebreak_in_preline", "select4\n", getPositionOfNextLineHeadOf("totest_linebreak_in_preline")); 179 doTest("totest_tab_in_preline", "select5\t" );180 doTest("totest_multiple_whitespaces_in_preline", "select6 " );179 doTest("totest_tab_in_preline", "select5\t", getPositionOfNextLineHeadOf("totest_tab_in_preline")); 180 doTest("totest_multiple_whitespaces_in_preline", "select6 ", getPositionOfNextLineHeadOf("totest_multiple_whitespaces_in_preline")); 181 181 182 182 doTest("totest_linebreak_out_nowrap", "select1\n"); -
trunk/LayoutTests/imported/w3c/ChangeLog
r282201 r282202 1 2021-09-09 Antti Koivisto <antti@apple.com> 2 3 RenderInline offsetTop/Left should not switch to legacy layout 4 https://bugs.webkit.org/show_bug.cgi?id=230040 5 6 Reviewed by Alan Bujtas. 7 8 * web-platform-tests/css/cssom-view/offsetTopLeft-empty-inline-expected.txt: 9 * web-platform-tests/css/cssom-view/offsetTopLeft-leading-space-inline-expected.txt: 10 1 11 2021-09-09 Martin Robinson <mrobinson@webkit.org> 2 12 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeft-empty-inline-expected.txt
r247193 r282202 6 6 ref 7 7 8 FAIL offsetTop/Left of empty inline elements should work as if they were not empty: 0 assert_equals: offsetLeft expected 16 but got08 PASS offsetTop/Left of empty inline elements should work as if they were not empty: 0 9 9 FAIL offsetTop/Left of empty inline elements should work as if they were not empty: 1 assert_equals: offsetLeft expected 34 but got 0 10 10 FAIL offsetTop/Left of empty inline elements should work as if they were not empty: 2 assert_equals: offsetLeft expected 34 but got 0 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeft-leading-space-inline-expected.txt
r247193 r282202 6 6 ref 7 7 8 FAIL offsetTop/Left of empty inline elements should work as if they were not empty: 0 assert_equals: offsetLeft expected 16 but got08 PASS offsetTop/Left of empty inline elements should work as if they were not empty: 0 9 9 FAIL offsetTop/Left of empty inline elements should work as if they were not empty: 1 assert_equals: offsetLeft expected 34 but got 0 10 10 FAIL offsetTop/Left of empty inline elements should work as if they were not empty: 2 assert_equals: offsetLeft expected 34 but got 0 -
trunk/Source/WebCore/ChangeLog
r282201 r282202 1 2021-09-09 Antti Koivisto <antti@apple.com> 2 3 RenderInline offsetTop/Left should not switch to legacy layout 4 https://bugs.webkit.org/show_bug.cgi?id=230040 5 6 Reviewed by Alan Bujtas. 7 8 Get position of the LFC inline box. 9 10 * layout/integration/LayoutIntegrationLineLayout.cpp: 11 (WebCore::LayoutIntegration::LineLayout::firstInlineBoxRect const): 12 * layout/integration/LayoutIntegrationLineLayout.h: 13 * rendering/RenderInline.cpp: 14 (WebCore::RenderInline::offsetLeft const): 15 (WebCore::RenderInline::offsetTop const): 16 (WebCore::RenderInline::firstInlineBoxTopLeft const): 17 (WebCore::RenderInline::positionForPoint const): 18 19 Also fix positionForPoint as a failing test revealed a missing LFC path here. 20 21 * rendering/RenderInline.h: 22 1 23 2021-09-09 Martin Robinson <mrobinson@webkit.org> 2 24 -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp
r282150 r282202 412 412 } 413 413 414 LayoutRect LineLayout::firstInlineBoxRect(const RenderInline& renderInline) const 415 { 416 auto& layoutBox = m_boxTree.layoutBoxForRenderer(renderInline); 417 for (auto& run : m_inlineContent->runs) { 418 if (&run.layoutBox() == &layoutBox) 419 return Layout::toLayoutRect(run.logicalRect()); 420 } 421 return { }; 422 } 423 414 424 LayoutRect LineLayout::enclosingBorderBoxRectFor(const RenderInline& renderInline) const 415 425 { -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h
r282150 r282202 97 97 LineIterator lastLine() const; 98 98 99 LayoutRect firstInlineBoxRect(const RenderInline&) const; 99 100 LayoutRect enclosingBorderBoxRectFor(const RenderInline&) const; 100 101 LayoutRect visualOverflowBoundingBoxRectFor(const RenderInline&) const; -
trunk/Source/WebCore/rendering/RenderInline.cpp
r282150 r282202 434 434 LayoutUnit RenderInline::offsetLeft() const 435 435 { 436 return adjustedPositionRelativeToOffsetParent(firstInlineBoxTopLeft()).x(); 437 } 438 439 LayoutUnit RenderInline::offsetTop() const 440 { 441 return adjustedPositionRelativeToOffsetParent(firstInlineBoxTopLeft()).y(); 442 } 443 444 LayoutPoint RenderInline::firstInlineBoxTopLeft() const 445 { 436 446 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 437 if (auto* lineLayout = LayoutIntegration::LineLayout::containing( const_cast<RenderInline&>(*this)))438 lineLayout->flow().ensureLineBoxes();447 if (auto* lineLayout = LayoutIntegration::LineLayout::containing(*this)) 448 return lineLayout->firstInlineBoxRect(*this).location(); 439 449 #endif 440 LayoutPoint topLeft;441 450 if (LegacyInlineBox* firstBox = firstLineBoxIncludingCulling()) 442 topLeft = flooredLayoutPoint(firstBox->topLeft()); 443 return adjustedPositionRelativeToOffsetParent(topLeft).x(); 444 } 445 446 LayoutUnit RenderInline::offsetTop() const 447 { 448 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 449 if (auto* lineLayout = LayoutIntegration::LineLayout::containing(const_cast<RenderInline&>(*this))) 450 lineLayout->flow().ensureLineBoxes(); 451 #endif 452 LayoutPoint topLeft; 453 if (LegacyInlineBox* firstBox = firstLineBoxIncludingCulling()) 454 topLeft = flooredLayoutPoint(firstBox->topLeft()); 455 return adjustedPositionRelativeToOffsetParent(topLeft).y(); 451 return flooredLayoutPoint(firstBox->topLeft()); 452 return { }; 456 453 } 457 454 … … 583 580 // FIXME: Does not deal with relative or sticky positioned inlines (should it?) 584 581 RenderBlock& containingBlock = *this->containingBlock(); 585 if (firstLineBox()) { 586 // This inline actually has a line box. We must have clicked in the border/padding of one of these boxes. We 582 583 auto hasInlineBox = [&] { 584 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 585 if (LayoutIntegration::LineLayout::containing(*this)) 586 return true; 587 #endif 588 return !!firstLineBox(); 589 }; 590 591 if (hasInlineBox()) { 592 // This inline actually has an inline box. We must have clicked in the border/padding of one of these boxes. We 587 593 // should try to find a result by asking our containing block. 588 594 return containingBlock.positionForPoint(point, fragment); -
trunk/Source/WebCore/rendering/RenderInline.h
r282129 r282202 126 126 LayoutUnit offsetWidth() const final { return linesBoundingBox().width(); } 127 127 LayoutUnit offsetHeight() const final { return linesBoundingBox().height(); } 128 LayoutPoint firstInlineBoxTopLeft() const; 128 129 129 130 LayoutRect clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const override;
Note:
See TracChangeset
for help on using the changeset viewer.