Bug 172801 - Replace hardcoded <hr> rendering rules with 'overflow: hidden' UA style
Summary: Replace hardcoded <hr> rendering rules with 'overflow: hidden' UA style
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Karl Dubost
URL:
Keywords: FromImplementor, InRadar
: 245174 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-06-01 04:17 PDT by Simon Pieters (:zcorpan)
Modified: 2022-12-27 18:12 PST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Pieters (:zcorpan) 2017-06-01 04:17:58 PDT
https://github.com/whatwg/html/issues/2715
https://github.com/whatwg/html/pull/2724
https://github.com/w3c/web-platform-tests/pull/6115

The hardcoded rendering rules for <hr> should be removed in favor of having 'overflow: hidden' in the UA stylesheet, which matches EdgeHTML. See https://github.com/whatwg/html/issues/2715#issuecomment-304881067 for rationale.

Failing tests in Safari 10.0 per https://github.com/w3c/web-platform-tests/pull/6115#issuecomment-305211101 :

/html/rendering/non-replaced-elements/the-hr-element-0/hr.html
color	FAIL	assert_equals: expected "rgb(128, 128, 128)" but got "rgb(0, 0, 0)"
overflow	FAIL	assert_equals: expected "hidden" but got "visible"

/html/rendering/non-replaced-elements/the-hr-element-0/setting-overflow-visible.html
control	FAIL	assert_equals: hr.clientHeight expected 50 but got 0
overflow: visible	FAIL	assert_equals: hr.offsetLeft expected 0 but got 50

In Safari TP this test also fails in addition to the above:

/html/rendering/non-replaced-elements/the-hr-element-0/hr.html
Fail	unicodeBidi	assert_equals: expected "isolate" but got "normal"


(The failure for 'color' is discussed in https://github.com/whatwg/html/issues/2727 and can be ignored for this issue.)
Comment 2 Ahmad Saleem 2022-09-25 06:49:14 PDT
*** Bug 245174 has been marked as a duplicate of this bug. ***
Comment 3 Radar WebKit Bug Importer 2022-09-26 11:26:13 PDT
<rdar://problem/100420364>
Comment 4 Karl Dubost 2022-09-26 15:10:45 PDT
The line to modify

https://searchfox.org/wubkat/rev/cf0cfbaf1ad7728a145c06e3539170870bbb913f/Source/WebCore/rendering/RenderBox.cpp#4951-4954

To remove isLegend()

bool RenderBox::avoidsFloats() const
{
    return isReplacedOrInlineBlock() || isHR() || isLegend() || isFieldset() || createsNewFormattingContext();
}

Then 
https://searchfox.org/wubkat/rev/cf0cfbaf1ad7728a145c06e3539170870bbb913f/Source/WebCore/css/html.css#101-109

Add to hr

overflow: hidden;
unicode-bidi: isolate;


Then a lot of refactoring of tests probably.
Comment 5 Karl Dubost 2022-09-26 15:25:28 PDT
Pull request: https://github.com/WebKit/WebKit/pull/4724
Comment 6 EWS 2022-12-06 16:40:06 PST
Committed 257446@main (619bc6e35423): <https://commits.webkit.org/257446@main>

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