|
|
Chromium Code Reviews|
Created:
4 years ago by yhirano Modified:
3 years, 12 months ago CC:
fs, blink-reviews, blink-reviews-layout_chromium.org, chromium-reviews, krit, eae+blinkwatch, f(malita), gavinp+loader_chromium.org, gyuyoung2, Nate Chapin, jchaffraix+rendering, kouhei+svg_chromium.org, leviw+renderwatch, loading-reviews_chromium.org, pdr+svgwatchlist_chromium.org, pdr+renderingwatchlist_chromium.org, rwlbuis, Stephen Chennney, szager+layoutwatch_chromium.org, tyoshino+watch_chromium.org, zoltan1 Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionLayoutSVGImage should work correctly even when image size is unavailable
Currently LayoutSVGImage::calculateObjectSize returns an invalid size (i.e.,
size containing NaN) when the image size is unavailable. This change fixes that.
BUG=675895
R=fs@opera.com, hiroshige@chromium.org
TEST=svg/custom/svg-image-intrinsic-size-with-cssstyle-auto.html
Committed: https://crrev.com/43c7ce1974915502d40e84e8c3a2ae80d4c9037e
Cr-Commit-Position: refs/heads/master@{#440177}
Patch Set 1 #
Total comments: 4
Messages
Total messages: 23 (10 generated)
The CQ bit was checked by yhirano@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
kouhei@chromium.org changed reviewers: + fmalita@chromium.org, kouhei@chromium.org
+fmalita lgtm
Add TEST=svg/custom/svg-image-intrinsic-size-with-cssstyle-auto.html ?
Add TEST=svg/custom/svg-image-intrinsic-size-with-cssstyle-auto.html ?
Description was changed from ========== LayoutSVGImage should work correctly even when image size is unavailable Currently LayoutSVGImage::calculateObjectSize returns an invalid size (i.e., size containing NaN) when the image size is unavailable. This change fixes that. BUG=675895 R=fs@opera.com, hiroshige@chromium.org ========== to ========== LayoutSVGImage should work correctly even when image size is unavailable Currently LayoutSVGImage::calculateObjectSize returns an invalid size (i.e., size containing NaN) when the image size is unavailable. This change fixes that. BUG=675895 R=fs@opera.com, hiroshige@chromium.org TEST=svg/custom/svg-image-intrinsic-size-with-cssstyle-auto.html ==========
On 2016/12/20 09:35:05, kouhei wrote: > Add TEST=svg/custom/svg-image-intrinsic-size-with-cssstyle-auto.html ? Done.
lgtm https://codereview.chromium.org/2592613002/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp (right): https://codereview.chromium.org/2592613002/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp:73: !cachedImage->isSizeAvailable()) Would this not affect other similar code-paths simply because they either check for the "empty" condition, or because the don't happen to use the (zero) dimensions as denominators in a division? I'm not opposed to having this check as such, but I wonder if makes sense to diverge w.r.t other similar uses.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2592613002/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp (right): https://codereview.chromium.org/2592613002/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp:73: !cachedImage->isSizeAvailable()) On 2016/12/20 10:08:12, fs wrote: > Would this not affect other similar code-paths simply because they either check > for the "empty" condition, or because the don't happen to use the (zero) > dimensions as denominators in a division? I'm not opposed to having this check > as such, but I wonder if makes sense to diverge w.r.t other similar uses. I'm not sure (I'm not familiar with the layout / image code). It looks dangerous to me to read size when it is not available. It is possible that we need more protection against 0-width and 0-height, but it is a different issue, I think.
https://codereview.chromium.org/2592613002/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp (right): https://codereview.chromium.org/2592613002/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp:73: !cachedImage->isSizeAvailable()) On 2016/12/20 at 12:06:30, yhirano wrote: > On 2016/12/20 10:08:12, fs wrote: > > Would this not affect other similar code-paths simply because they either check > > for the "empty" condition, or because the don't happen to use the (zero) > > dimensions as denominators in a division? I'm not opposed to having this check > > as such, but I wonder if makes sense to diverge w.r.t other similar uses. > > I'm not sure (I'm not familiar with the layout / image code). It looks dangerous to me to read size when it is not available. My observation was mostly that other code seems to rely on that "no size available" implies "size 0x0" (meaning one less property of the image to check.) I'm fine with landing this change as-is though.
lgtm
lgtm https://codereview.chromium.org/2592613002/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp (right): https://codereview.chromium.org/2592613002/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp:73: !cachedImage->isSizeAvailable()) On 2016/12/20 12:15:45, fs wrote: > On 2016/12/20 at 12:06:30, yhirano wrote: > > On 2016/12/20 10:08:12, fs wrote: > > > Would this not affect other similar code-paths simply because they either > check > > > for the "empty" condition, or because the don't happen to use the (zero) > > > dimensions as denominators in a division? I'm not opposed to having this > check > > > as such, but I wonder if makes sense to diverge w.r.t other similar uses. > > > > I'm not sure (I'm not familiar with the layout / image code). It looks > dangerous to me to read size when it is not available. > > My observation was mostly that other code seems to rely on that "no size > available" implies "size 0x0" (meaning one less property of the image to check.) > I'm fine with landing this change as-is though. If we can replace isSizeAvailable() here and in ImageResource-related code with 0x0 size check, then it would be simpler (one less property that ImageResourceContent should keep track), but it doesn't block this CL.
The CQ bit was checked by yhirano@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 1, "attempt_start_ts": 1482342806859510, "parent_rev":
"850ccdb2216b63b32b8743e7697a17478e13dd7d", "commit_rev":
"a533db804e50f3db025118171b2f2a74a0e79386"}
Message was sent while issue was closed.
Description was changed from ========== LayoutSVGImage should work correctly even when image size is unavailable Currently LayoutSVGImage::calculateObjectSize returns an invalid size (i.e., size containing NaN) when the image size is unavailable. This change fixes that. BUG=675895 R=fs@opera.com, hiroshige@chromium.org TEST=svg/custom/svg-image-intrinsic-size-with-cssstyle-auto.html ========== to ========== LayoutSVGImage should work correctly even when image size is unavailable Currently LayoutSVGImage::calculateObjectSize returns an invalid size (i.e., size containing NaN) when the image size is unavailable. This change fixes that. BUG=675895 R=fs@opera.com, hiroshige@chromium.org TEST=svg/custom/svg-image-intrinsic-size-with-cssstyle-auto.html Review-Url: https://codereview.chromium.org/2592613002 ==========
Message was sent while issue was closed.
Committed patchset #1 (id:1)
Message was sent while issue was closed.
Description was changed from ========== LayoutSVGImage should work correctly even when image size is unavailable Currently LayoutSVGImage::calculateObjectSize returns an invalid size (i.e., size containing NaN) when the image size is unavailable. This change fixes that. BUG=675895 R=fs@opera.com, hiroshige@chromium.org TEST=svg/custom/svg-image-intrinsic-size-with-cssstyle-auto.html Review-Url: https://codereview.chromium.org/2592613002 ========== to ========== LayoutSVGImage should work correctly even when image size is unavailable Currently LayoutSVGImage::calculateObjectSize returns an invalid size (i.e., size containing NaN) when the image size is unavailable. This change fixes that. BUG=675895 R=fs@opera.com, hiroshige@chromium.org TEST=svg/custom/svg-image-intrinsic-size-with-cssstyle-auto.html Committed: https://crrev.com/43c7ce1974915502d40e84e8c3a2ae80d4c9037e Cr-Commit-Position: refs/heads/master@{#440177} ==========
Message was sent while issue was closed.
Patchset 1 (id:??) landed as https://crrev.com/43c7ce1974915502d40e84e8c3a2ae80d4c9037e Cr-Commit-Position: refs/heads/master@{#440177} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
