Bug 230431

Summary: RenderListMarker::imageChanged RenderBox image handling
Product: WebKit Reporter: Gabriel Nava Marino <gnavamarino>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: changseok, darin, esprehn+autocc, ews-watchlist, fpizlo, glenn, kondapallykalyan, pdr, webkit-bug-importer
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 Gabriel Nava Marino 2021-09-17 15:38:53 PDT
RenderListMarker is a RenderBox. RenderBox is a RenderElement which can have image updates from style changes (i.e. RenderStyle has maskBoxImage).

Thus the following comment is outdated and no longer applies:
    // A list marker can't have a background or border image, so no need to call the base class method.
We should call the base class imageChanged method, which includes additional logic for handling RenderBox image updates, and handle image changes appropriately in RenderListMarker.
Comment 1 Gabriel Nava Marino 2021-09-17 16:02:23 PDT
Created attachment 438528 [details]
Patch
Comment 2 Darin Adler 2021-09-17 17:10:56 PDT
Comment on attachment 438528 [details]
Patch

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

> Source/WebCore/ChangeLog:9
> +        No new tests (OOPS!).

Why no tests? Seems like we can and should make a test for whatever problem this caused.

> Source/WebCore/rendering/RenderListMarker.cpp:1803
> +    if (m_image) {
> +        if (o == m_image->data()) {

Let’s not nest this so much:

    if (m_image && o == m_image->data()) {
        ...
Comment 3 Gabriel Nava Marino 2021-09-20 19:15:25 PDT
Created attachment 438770 [details]
Patch
Comment 4 Gabriel Nava Marino 2021-09-20 19:16:25 PDT
(In reply to Darin Adler from comment #2)
> Comment on attachment 438528 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=438528&action=review
> 
> > Source/WebCore/ChangeLog:9
> > +        No new tests (OOPS!).
> 
> Why no tests? Seems like we can and should make a test for whatever problem
> this caused.

I have added a new test to help catch this issue.

> 
> > Source/WebCore/rendering/RenderListMarker.cpp:1803
> > +    if (m_image) {
> > +        if (o == m_image->data()) {
> 
> Let’s not nest this so much:
> 
>     if (m_image && o == m_image->data()) {
>         ...

I have updated the patch to remove the unnecessary level of nesting.

Thank you for your feedback Darin!
Comment 5 Gabriel Nava Marino 2021-09-21 12:00:49 PDT
Created attachment 438844 [details]
Patch
Comment 6 Gabriel Nava Marino 2021-09-21 13:36:35 PDT
Created attachment 438848 [details]
Patch
Comment 7 Gabriel Nava Marino 2021-09-21 15:49:21 PDT
Created attachment 438873 [details]
Patch
Comment 8 EWS 2021-09-22 10:19:42 PDT
Committed r282880 (242009@main): <https://commits.webkit.org/242009@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 438873 [details].
Comment 9 Radar WebKit Bug Importer 2021-09-22 10:20:22 PDT
<rdar://problem/83406263>