ebu / ebu-tt-live-toolkit

Toolkit for supporting the EBU-TT Live specification
http://ebu.github.io/ebu-tt-live-toolkit/
BSD 3-Clause "New" or "Revised" License
25 stars 10 forks source link

Improve segmentation empty element prune code #240

Open kozmaz87 opened 8 years ago

kozmaz87 commented 8 years ago

This code is too spaghetti at the moment. The general problem is the following. You assume that there is a 1:1 correspondence with source styles and segmented styles, which is true as long as it is a singular document. But as soon as it gets into the merging phase of multiple documents it will cause trouble to find which styles were ultimately unused/moved or split into parts becasue of the horrid sizing requirements.

My guess is that the style on the body should be moved down to all the divs because styles on the body cannot be merged semantically in some cases.

nigelmegitt commented 8 years ago

This seems to be related to #239. I cannot think of any reason not to push the styles down where they need to be. An optimising processor might also spot repeated (computed) style attribute values downstream and where possible float them up to the highest common level but that's really not essential for us to worry about.

nigelmegitt commented 7 years ago

@kozmaz87 has this been done?