W3C home > Mailing lists > Public > www-style@w3.org > April 2014

[css3-regions][css3-multicol] how to cutt up elements

From: Johannes Wilm <johannes@fiduswriter.org>
Date: Tue, 15 Apr 2014 22:05:30 +0200
Message-ID: <CABkgm-SQfEhUHMxRL4k7b7iPrZA4C53uT+1dmPTkWQxGvxUaqw@mail.gmail.com>
To: www-style list <www-style@w3.org>
Hey,
given that CSS Regions unfortunately have been (temporarily) removed from
Blink, I've been experimenting with what other options there are to cut op
content, but letting the browser do the actual cutting.

The only solutions I have come up with is using multiple CSS columsn and
then to determine where one columns ends
using caretPositionFromPoint/caretRangeFromPoint, and then cutting using
range.extractContents to remove the parts that don't fit.

I have recreated most of the options I had available in the old
pagination.js using this method in this test:
http://fiduswriter.github.io/simplePagination.js/simplePagination.html(working
in Chrome and Firefox if the browser is occupying the entire
screen).

It is somewhat of a hack,
because caretPositionFromPoint/caretRangeFromPoint only works if one first
scrolls to the place where one uses it.


So my question to you guys: Is this how you suggest one cuts up contents?
Is there no less hackish way envisioned for javascript to determine what
content belongs to one specific column? It seems like that would be quite
an important piece of information for many uses.

-- 
Johannes Wilm
Fidus Writer
http://www.fiduswriter.com
Received on Tuesday, 15 April 2014 20:05:57 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:39 UTC