Bug 264770 - Replaced elements avoid floats, including check boxes and radio boxes
Summary: Replaced elements avoid floats, including check boxes and radio boxes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-11-13 13:03 PST by Ahmad Saleem
Modified: 2024-01-15 11:12 PST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ahmad Saleem 2023-11-13 13:03:42 PST
HI Team,

While going through Blink's commit, I came across another failing test:

Blink Commit: https://chromium.googlesource.com/chromium/blink/+/141235180acceb7bbdd50a315c31171dfcf55a07

Test Case: https://jsfiddle.net/baLmywgu/show

^ Fails in Firefox Nightly 121 as well.

Another Test Case (from Chrome Monorail bug): https://codepen.io/chrisbank/pen/DzmVXY

^ The checkbox & radio are not same place as 'Chrome Canary 121' and Firefox Nightly 121.

Just wanted to raise, so we can fix it.

Thanks!
Comment 1 Ahmad Saleem 2023-11-13 13:07:25 PST
static bool isReplacedElement(Element* element)
{
    // Checkboxes and radioboxes are not isReplaced() nor do they have their own renderer in which to override avoidFloats().
    return element && element->isElementNode() && element->isFormControlElement();
}
bool RenderBox::avoidsFloats() const
{
    return isReplacedOrInlineBlock() || isReplacedElement(element()) || isLegend() || isFieldset() || createsNewFormattingContext();
}

^ This compiles and fix the bug.
Comment 2 Radar WebKit Bug Importer 2023-11-20 13:04:14 PST
<rdar://problem/118660695>
Comment 3 EWS 2024-01-15 11:12:56 PST
Committed 273047@main (7adc3dd2a226): <https://commits.webkit.org/273047@main>

Reviewed commits have been landed. Closing PR #22762 and removing active labels.