- Develop an open-source CSS typesetting engine that runs on web browsers that anyone can freely use.
- Use web browser's rendering engine and PDF output feature.
- Support the latest web standards via web browsers.
- Add support for CSS specifications for paged media:
- CSS Paged Media
- CSS Generated Content for Paged Media
- CSS Fragmentation
- CSS Page Floats
- etc.
Advantages of using web browsers:
- CSS capabilities improve as browser rendering engines evolve
- Can leverage the browser ecosystem
- Possibility of real-time preview in browsers
Disadvantages of using web browsers:
- Affected by browser bugs and changes
- PDF generation feature has limitations depending on browsers
Proposed specs:
Example:
figure {
float: outside;
margin-inside: 1ch;
}insidemaps tolefton right-page andrighton left-pageoutsidemaps torighton right-page andlefton left-page
vivliostyle/vivliostyle.js#1519
Added
*-inside/outsideproperties:
margin-inside,margin-outsidepadding-inside,padding-outsideborder-inside,border-outsideborder-inside-color,border-outside-colorborder-inside-style,border-outside-styleborder-inside-width,border-outside-widthinset-inside,inset-outsideExtended properties with
insideandoutsidevalues:
float,cleartext-align,text-align-last
- Antenna House: https://www.antenna.co.jp/AHF/help/en/
float,clear,text-align,text-align-last.
- Prince: https://www.princexml.com/doc/css-props/
margin-inside,margin-outsidefloat,clear,text-align,text-align-all,text-align-last.
Naming issue: spread-inside and spread-outside might be better than inside and outside.
e.g. margin-spread-inside, margin-spread-outside
Advantages of spread-inside and spread-outside:
- more meaningful
- similar to CSS-logical keywords
block-start,block-end,inline-start,inline-end - used in DSSSL
Advantages of inside and outside:
- shorter
- already used in the proposed specs and there are some implementations
- used in XSL Formatting Objects
Proposed specs:
vivliostyle/vivliostyle.js#1444
float: none | [ block-start || block-end || inline-start || inline-end || left || right || top || bottom ]Examples:
float: top; // float to top edge float: top left; // float to top left corner …
- Antenna House: https://www.antenna.co.jp/AHF/help/en/ahf-float.html
Stacking direction when multiple floats are placed in the same position.
for float: block-start (= float: top in horizontal-tb writing mode):
- Stacking direction must be from block-start to block-end (top to bottom in horizontal writing mode)
for float: block-end (= float: bottom in horizontal-tb writing mode):
- Aligned to block-end, but should be stacked from block-start to block-end.
- Question: This may be inconsistent with traditional CSS floats, where boxes with
float: inline-end(float: rightin LTR text) are stacked from inline-end to inline-start. But is there a use case for stacking from block-end to block-start?
- Question: This may be inconsistent with traditional CSS floats, where boxes with
for float: block-start inline-start (= float: top left in horizontal and LTR writing mode):
- Aligned to block-start and inline-start
- Stacked from block-start to block-end
- Question: Should be stacked from inline-start to inline-end first, then from block-start to block-end?
for float: block-start inline-end (= float: top right in horizontal and LTR writing mode):
- Aligned to block-start and inline-end
- Stacked from block-start to block-end
- Question: Should be stacked from inline-start to inline-end or from inline-end to inline-start first, then from block-start to block-end?
Related Vivliostyle.js issue: Should 2D page floats be stacked in inline direction first?
Proposed spec:
Elements may request to clear page floats with the 'clear' property:
column: The page float requests to be the first page float at its favored position in the column; rather than being stacked after other page floats, it should be moved to the next possible position.
page: The page float requests to be the first page float on the page. If there is already another page float on the page, the page float is moved to the next page.The placement process is iterative; if the requested position cannot be honored, the page float the next possible position is tried, etc.
When
clear: pageorclear: columnis specified on a non-page-float element, it should also take effect and the element should be moved to the next page or column if preceding page floats exist in the current page or column.
vivliostyle/vivliostyle.js#1551
Proposed spec: