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

Issue 2613853002: Phase III Step 2: Call imageNotifyFinished() and image load event after SVG loading completes (Closed)

Created:
3 years, 11 months ago by hiroshige
Modified:
3 years, 7 months ago
CC:
ajuma+watch_chromium.org, blink-reviews, blink-reviews-platform-graphics_chromium.org, Rik, chromium-reviews, danakj+watch_chromium.org, dshwang, drott+blinkwatch_chromium.org, krit, f(malita), gavinp+loader_chromium.org, gyuyoung2, Nate Chapin, jbroman, Justin Novosad, kinuko+watch, kouhei+svg_chromium.org, loading-reviews_chromium.org, pdr+svgwatchlist_chromium.org, pdr+graphicswatchlist_chromium.org, rwlbuis, tyoshino+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Phase III Step 2: Call imageNotifyFinished() and image load event after SVG loading completes design doc: https://docs.google.com/document/d/1O-fB83mrE0B_V8gzXNqHgmRLCvstTB4MMi3RnVLr8bE/edit# https://docs.google.com/document/d/1obEb8K4mJpG9Y_x4_ZhvnbFHojZoLLzMCFsalkl8voc/edit# This CL calls ImageResourceObserver::ImageNotifyFinished() after SVG image loading is completed, not necessarily the same time as ResourceLoader completion (e.g. DidFinishLoading()). This makes SVG's <img> load event to be fired after SVG image loading is completed even when the SVG has subresources loaded asynchronously. 1. Image::SetData() can return SizeAvailableAndLoadingAsynchronously when SVG image loading is not completed synchronously (due to subresources), and notifies the completion asynchronously via ImageObserver:LoadCompleted(). LocalFrameClient::DispatchDidHandleOnloadEvents() is used as a notification of SVG image loading completion in SVGImage. 2. ImageResourceContent delays calling ImageNotifyFinished() and setting |content_status_| to kCached until SVG image loading is completed. 3. ImageLoader additionally delays the Document load event - from the first ImageChanged() during image loading - until (potentially delayed) ImageNotifyFinished(). In image loading not by ImageLoader, the Document load event is not delayed from ResourceLoader completion until ImageNotifyFinished(), but this is not a regression. In image loading by ImageLoader, the Document load event is delayed until ImageNotifyFinished() by the combination of ResourceFetcher::loaders_ and ImageLoader. ImageLoader starts delaying the Document load event - Not from |image_| is set, because we shouldn't delay the Document load event when image loading is deferred. - Not from ImageResourceContent::NotifyStartLoad(), to avoid additional ImageResourceObserver callbacks. BUG=382170, 690480, 667641 Review-Url: https://codereview.chromium.org/2613853002 Cr-Commit-Position: refs/heads/master@{#472229} Committed: https://chromium.googlesource.com/chromium/src/+/396a1266fb7549e03e5bcff793ac138654e52d3a

Patch Set 1 #

Patch Set 2 : test hack #

Patch Set 3 : git cl try #

Patch Set 4 : bug fix in error #

Patch Set 5 : Rebase #

Patch Set 6 : Rebase #

Patch Set 7 : notifyStartLoad() #

Patch Set 8 : Refine, introduce new enum #

Patch Set 9 : More strict state checks #

Patch Set 10 : Bug fix? #

Patch Set 11 : Do not use notifyStartLoad(), Do not block already loaded image #

Patch Set 12 : Rebase #

Patch Set 13 : Rebase #

Patch Set 14 : Refine/style #

Patch Set 15 : Rebase #

Patch Set 16 : Rebase #

Patch Set 17 : Rebase (rewind) #

Patch Set 18 : Rebase (rewind) #

Patch Set 19 : format #

Patch Set 20 : Rebase #

Total comments: 34

Patch Set 21 : rebase after Blink Renaming #

Patch Set 22 : Reflect comments #

Patch Set 23 : Forbid revalidation during waiting for SVG load completion. #

Total comments: 1

Patch Set 24 : Rebase #

Total comments: 20

Patch Set 25 : reflect comments #

Total comments: 2

Patch Set 26 : fix/nits #

Total comments: 2

Patch Set 27 : Reflect comments #

Total comments: 4

Patch Set 28 : Rebase #

Patch Set 29 : Reflect yhirano's comments and Use raw ptr instead of WeakPtr. #

Patch Set 30 : Rebase #

Patch Set 31 : Rebase #

Patch Set 32 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+384 lines, -61 lines) Patch
A third_party/WebKit/LayoutTests/svg/as-image/data-font-in-css-crash.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +26 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/as-image/data-font-in-css-invalid-data-url-crash.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +26 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/as-image/data-font-in-css-invalid-font-crash.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +26 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/as-image/resources/data-font-in-css.svg View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +6 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/as-image/resources/data-font-in-css-invalid-data-url.svg View 1 chunk +6 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/as-image/resources/data-font-in-css-invalid-font.svg View 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/ImageLoader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 2 chunks +21 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/ImageLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 8 chunks +28 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/loader/resource/ImageResource.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/resource/ImageResource.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 chunk +10 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 3 chunks +21 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 2 chunks +54 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/svg/graphics/SVGImage.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 2 chunks +15 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 4 chunks +115 lines, -50 lines 0 comments Download
M third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Image.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +14 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageObserver.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/loader/fetch/Resource.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 146 (125 generated)
hiroshige
Loading and SVG experts, PTAL.
3 years, 9 months ago (2017-03-15 00:38:27 UTC) #73
kouhei (in TOK)
https://codereview.chromium.org/2613853002/diff/380001/third_party/WebKit/Source/core/loader/ImageLoader.h File third_party/WebKit/Source/core/loader/ImageLoader.h (right): https://codereview.chromium.org/2613853002/diff/380001/third_party/WebKit/Source/core/loader/ImageLoader.h#newcode166 third_party/WebKit/Source/core/loader/ImageLoader.h:166: std::unique_ptr<IncrementLoadEventDelayCount> m_loadDelayCounter; m_delayLoadUntilUpdateFromElement? https://codereview.chromium.org/2613853002/diff/380001/third_party/WebKit/Source/core/loader/ImageLoader.h#newcode182 third_party/WebKit/Source/core/loader/ImageLoader.h:182: std::unique_ptr<IncrementLoadEventDelayCount> m_loadDelayCounter2; Do we ...
3 years, 9 months ago (2017-03-15 11:32:34 UTC) #76
fs
(What is "Phase III Step 2", and does it need to be included in the ...
3 years, 9 months ago (2017-03-15 14:22:17 UTC) #77
hiroshige
Hi reviewers, Sorry for a long delay, I was blocked by subtle corner cases (and ...
3 years, 7 months ago (2017-05-04 22:50:50 UTC) #81
fs
LGTM w/ one minor issue (WeakPtr revokation) and some nits, comments and suggestions. I'll leave ...
3 years, 7 months ago (2017-05-05 10:52:42 UTC) #88
kouhei (in TOK)
loading lgtm % WeakPtr. I'll think more about this https://codereview.chromium.org/2613853002/diff/480001/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp File third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp (right): https://codereview.chromium.org/2613853002/diff/480001/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp#newcode485 third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp:485: ...
3 years, 7 months ago (2017-05-08 13:07:05 UTC) #93
hiroshige
Thanks for review/comments! Reflected the comments, except for the WeakPtr issue. https://codereview.chromium.org/2613853002/diff/380001/third_party/WebKit/LayoutTests/svg/as-image/resources/data-font-in-css.svg File third_party/WebKit/LayoutTests/svg/as-image/resources/data-font-in-css.svg (right): ...
3 years, 7 months ago (2017-05-08 17:22:07 UTC) #94
hiroshige
https://codereview.chromium.org/2613853002/diff/380001/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp File third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp (right): https://codereview.chromium.org/2613853002/diff/380001/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp#newcode661 third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp:661: LocalFrame::create(new SVGImageLocalFrameClient(this->asWeakPtr()), On 2017/05/08 17:22:06, hiroshige wrote: > On ...
3 years, 7 months ago (2017-05-08 18:37:12 UTC) #97
fs
https://codereview.chromium.org/2613853002/diff/380001/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp File third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp (right): https://codereview.chromium.org/2613853002/diff/380001/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp#newcode661 third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp:661: LocalFrame::create(new SVGImageLocalFrameClient(this->asWeakPtr()), On 2017/05/08 at 18:37:11, hiroshige wrote: > ...
3 years, 7 months ago (2017-05-08 18:52:33 UTC) #98
hiroshige
https://codereview.chromium.org/2613853002/diff/460001/third_party/WebKit/Source/core/loader/ImageLoader.cpp File third_party/WebKit/Source/core/loader/ImageLoader.cpp (right): https://codereview.chromium.org/2613853002/diff/460001/third_party/WebKit/Source/core/loader/ImageLoader.cpp#newcode205 third_party/WebKit/Source/core/loader/ImageLoader.cpp:205: delay_until_image_notify_finished_ = nullptr; On 2017/05/08 18:52:33, fs wrote: > ...
3 years, 7 months ago (2017-05-09 00:46:31 UTC) #101
fs
On 2017/05/09 at 00:46:31, hiroshige wrote: > https://codereview.chromium.org/2613853002/diff/460001/third_party/WebKit/Source/core/loader/ImageLoader.cpp > File third_party/WebKit/Source/core/loader/ImageLoader.cpp (right): > > https://codereview.chromium.org/2613853002/diff/460001/third_party/WebKit/Source/core/loader/ImageLoader.cpp#newcode205 ...
3 years, 7 months ago (2017-05-09 08:30:19 UTC) #102
yhirano
lgtm https://codereview.chromium.org/2613853002/diff/520001/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp File third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp (right): https://codereview.chromium.org/2613853002/diff/520001/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp#newcode450 third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp:450: if (!all_data_received) { This is same as L477-L479. ...
3 years, 7 months ago (2017-05-09 08:33:57 UTC) #103
kouhei (in TOK)
Discussed offline w/ hiroshige@. - SVGImageLFC to ref SVGImage via raw ptr. - Clarify obj ...
3 years, 7 months ago (2017-05-09 21:57:11 UTC) #104
hiroshige
> Discussed offline w/ hiroshige@. > - SVGImageLFC to ref SVGImage via raw ptr. > ...
3 years, 7 months ago (2017-05-10 22:45:49 UTC) #110
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2613853002/620001
3 years, 7 months ago (2017-05-15 18:56:28 UTC) #127
hiroshige
platform/graphics OWNERS (pdr@, schenney@, or kinuko@), could you take a look as an OWNER?
3 years, 7 months ago (2017-05-15 19:28:12 UTC) #129
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/437240)
3 years, 7 months ago (2017-05-15 19:40:02 UTC) #131
Stephen Chennney
On 2017/05/15 19:28:12, hiroshige wrote: > platform/graphics OWNERS (pdr@, schenney@, or kinuko@), could you take ...
3 years, 7 months ago (2017-05-15 19:43:31 UTC) #132
kinuko
lgtm/2
3 years, 7 months ago (2017-05-15 19:44:18 UTC) #133
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2613853002/620001
3 years, 7 months ago (2017-05-16 19:08:20 UTC) #142
commit-bot: I haz the power
3 years, 7 months ago (2017-05-16 22:17:57 UTC) #145
Message was sent while issue was closed.
Committed patchset #32 (id:620001) as
https://chromium.googlesource.com/chromium/src/+/396a1266fb7549e03e5bcff793ac...

Powered by Google App Engine
This is Rietveld 408576698