Bug 147795

Summary: Error handling padding in box-sizing calculations
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ahmad.saleem792, bfulgham, ddkilzer, hyatt, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: BlinkMergeCandidate, InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Test case showing the improper behavior none

Description Brent Fulgham 2015-08-07 15:26:01 PDT
Created attachment 258534 [details]
Test case showing the improper behavior

WebKit seems to be taking padding into account when performing height calculations, even when in standards mode using "box-sizing: content-box".
Comment 1 zalan 2015-08-13 10:54:42 PDT
Blink changed available logical height behavior about a year ago. It returns content box height now (vs. border box height)

https://src.chromium.org/viewvc/blink?revision=178693&view=revision

@@ -3085,7 +3061,7 @@ LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(Length logicalHeight) co
 
 LayoutUnit RenderBox::availableLogicalHeight(AvailableLogicalHeightType heightType) const
 {
-    return constrainLogicalHeightByMinMax(availableLogicalHeightUsing(style().logicalHeight(), heightType), -1);
+    return constrainContentBoxLogicalHeightByMinMax(availableLogicalHeightUsing(style().logicalHeight(), heightType), -1);
 }
Comment 2 Radar WebKit Bug Importer 2016-09-08 14:06:46 PDT
<rdar://problem/28213830>
Comment 3 Ahmad Saleem 2022-10-31 06:23:51 PDT
I am not able to reproduce this bug using Safari 16.1 and the "red" square is center similar to Chrome Canary 109 and Firefox Nightly 108.

Do we need to anything else? Thanks!
Comment 4 Ahmad Saleem 2022-12-17 03:33:51 PST
Also we are passing the test (in STP160) from the Chromium patch of Comment 01:

Test Case - https://jsfiddle.net/0ytgLhwn/

Do we need to do anything else?
Comment 5 zalan 2022-12-21 13:49:08 PST
(In reply to Ahmad Saleem from comment #4)
> Also we are passing the test (in STP160) from the Chromium patch of Comment
> 01:
> 
> Test Case - https://jsfiddle.net/0ytgLhwn/
> 
> Do we need to do anything else?
Nope, this looks to have progressed. Thanks!