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

Issue 224733011: A sizes attribute parser (Closed)

Created:
6 years, 8 months ago by Yoav Weiss
Modified:
6 years, 8 months ago
Reviewers:
rune, eseidel
CC:
blink-reviews, kenneth.christiansen, ed+blinkwatch_opera.com, dglazkov+blink, apavlov+blink_chromium.org, adamk+blink_chromium.org, darktears, rune+blink, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

A sizes attribute parser This CL implements a parser for HTMLImageElement's sizes attribute. It also hooks that parser to HTMLImageElement, but doesn't yet do anything with the output. BUG=357586 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=171701 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=171843

Patch Set 1 #

Patch Set 2 : Removed unused error flag #

Patch Set 3 : Rebase #

Total comments: 12

Patch Set 4 : Functional implementation. Fixed algo to match current spec. #

Patch Set 5 : Working length calculation. Refactored MediaValues. #

Patch Set 6 : Removed assert and added a null check #

Patch Set 7 : Removed unused member var #

Patch Set 8 : Removed computeLength from raw values #

Patch Set 9 : Added asserts. Removed unused effectiveSize. #

Patch Set 10 : Fixed debug assert #

Patch Set 11 : Changed layout test #

Patch Set 12 : Added invalid length layout test #

Total comments: 15

Patch Set 13 : Fixed review comments #

Patch Set 14 : Fixed "final" syntax #

Total comments: 5

Patch Set 15 : Changed Initializer to MediaValuesCachedData #

Patch Set 16 : Removed fontMetrics value caching, because of Memory test problems. #

Patch Set 17 : Added assert #

Patch Set 18 : Rebase #

Patch Set 19 : Fixed rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+889 lines, -378 lines) Patch
A LayoutTests/fast/dom/HTMLImageElement/image-sizes-invalid-length.html View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +14 lines, -0 lines 0 comments Download
A + LayoutTests/fast/dom/HTMLImageElement/image-sizes-invalid-length-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 0 chunks +-1 lines, --1 lines 0 comments Download
A LayoutTests/fast/dom/HTMLImageElement/image-sizes-simple.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +14 lines, -0 lines 0 comments Download
A + LayoutTests/fast/dom/HTMLImageElement/image-sizes-simple-expected.txt View 0 chunks +-1 lines, --1 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +4 lines, -0 lines 0 comments Download
M Source/core/css/CSSPrimitiveValue.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -4 lines 0 comments Download
M Source/core/css/CSSPrimitiveValue.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/css/MediaQueryEvaluator.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 9 chunks +11 lines, -45 lines 0 comments Download
M Source/core/css/MediaQueryEvaluatorTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +20 lines, -17 lines 0 comments Download
M Source/core/css/MediaQueryExp.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/css/MediaQuerySetTest.cpp View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/css/MediaValues.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +54 lines, -83 lines 0 comments Download
M Source/core/css/MediaValues.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 8 chunks +29 lines, -223 lines 0 comments Download
A Source/core/css/MediaValuesCached.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +65 lines, -0 lines 0 comments Download
A Source/core/css/MediaValuesCached.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +208 lines, -0 lines 0 comments Download
A Source/core/css/MediaValuesDynamic.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +47 lines, -0 lines 0 comments Download
A Source/core/css/MediaValuesDynamic.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +144 lines, -0 lines 0 comments Download
M Source/core/css/parser/MediaConditionTest.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/parser/MediaQueryParser.h View 1 2 3 4 2 chunks +4 lines, -2 lines 0 comments Download
M Source/core/css/parser/MediaQueryParser.cpp View 1 2 3 4 3 chunks +4 lines, -3 lines 0 comments Download
A Source/core/css/parser/SizesAttributeParser.h View 1 2 3 4 5 6 1 chunk +40 lines, -0 lines 0 comments Download
A Source/core/css/parser/SizesAttributeParser.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +134 lines, -0 lines 0 comments Download
A Source/core/css/parser/SizesAttributeParserTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +77 lines, -0 lines 0 comments Download
M Source/core/html/HTMLImageElement.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/HTMLImageElement.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +5 lines, -0 lines 0 comments Download
M Source/core/html/HTMLImageElement.idl View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/parser/HTMLDocumentParser.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 29 (0 generated)
Yoav Weiss
This CL start adding the sizes parser implementation. It is not yet very useful (critical ...
6 years, 8 months ago (2014-04-05 20:05:52 UTC) #1
eseidel
In general seems fine. https://codereview.chromium.org/224733011/diff/40001/Source/core/css/MediaValues.cpp File Source/core/css/MediaValues.cpp (right): https://codereview.chromium.org/224733011/diff/40001/Source/core/css/MediaValues.cpp#newcode198 Source/core/css/MediaValues.cpp:198: const Document* executingDocument = document.import() ...
6 years, 8 months ago (2014-04-08 06:02:14 UTC) #2
rune
https://codereview.chromium.org/224733011/diff/40001/Source/core/css/parser/SizesAttributeParser.cpp File Source/core/css/parser/SizesAttributeParser.cpp (right): https://codereview.chromium.org/224733011/diff/40001/Source/core/css/parser/SizesAttributeParser.cpp#newcode13 Source/core/css/parser/SizesAttributeParser.cpp:13: enum { EffectiveSizeDefaultValue = 300 }; On 2014/04/08 06:02:14, ...
6 years, 8 months ago (2014-04-08 10:34:41 UTC) #3
rune
> That would have been me. I based it on how it's mostly done elsewhere ...
6 years, 8 months ago (2014-04-08 10:42:10 UTC) #4
Yoav Weiss
On second thought, I think it'd be better to land this CL only after https://codereview.chromium.org/227043007/ ...
6 years, 8 months ago (2014-04-08 11:18:26 UTC) #5
Yoav Weiss
On 2014/04/08 11:18:26, Yoav Weiss wrote: > On second thought, I think it'd be better ...
6 years, 8 months ago (2014-04-08 16:00:00 UTC) #6
Yoav Weiss
On 2014/04/08 16:00:00, Yoav Weiss wrote: > On 2014/04/08 11:18:26, Yoav Weiss wrote: > > ...
6 years, 8 months ago (2014-04-11 13:23:45 UTC) #7
eseidel
https://codereview.chromium.org/224733011/diff/210001/Source/core/css/CSSPrimitiveValue.cpp File Source/core/css/CSSPrimitiveValue.cpp (right): https://codereview.chromium.org/224733011/diff/210001/Source/core/css/CSSPrimitiveValue.cpp#newcode598 Source/core/css/CSSPrimitiveValue.cpp:598: // The logic in this function is duplicated in ...
6 years, 8 months ago (2014-04-14 22:55:31 UTC) #8
eseidel
Overall this looks good! https://codereview.chromium.org/224733011/diff/210001/Source/core/css/MediaValues.h File Source/core/css/MediaValues.h (right): https://codereview.chromium.org/224733011/diff/210001/Source/core/css/MediaValues.h#newcode55 Source/core/css/MediaValues.h:55: static PassRefPtr<MediaValues> create(PassRefPtr<LocalFrame>, PassRefPtr<RenderStyle>, MediaValuesMode); ...
6 years, 8 months ago (2014-04-14 23:10:12 UTC) #9
Yoav Weiss
On 2014/04/14 22:55:31, eseidel wrote: > https://codereview.chromium.org/224733011/diff/210001/Source/core/css/CSSPrimitiveValue.cpp > File Source/core/css/CSSPrimitiveValue.cpp (right): > > https://codereview.chromium.org/224733011/diff/210001/Source/core/css/CSSPrimitiveValue.cpp#newcode598 > ...
6 years, 8 months ago (2014-04-15 05:53:04 UTC) #10
Yoav Weiss
On 2014/04/14 23:10:12, eseidel wrote: > Overall this looks good! > > https://codereview.chromium.org/224733011/diff/210001/Source/core/css/MediaValues.h > File ...
6 years, 8 months ago (2014-04-15 06:11:26 UTC) #11
Yoav Weiss
On 2014/04/15 06:11:26, Yoav Weiss wrote: > On 2014/04/14 23:10:12, eseidel wrote: > > Overall ...
6 years, 8 months ago (2014-04-15 09:34:35 UTC) #12
eseidel
lgtm https://codereview.chromium.org/224733011/diff/240001/Source/core/css/CSSPrimitiveValue.cpp File Source/core/css/CSSPrimitiveValue.cpp (right): https://codereview.chromium.org/224733011/diff/240001/Source/core/css/CSSPrimitiveValue.cpp#newcode598 Source/core/css/CSSPrimitiveValue.cpp:598: // The logic in this function is duplicated ...
6 years, 8 months ago (2014-04-15 18:47:02 UTC) #13
Yoav Weiss
On 2014/04/15 18:47:02, eseidel wrote: > lgtm > > https://codereview.chromium.org/224733011/diff/240001/Source/core/css/CSSPrimitiveValue.cpp > File Source/core/css/CSSPrimitiveValue.cpp (right): > ...
6 years, 8 months ago (2014-04-15 19:45:11 UTC) #14
Yoav Weiss
The CQ bit was checked by yoav@yoav.ws
6 years, 8 months ago (2014-04-15 20:06:44 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yoav@yoav.ws/224733011/260001
6 years, 8 months ago (2014-04-15 20:06:59 UTC) #16
commit-bot: I haz the power
Change committed as 171701
6 years, 8 months ago (2014-04-15 20:47:01 UTC) #17
hayato
[blink gardening] SystemMemoryApiTest.Memory started to fail. http://build.chromium.org/p/chromium.webkit/builders/Linux%20Tests/builds/35970 I manually bisected in range 171674: 171705. After ...
6 years, 8 months ago (2014-04-16 05:24:30 UTC) #18
Yoav Weiss
On 2014/04/16 05:24:30, hayato wrote: > [blink gardening] > SystemMemoryApiTest.Memory started to fail. > > ...
6 years, 8 months ago (2014-04-16 05:47:14 UTC) #19
hayato
I reverted at: https://codereview.chromium.org/239863003/ https://codereview.chromium.org/240063003/ In my local linux machine, these reverts fixed the following ...
6 years, 8 months ago (2014-04-16 07:24:10 UTC) #20
esprehn
This patch was so big, can we try to land it in parts next time? ...
6 years, 8 months ago (2014-04-16 19:35:36 UTC) #21
Yoav Weiss
On 2014/04/16 19:35:36, esprehn wrote: > This patch was so big, can we try to ...
6 years, 8 months ago (2014-04-16 21:53:21 UTC) #22
Yoav Weiss
The CQ bit was checked by yoav@yoav.ws
6 years, 8 months ago (2014-04-17 04:20:07 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yoav@yoav.ws/224733011/300001
6 years, 8 months ago (2014-04-17 04:20:17 UTC) #24
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-17 04:20:29 UTC) #25
commit-bot: I haz the power
Failed to apply patch for Source/core/css/MediaValues.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 8 months ago (2014-04-17 04:20:29 UTC) #26
Yoav Weiss
The CQ bit was checked by yoav@yoav.ws
6 years, 8 months ago (2014-04-17 06:01:47 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yoav@yoav.ws/224733011/330001
6 years, 8 months ago (2014-04-17 06:01:58 UTC) #28
commit-bot: I haz the power
6 years, 8 months ago (2014-04-17 06:18:52 UTC) #29
Message was sent while issue was closed.
Change committed as 171843

Powered by Google App Engine
This is Rietveld 408576698