Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2cee38b913b5098080ec2c65e018c76386a42073
      
https://github.com/WebKit/WebKit/commit/2cee38b913b5098080ec2c65e018c76386a42073
  Author: Ahmad Saleem <[email protected]>
  Date:   2025-01-01 (Wed, 01 Jan 2025)

  Changed paths:
    M LayoutTests/TestExpectations
    M LayoutTests/platform/ios/TestExpectations
    M Source/WebCore/rendering/RenderBox.cpp
    M Source/WebCore/rendering/RenderBox.h
    M Source/WebCore/rendering/RenderTableSection.cpp

  Log Message:
  -----------
  Refuse to break inside replaced content

https://bugs.webkit.org/show_bug.cgi?id=285272
rdar://142224455

Reviewed by Alan Baradlay.

This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.

Merge: https://chromium-review.googlesource.com/c/chromium/src/+/1587887

To determine if a renderer is either block-fragmentable or
monolithic, we used to check isReplacedOrAtomicInline(). This is slightly
inadequate, since what we really want to test, is whether the element is
replaced or not (+ some other things, such as scrollbars and
containment, which we're already taking care of well).

We relied on the fact that isReplacedOrAtomicInline() doesn't really behave
as one would expect: In addition to returning true for atomic inline
level content, it will also return true for certain types of *block*
level content, such as images (which is totally non-intuitive). For
many types of form controls, on the other hand, it will return false,
because many form controls are implemented using RenderBlockFlow-derived
types (and thereby they'd be mistaken for regular non-replaced content).

Use shouldTreatChildAsReplaced() renamed from 
`shouldTreatChildAsReplacedInTableCells`
instead of isReplacedOrAtomicInline(). While the former actually calls the 
latter
(so in a sense we're still indirectly calling isReplacedOrAtomicInline()),
shouldTreatChildAsReplaced() additionally includes form elements manually
implementation, and this is what makes the difference and fixes the problem.

Due to rename, we have to modify all call-sites such as in `RenderTableSection`.

Additionally, to handle fall out for `fieldset`, we need to special case it by 
merging below:

Merge: 
https://source.chromium.org/chromium/chromium/src/+/a5837f4be0f68ff9155ab6a0c46d6afdb1991a44

* LayoutTests/TestExpectations:
* LayoutTests/platform/ios/TestExpectations: Add Platform Specific Expectation
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::shouldTreatChildAsReplaced const):
(WebCore::tableCellShouldHaveZeroInitialSize):
(WebCore::RenderBox::isUnsplittableForPagination const):
(WebCore::RenderBox::shouldTreatChildAsReplacedInTableCells const): Deleted.
* Source/WebCore/rendering/RenderBox.h:
* Source/WebCore/rendering/RenderTableSection.cpp:
(WebCore::shouldFlexCellChild):

Canonical link: https://commits.webkit.org/288354@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to