Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[image-set] Pick first choice when identical resolutions are found
https://bugs.webkit.org/show_bug.cgi?id=257100 rdar://109619779 Reviewed by Tim Nguyen. Step 2 of the image-set selection algorithm [0] specifies that we should drop any <image-set-option> whose resolution we have already seen. This can be acheived by comparing the resolution against the `result` that we have selected in the loop. This works because the Vector is sorted by resolution and we bail out of the loop the first time we find an image whose resolution is greater or equal to device resolution. While here, also fix up a bug where we were checking if the ImageWithScale object had a non-null pointer to an image rather than checking if the pointer was to a StyleInvalidImage object. The ImageWithScale defaults to having a StyleInvalidImage rather than a null pointer. [0] https://drafts.csswg.org/css-images-4/#image-set-notation * LayoutTests/TestExpectations: * LayoutTests/platform/ios/TestExpectations: * Source/WebCore/rendering/style/StyleImageSet.cpp: (WebCore::StyleImageSet::bestImageForScaleFactor): Canonical link: https://commits.webkit.org/264481@main
- Loading branch information