Bug 239029

Summary: Line clamp specific line-count code should be in RenderDeprecatedFlexibleBox
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, changseok, darin, esprehn+autocc, ews-watchlist, glenn, koivisto, kondapallykalyan, pdr, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
ews-feeder: commit-queue-
Patch
none
Patch none

Description zalan 2022-04-09 06:54:17 PDT
ssia
Comment 1 zalan 2022-04-09 06:58:27 PDT
Created attachment 457162 [details]
Patch
Comment 2 zalan 2022-04-09 07:08:40 PDT
Created attachment 457163 [details]
Patch
Comment 3 zalan 2022-04-09 09:23:21 PDT
Created attachment 457167 [details]
Patch
Comment 4 zalan 2022-04-09 21:15:08 PDT
Created attachment 457187 [details]
Patch
Comment 5 zalan 2022-04-10 06:59:41 PDT
Created attachment 457199 [details]
Patch
Comment 6 EWS 2022-04-10 14:57:30 PDT
Committed r292689 (249481@main): <https://commits.webkit.org/249481@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 457199 [details].
Comment 7 Radar WebKit Bug Importer 2022-04-10 14:58:16 PDT
<rdar://problem/91539294>
Comment 8 Darin Adler 2022-04-11 10:17:23 PDT
Comment on attachment 457199 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=457199&action=review

> Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:1035
> +            maxLineCount = std::max<int>(maxLineCount, lineCountFor(downcast<RenderBlockFlow>(*child)));

Chopping the size_t down to int; what makes that safe? Should the function check for overflow and return an int?

> Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:1050
> +        int lineCount = lineCountFor(blockChild);

Ditto.
Comment 9 zalan 2022-04-15 09:19:06 PDT
(In reply to Darin Adler from comment #8)
> Comment on attachment 457199 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=457199&action=review
> 
> > Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:1035
> > +            maxLineCount = std::max<int>(maxLineCount, lineCountFor(downcast<RenderBlockFlow>(*child)));
> 
> Chopping the size_t down to int; what makes that safe? Should the function
> check for overflow and return an int?
> 
> > Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:1050
> > +        int lineCount = lineCountFor(blockChild);
> 
> Ditto.
bug 239389