Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Issue 1890613002: Support createImageBitmap from a SVG image (Closed)

Created:
4 years, 8 months ago by xidachen
Modified:
4 years, 8 months ago
CC:
blink-reviews, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Support createImageBitmap from a SVG image Right now when call createImageBitmap from a SVG image, it will throw a InvalidStateError. This CL changes such that creating an ImageBitmap from a SVG image is supported. This CL includes two layout tests for the case of an SVG image with and without intrinsic size. The spec here: https://html.spec.whatwg.org/#imagebitmapfactories states that createImageBitmap should throw an InvalidStateError when the SVG image doesn't have an intrinsic size. BUG=599228 Committed: https://crrev.com/04c55bfcb5eeb705f7d29a16c72fea6e9737a5b1 Cr-Commit-Position: refs/heads/master@{#387612}

Patch Set 1 #

Patch Set 2 : cover test for SVG image without intrinsic size #

Total comments: 4

Patch Set 3 : address comments, update layout tests results #

Total comments: 1

Patch Set 4 : const #

Total comments: 1

Patch Set 5 : address sof's commnets #

Total comments: 4

Patch Set 6 : address davve's comments #

Total comments: 1

Patch Set 7 : nits #

Messages

Total messages: 39 (17 generated)
xidachen
PTAL
4 years, 8 months ago (2016-04-13 20:48:38 UTC) #3
jbroman
https://codereview.chromium.org/1890613002/diff/20001/third_party/WebKit/Source/core/html/HTMLImageElement.cpp File third_party/WebKit/Source/core/html/HTMLImageElement.cpp (right): https://codereview.chromium.org/1890613002/diff/20001/third_party/WebKit/Source/core/html/HTMLImageElement.cpp#newcode693 third_party/WebKit/Source/core/html/HTMLImageElement.cpp:693: SVGImage* image = static_cast<SVGImage*>(cachedImage()->getImage()); Prefer using toSVGImage: SVGImage* image ...
4 years, 8 months ago (2016-04-13 21:13:22 UTC) #5
xidachen
https://codereview.chromium.org/1890613002/diff/20001/third_party/WebKit/Source/core/html/HTMLImageElement.cpp File third_party/WebKit/Source/core/html/HTMLImageElement.cpp (right): https://codereview.chromium.org/1890613002/diff/20001/third_party/WebKit/Source/core/html/HTMLImageElement.cpp#newcode693 third_party/WebKit/Source/core/html/HTMLImageElement.cpp:693: SVGImage* image = static_cast<SVGImage*>(cachedImage()->getImage()); On 2016/04/13 21:13:22, jbroman wrote: ...
4 years, 8 months ago (2016-04-14 01:12:40 UTC) #6
jbroman
LGTM https://codereview.chromium.org/1890613002/diff/40001/third_party/WebKit/Source/core/svg/graphics/SVGImage.h File third_party/WebKit/Source/core/svg/graphics/SVGImage.h (right): https://codereview.chromium.org/1890613002/diff/40001/third_party/WebKit/Source/core/svg/graphics/SVGImage.h#newcode89 third_party/WebKit/Source/core/svg/graphics/SVGImage.h:89: bool hasIntrinsicSize(); nit: Can this method be const?
4 years, 8 months ago (2016-04-14 19:22:36 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1890613002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1890613002/60001
4 years, 8 months ago (2016-04-14 19:27:42 UTC) #9
sof
https://codereview.chromium.org/1890613002/diff/60001/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-svg.html File third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-svg.html (right): https://codereview.chromium.org/1890613002/diff/60001/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-svg.html#newcode14 third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-svg.html:14: shouldBe("d[0]", "0"); shouldBeEqualToNumber("d[0]", 0); etc.
4 years, 8 months ago (2016-04-14 19:29:28 UTC) #10
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1890613002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1890613002/80001
4 years, 8 months ago (2016-04-14 19:39:46 UTC) #13
Justin Novosad
@davve: Please take a look at SVGImage changes.
4 years, 8 months ago (2016-04-14 20:38:17 UTC) #15
Justin Novosad
https://codereview.chromium.org/1890613002/diff/80001/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp File third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp (right): https://codereview.chromium.org/1890613002/diff/80001/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp#newcode182 third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp:182: layoutObject->computeIntrinsicSizingInfo(intrinsicSizingInfo); Is this call at all expensive? I am ...
4 years, 8 months ago (2016-04-14 20:45:14 UTC) #16
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-14 20:55:52 UTC) #18
davve
https://codereview.chromium.org/1890613002/diff/80001/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp File third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp (right): https://codereview.chromium.org/1890613002/diff/80001/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp#newcode182 third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp:182: layoutObject->computeIntrinsicSizingInfo(intrinsicSizingInfo); On 2016/04/14 20:45:14, Justin Novosad wrote: > Is ...
4 years, 8 months ago (2016-04-15 07:24:31 UTC) #19
davve
According to Anne, the spec link should now be: https://html.spec.whatwg.org/#windoworworkerglobalscope (it was a mixin that ...
4 years, 8 months ago (2016-04-15 07:42:31 UTC) #21
davve
https://codereview.chromium.org/1890613002/diff/80001/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp File third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp (right): https://codereview.chromium.org/1890613002/diff/80001/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp#newcode182 third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp:182: layoutObject->computeIntrinsicSizingInfo(intrinsicSizingInfo); On 2016/04/15 07:24:31, David Vest wrote: > On ...
4 years, 8 months ago (2016-04-15 09:31:18 UTC) #22
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1890613002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1890613002/100001
4 years, 8 months ago (2016-04-15 12:23:07 UTC) #24
xidachen
https://codereview.chromium.org/1890613002/diff/80001/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp File third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp (right): https://codereview.chromium.org/1890613002/diff/80001/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp#newcode182 third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp:182: layoutObject->computeIntrinsicSizingInfo(intrinsicSizingInfo); Thanks David. I am going with return !concreteObjectSize(FloatSize()).isEmpty(); ...
4 years, 8 months ago (2016-04-15 12:24:04 UTC) #25
davve
lgtm https://codereview.chromium.org/1890613002/diff/100001/third_party/WebKit/Source/core/html/HTMLImageElement.cpp File third_party/WebKit/Source/core/html/HTMLImageElement.cpp (right): https://codereview.chromium.org/1890613002/diff/100001/third_party/WebKit/Source/core/html/HTMLImageElement.cpp#newcode695 third_party/WebKit/Source/core/html/HTMLImageElement.cpp:695: exceptionState.throwDOMException(InvalidStateError, "The image element contains an SVG image ...
4 years, 8 months ago (2016-04-15 12:34:12 UTC) #26
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-15 13:42:56 UTC) #28
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1890613002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1890613002/120001
4 years, 8 months ago (2016-04-15 15:04:52 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1890613002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1890613002/120001
4 years, 8 months ago (2016-04-15 15:57:10 UTC) #34
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 8 months ago (2016-04-15 16:09:25 UTC) #36
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/04c55bfcb5eeb705f7d29a16c72fea6e9737a5b1 Cr-Commit-Position: refs/heads/master@{#387612}
4 years, 8 months ago (2016-04-15 16:10:43 UTC) #38
Justin Novosad
4 years, 8 months ago (2016-04-18 19:38:43 UTC) #39
Message was sent while issue was closed.
Catching-up on reviews... post-commit lgtm

Powered by Google App Engine
This is Rietveld 408576698