[Webkit-unassigned] [Bug 61256] Print HTML with only 1 line, then 2 pages are printed

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 24 01:03:27 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=61256





--- Comment #13 from Kentaro Hara <haraken at google.com>  2011-05-24 01:03:27 PST ---
> View in context: https://bugs.webkit.org/attachment.cgi?id=94538&action=review
> 
> Could you add a test that captures original problem?

I added the test, printing/page-count-with-one-line.html

> > Source/WebCore/ChangeLog:12
> > +        Thus, this patch allowes rounding error smaller than 1.0px when calculating
> 
> Nit: allowes -> allows?

I fixed it.

> > Source/WebCore/page/PrintContext.cpp:94
> >      }
> 
> These two changes seem almost identical. Could you extract them to a static function?

Yes, almost identical, but I am afraid that the static function won't make the code clearer, since we somewhere need to swap the width and height of printRect and documentRect. Do you mean that we should change like this?:

static void computePageSize(int documetRect_width, int documentRect_height, int printRect_width, int printRect_height, int *pageWidth, int *pageHeight) {
  ...;
}

void computePageRects(...) {
  ...;
  if (isHorizental)
    computePageSize(documentRect.width(), documentRect.height(), printRect.width(), printRect.height(), &pageWidth, &pageHeight);
  else
    computePageSize(documentRect.height(), documentRect.width(), printRect.height(), printRect.width(), &pageHeight, &pageWidth);
}

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list