Bug 274605 - Remove 'presentational hints' from `width` attribute for `<hr>`
Summary: Remove 'presentational hints' from `width` attribute for `<hr>`
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-05-23 11:25 PDT by Ahmad Saleem
Modified: 2024-05-23 17:12 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ahmad Saleem 2024-05-23 11:25:43 PDT
Hi Team,

While looking into WPT failures:

(1) - https://wpt.fyi/results/html/rendering/non-replaced-elements/the-hr-element-0/width.html?label=master&label=experimental&aligned&q=the-hr-element
(2) - https://wpt.fyi/results/html/rendering/dimension-attributes.html?label=master&label=experimental&aligned&q=safari%3Afail%20%3Chr

^ In (2) - we are failing few e.g. <hr width="0%"> mapping to <hr> width property

Web-Spec: https://html.spec.whatwg.org/#the-hr-element-2

"The width attribute on an hr element maps to the dimension property 'width' on the element."

These failure stems from not adhering to above spec here:

https://searchfox.org/wubkat/rev/aa28356f83b8a683976102106065dbd46f9a0299/Source/WebCore/html/HTMLHRElement.cpp#87

    case AttributeNames::widthAttr:
        if (auto valueInteger = parseHTMLInteger(value); valueInteger && !*valueInteger)
            addPropertyToPresentationalHintStyle(style, CSSPropertyWidth, 0, CSSUnitType::CSS_PX);
        else
            addHTMLLengthToStyle(style, CSSPropertyWidth, value);
        break;

if I change this to below by removing 'Presentational Hint' - we start passing above tests:

    case AttributeNames::widthAttr:
        addHTMLLengthToStyle(style, CSSPropertyWidth, value);
        break;

__

Just raising so we can fix it.

Thanks!
Comment 1 EWS 2024-05-23 17:11:19 PDT
Committed 279245@main (fe5976c30783): <https://commits.webkit.org/279245@main>

Reviewed commits have been landed. Closing PR #29000 and removing active labels.
Comment 2 Radar WebKit Bug Importer 2024-05-23 17:12:29 PDT
<rdar://problem/128647444>