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

Issue 1299563002: HTMLImageElement width/height should updateLayout first. (Closed)

Created:
5 years, 4 months ago by esprehn
Modified:
5 years, 4 months ago
Reviewers:
pdr., dglazkov, ojan
CC:
blink-reviews, blink-reviews-html_chromium.org, dglazkov+blink
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

HTMLImageElement width/height should updateLayout first. HTMLImageElement::width/height were not updating layout first before checking for the layoutObject() which means that we fall back to the attribute when we shouldn't. We're also using the updateLayout method instead of updateLayoutIgnorePendingStylesheets which should be used for all JS APIs. Finally I deleted the unused boolean argument to the methods. We also make sure to check if we're in the document before causing a layout so checking for a disconnected image's width/height before drawing to a canvas doesn't cause a sync layout. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=200594

Patch Set 1 #

Patch Set 2 : Use a local resource. #

Patch Set 3 : Check if we're in the document. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -14 lines) Patch
A LayoutTests/fast/images/img-dimensions-styled.html View 1 1 chunk +22 lines, -0 lines 0 comments Download
A LayoutTests/fast/images/img-dimensions-styled-expected.txt View 1 1 chunk +13 lines, -0 lines 0 comments Download
M Source/core/html/HTMLImageElement.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLImageElement.cpp View 1 2 3 chunks +8 lines, -12 lines 1 comment Download

Messages

Total messages: 14 (5 generated)
esprehn
5 years, 4 months ago (2015-08-15 01:57:05 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1299563002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1299563002/20001
5 years, 4 months ago (2015-08-15 01:57:36 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1299563002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1299563002/40001
5 years, 4 months ago (2015-08-15 02:01:46 UTC) #6
pdr.
LGTM with a question https://codereview.chromium.org/1299563002/diff/40001/Source/core/html/HTMLImageElement.cpp File Source/core/html/HTMLImageElement.cpp (right): https://codereview.chromium.org/1299563002/diff/40001/Source/core/html/HTMLImageElement.cpp#newcode425 Source/core/html/HTMLImageElement.cpp:425: if (inActiveDocument()) The inActiveDocument check ...
5 years, 4 months ago (2015-08-15 02:09:26 UTC) #7
esprehn
On 2015/08/15 at 02:09:26, pdr wrote: > LGTM with a question > > https://codereview.chromium.org/1299563002/diff/40001/Source/core/html/HTMLImageElement.cpp > ...
5 years, 4 months ago (2015-08-15 02:16:36 UTC) #8
pdr.
On 2015/08/15 at 02:16:36, esprehn wrote: > On 2015/08/15 at 02:09:26, pdr wrote: > > ...
5 years, 4 months ago (2015-08-15 02:24:38 UTC) #9
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 4 months ago (2015-08-15 03:36:49 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1299563002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1299563002/40001
5 years, 4 months ago (2015-08-15 03:49:14 UTC) #13
commit-bot: I haz the power
5 years, 4 months ago (2015-08-15 03:53:50 UTC) #14
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=200594

Powered by Google App Engine
This is Rietveld 408576698