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

Issue 1681273003: Add CSS parser support for break-after, break-before and break-inside. (Closed)

Created:
4 years, 10 months ago by mstensho (USE GERRIT)
Modified:
4 years, 10 months ago
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, blink-reviews-layout_chromium.org, blink-reviews-style_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, rwlbuis, szager+layoutwatch_chromium.org, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add CSS parser support for break-after, break-before and break-inside. Note that this only adds support for these properties on specified and computed style level, and does not extend the functionality in the layout engine. In particular, we don't support break-(after|before):(avoid|left|right) any better than before (i.e. we just recognize the values and do nothing about them in the engine). The (page|-webkit-column)-break-(after|before|inside) properties are treated as shorthands for their break-(after|before|inside) counterparts, in accordance with the spec. This CL intends to make as few behavioral changes on computed style level as humanly possible, apart from actually allowing the new properties. In order to achieve that, we go against the spec when it comes to mapping between the three modern break-(after|before|inside) properties and the old-fashioned ones. More specifically, we map "right" and "left" values to "always", and we even support those values on -webkit-column-break-(after|before), which is just bogus, but this is how it's always been. We also violate the spec when it comes to mapping "avoid" values. While the spec says that e.g. page-break-inside:avoid should simply map to break-inside:avoid, we map it to avoid-page, so that the computed value of -webkit-column-break-inside isn't affected by such a declaration. There WILL be some minor behavioral changes, no matter how hard we try, though: Since there's now just one property for each of before, after and inside (instead of two - one for page and one for column), declaration sequences like "page-break-inside:avoid; -webkit-column-break-inside:auto;" will not behave like before. This will now become "break-inside:auto" (from the -webkit-column-break-inside declaration), effectively allowing page breaks inside. The new test behaves exactly as it would have without the code changes in this CL, apart from recognizing break-after, break-before and break-inside. BUG=223068, 492297 Committed: https://crrev.com/c78e9708e49aa13bd5bd9382983f4aa060680dfd Cr-Commit-Position: refs/heads/master@{#376148}

Patch Set 1 #

Patch Set 2 : Update some text expectations, and move the new properties into ComputedStyle, since they aren't ra… #

Total comments: 3

Patch Set 3 : Don't parse region values. #

Total comments: 6

Patch Set 4 : code review #

Patch Set 5 : rebase master #

Unified diffs Side-by-side diffs Delta from patch set Stats (+568 lines, -122 lines) Patch
M third_party/WebKit/LayoutTests/fast/css/getComputedStyle/computed-style-listing-expected.txt View 1 2 3 4 3 chunks +3 lines, -6 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-listing-expected.txt View 1 2 3 4 3 chunks +3 lines, -6 lines 0 comments Download
A third_party/WebKit/LayoutTests/fragmentation/README.txt View 1 chunk +7 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fragmentation/break-properties.html View 1 chunk +61 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fragmentation/break-properties-expected.txt View 1 chunk +194 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/svg/css/getComputedStyle-listing-expected.txt View 1 2 3 4 3 chunks +3 lines, -6 lines 0 comments Download
M third_party/WebKit/LayoutTests/virtual/stable/webexposed/css-properties-as-js-properties-expected.txt View 1 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/css-properties-as-js-properties-expected.txt View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp View 1 2 3 4 3 chunks +3 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h View 1 2 3 4 1 chunk +52 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSProperties.in View 1 2 3 4 4 chunks +9 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSValueKeywords.in View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp View 1 2 3 4 3 chunks +52 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp View 1 2 3 3 chunks +8 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp View 1 2 3 4 2 chunks +100 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/EditingStyle.cpp View 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/UseCounter.cpp View 1 2 3 4 2 chunks +4 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.cpp View 1 2 3 4 3 chunks +7 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/style/ComputedStyle.h View 1 2 3 4 9 chunks +21 lines, -25 lines 0 comments Download
M third_party/WebKit/Source/core/style/ComputedStyle.cpp View 1 2 3 4 3 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/style/ComputedStyleConstants.h View 1 2 3 4 1 chunk +16 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/style/StyleMultiColData.h View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/style/StyleMultiColData.cpp View 2 chunks +2 lines, -9 lines 0 comments Download

Messages

Total messages: 31 (9 generated)
mstensho (USE GERRIT)
@timloh - can you take a look at the changes in core/css/ , please? @leviw ...
4 years, 10 months ago (2016-02-09 22:19:24 UTC) #2
rune
https://codereview.chromium.org/1681273003/diff/20001/third_party/WebKit/Source/core/css/CSSValueKeywords.in File third_party/WebKit/Source/core/css/CSSValueKeywords.in (right): https://codereview.chromium.org/1681273003/diff/20001/third_party/WebKit/Source/core/css/CSSValueKeywords.in#newcode1079 third_party/WebKit/Source/core/css/CSSValueKeywords.in:1079: avoid-region On 2016/02/09 22:19:24, mstensho wrote: > Do we ...
4 years, 10 months ago (2016-02-09 23:52:17 UTC) #3
mstensho (USE GERRIT)
https://codereview.chromium.org/1681273003/diff/20001/third_party/WebKit/Source/core/css/CSSValueKeywords.in File third_party/WebKit/Source/core/css/CSSValueKeywords.in (right): https://codereview.chromium.org/1681273003/diff/20001/third_party/WebKit/Source/core/css/CSSValueKeywords.in#newcode1079 third_party/WebKit/Source/core/css/CSSValueKeywords.in:1079: avoid-region On 2016/02/09 23:52:17, rune wrote: > On 2016/02/09 ...
4 years, 10 months ago (2016-02-10 06:09:03 UTC) #4
mstensho (USE GERRIT)
ping @leviw @timloh This is the first patch in a series of three, which will ...
4 years, 10 months ago (2016-02-17 08:01:29 UTC) #5
leviw_travelin_and_unemployed
Tim still needs to sign-off on css/, but the rest LGMT.
4 years, 10 months ago (2016-02-18 02:37:13 UTC) #7
leviw_travelin_and_unemployed
whoops.... lgtm
4 years, 10 months ago (2016-02-18 02:37:34 UTC) #8
Timothy Loh
On 2016/02/18 02:37:13, leviw wrote: > Tim still needs to sign-off on css/, but the ...
4 years, 10 months ago (2016-02-18 02:40:00 UTC) #9
Timothy Loh
lgtm https://codereview.chromium.org/1681273003/diff/40001/third_party/WebKit/Source/core/css/CSSProperties.in File third_party/WebKit/Source/core/css/CSSProperties.in (right): https://codereview.chromium.org/1681273003/diff/40001/third_party/WebKit/Source/core/css/CSSProperties.in#newcode156 third_party/WebKit/Source/core/css/CSSProperties.in:156: break-after type_name=EBreak, initial=initialBreakAfter doesn't it guess exactly these ...
4 years, 10 months ago (2016-02-18 06:25:45 UTC) #10
mstensho (USE GERRIT)
Looks like I need an approval from an API owner as well, since I'm modifying ...
4 years, 10 months ago (2016-02-18 09:05:26 UTC) #12
mstensho (USE GERRIT)
Trying an API owner in Europe. :) @jochen - can you take a look, please? ...
4 years, 10 months ago (2016-02-18 10:21:27 UTC) #14
philipj_slow
On 2016/02/18 10:21:27, mstensho wrote: > Trying an API owner in Europe. :) > > ...
4 years, 10 months ago (2016-02-18 12:08:22 UTC) #15
mstensho (USE GERRIT)
On 2016/02/18 12:08:22, philipj_UTC7 wrote: > On 2016/02/18 10:21:27, mstensho wrote: > > Trying an ...
4 years, 10 months ago (2016-02-18 12:18:41 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1681273003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1681273003/80001
4 years, 10 months ago (2016-02-18 12:20:06 UTC) #19
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 10 months ago (2016-02-18 12:28:16 UTC) #21
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/c78e9708e49aa13bd5bd9382983f4aa060680dfd Cr-Commit-Position: refs/heads/master@{#376148}
4 years, 10 months ago (2016-02-18 12:29:34 UTC) #23
PhistucK
This looks like a breaking change (getComputedStyle(element).webkitColumnBreakAfter will return undefined from now on, right?)... Does ...
4 years, 10 months ago (2016-02-18 12:53:13 UTC) #24
PhistucK
4 years, 10 months ago (2016-02-18 12:53:21 UTC) #26
PhistucK
On 2016/02/18 at 12:53:13, PhistucK wrote: > This looks like a breaking change (getComputedStyle(element).webkitColumnBreakAfter will ...
4 years, 10 months ago (2016-02-18 12:55:27 UTC) #27
drott
Similar to https://codereview.chromium.org/1710003002/, could it be that this is missing the tools/metrics/histograms/histograms.xml update?
4 years, 10 months ago (2016-02-22 06:45:21 UTC) #28
PhistucK
On 2016/02/18 at 12:55:27, PhistucK wrote: > On 2016/02/18 at 12:53:13, PhistucK wrote: > > ...
4 years, 10 months ago (2016-02-22 06:50:41 UTC) #29
mstensho (USE GERRIT)
On 2016/02/22 06:45:21, drott wrote: > Similar to https://codereview.chromium.org/1710003002/, could it be that this is ...
4 years, 10 months ago (2016-02-22 10:40:52 UTC) #30
drott
4 years, 10 months ago (2016-02-25 07:46:46 UTC) #31
Message was sent while issue was closed.
On 2016/02/22 at 10:40:52, mstensho wrote:

> See https://codereview.chromium.org/1720823002/

Thanks!

Powered by Google App Engine
This is Rietveld 408576698