主权项 |
1. A method comprising:
performing, using a computer, a first pass of laying out source content into a total target area to determine a total crash area consumed by the source content, the first pass comprising collecting progress data; and performing a second pass of laying out a plurality of segments of the source content into the total target area to generate a data object model, the second pass performed after the first pass has been performed, wherein the second pass comprises at least: for a first segment of the plurality of segments corresponding with a first content position in the source content:
collecting current progress data for the first segment of the plurality of segments,determining a first remaining target area value using the current progress data for the first segment, the first remaining target area value indicating a first portion of the total target area remaining to be consumed at the first content position during the second pass,determining a first remaining crash area value based on the progress data, the first remaining crash area value indicating a first portion of the total crash area that remained to be consumed at the first content position during the first pass,calculating a first adjustment factor for the segment of the source content as a function of the first remaining target area value and the first remaining crash area value,based on the adjustment factor, modifying the segment to produce a modified segment, andappending the first modified segment to a first content portion already laid out in the total target area; and for a second segment of the plurality of segments corresponding with a second content position in the source content:
collecting current progress data for the second segment of the plurality of segments,determining a second remaining target area value using the current progress data for the second segment, the second remaining target area value indicating a second portion of the total target area remaining to be consumed at the second content position during the second pass,determining a second remaining crash area value based on the progress data, the second remaining crash area value indicating a second portion of the total crash area that remained to be consumed at the second content position during the fist pass,calculating a second adjustment factor for the second segment of the source content as a function of the second remaining target area value and the second remaining crash area value,based on the second adjustment factor, modifying the second segment to produce a second modified segment, andappending the second modified segment to a second content portion already laid out in the total target area; and providing the data object model to a browser engine for rendering. |