Skip to content

Commit

Permalink
Remove page-break-* support since it is not a prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Feb 11, 2018
1 parent ca6ff9b commit e1853af
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
7 changes: 4 additions & 3 deletions data/prefixes.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,18 +220,19 @@ f(require('caniuse-lite/data/features/css-element-function.js'), browsers =>
f(require('caniuse-lite/data/features/multicolumn.js'), browsers => {
prefix([
'columns', 'column-width', 'column-gap',
'column-rule', 'column-rule-color', 'column-rule-width'
'column-rule', 'column-rule-color', 'column-rule-width',
'column-count', 'column-rule-style', 'column-span', 'column-fill'
], {
feature: 'multicolumn',
browsers
});

const noff = browsers.filter(i => !/firefox/.test(i));
prefix([
'column-count', 'column-rule-style', 'column-span', 'column-fill',
'break-before', 'break-after', 'break-inside'
], {
feature: 'multicolumn',
browsers
browsers: noff
});
});

Expand Down
10 changes: 2 additions & 8 deletions lib/hacks/break-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ class BreakProps extends Declaration {
* Change name for -webkit- and -moz- prefix
*/
prefixed(prop, prefix) {
if (prefix === '-moz-') {
return `page-${prop}`;
} else {
return `${prefix}column-${prop}`;
}
return `${prefix}column-${prop}`;
}

/**
Expand Down Expand Up @@ -51,9 +47,7 @@ class BreakProps extends Declaration {
insert(decl, prefix, prefixes) {
if (decl.prop !== 'break-inside') {
return super.insert(decl, prefix, prefixes);
} else if (decl.value === 'avoid-region') {
return undefined;
} else if (decl.value === 'avoid-page' && prefix === '-webkit-') {
} else if (/region/i.test(decl.value) || /page/i.test(decl.value)) {
return undefined;
} else {
return super.insert(decl, prefix, prefixes);
Expand Down
4 changes: 4 additions & 0 deletions test/cases/multicolumn.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@
.e {
break-inside: avoid-region;
}

.f {
break-inside: region;
}
12 changes: 5 additions & 7 deletions test/cases/multicolumn.out.css
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
.a {
-webkit-column-break-inside: auto;
page-break-inside: auto;
break-inside: auto;
-webkit-column-break-before: auto;
page-break-before: auto;
break-before: auto;
-webkit-column-break-after: auto;
page-break-after: auto;
break-after: auto;
}

.b {
-webkit-column-break-inside: avoid;
page-break-inside: avoid;
break-inside: avoid;
}

.c {
-webkit-column-break-inside: avoid;
page-break-inside: avoid;
break-inside: avoid-column;
}

.d {
page-break-inside: avoid;
break-inside: avoid-page;
break-inside: avoid-page;
}

.e {
break-inside: avoid-region;
}

.f {
break-inside: region;
}

0 comments on commit e1853af

Please sign in to comment.