Changeset 55988 in webkit


Ignore:
Timestamp:
Mar 15, 2010 1:33:18 AM (14 years ago)
Author:
yuzo@google.com
Message:

2010-03-14 Yuzo Fujishima <yuzo@google.com>

Reviewed by Shinichiro Hamaji.

Always call PrintContext.end() from PrintContext::pageNumberForElement().

Without this change, WebKit remains in printing mode after determining the page number if the specified element is found.

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

  • platform/gtk/Skipped:
  • platform/mac/printing/return-from-printing-mode-expected.checksum: Added.
  • platform/mac/printing/return-from-printing-mode-expected.png: Added.
  • platform/mac/printing/return-from-printing-mode-expected.txt: Added.
  • platform/qt/Skipped:
  • platform/win/Skipped:
  • printing/return-from-printing-mode.html: Added.

2010-03-14 Yuzo Fujishima <yuzo@google.com>

Reviewed by Shinichiro Hamaji.

Always call PrintContext.end() from PrintContext::pageNumberForElement().

Without this change, WebKit remains in printing mode after determining the page number if the specified element is found.

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

Test: printing/return-from-printing-mode.html

  • page/PrintContext.cpp: (WebCore::PrintContext::pageNumberForElement):
Location:
trunk
Files:
5 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r55980 r55988  
     12010-03-14  Yuzo Fujishima  <yuzo@google.com>
     2
     3        Reviewed by Shinichiro Hamaji.
     4
     5        Always call PrintContext.end() from PrintContext::pageNumberForElement().
     6
     7        Without this change, WebKit remains in printing mode after determining the page number if the specified element is found.
     8
     9        https://bugs.webkit.org/show_bug.cgi?id=36049
     10
     11        * platform/gtk/Skipped:
     12        * platform/mac/printing/return-from-printing-mode-expected.checksum: Added.
     13        * platform/mac/printing/return-from-printing-mode-expected.png: Added.
     14        * platform/mac/printing/return-from-printing-mode-expected.txt: Added.
     15        * platform/qt/Skipped:
     16        * platform/win/Skipped:
     17        * printing/return-from-printing-mode.html: Added.
     18
    1192010-03-14  Yael Aharon  <yael.aharon@nokia.com>
    220
  • trunk/LayoutTests/platform/gtk/Skipped

    r55980 r55988  
    35953595# Tests in printing/ directory
    35963596#   Tests generating new results
     3597printing/compositing-layer-printing.html
    35973598printing/media-queries-print.html
    3598 printing/compositing-layer-printing.html
     3599printing/return-from-printing-mode.html
    35993600
    36003601# Tests in scrollbars/ directory
  • trunk/LayoutTests/platform/qt/Skipped

    r55950 r55988  
    36803680fonts/serif.html
    36813681plugins/embed-attributes-style.html
     3682printing/return-from-printing-mode.html
    36823683scrollbars/basic-scrollbar.html
    36833684scrollbars/disabled-scrollbar.html
  • trunk/LayoutTests/platform/win/Skipped

    r55926 r55988  
    433433printing/compositing-layer-printing.html
    434434printing/media-queries-print.html
     435# Tests generating new results
     436printing/return-from-printing-mode.html
    435437
    436438# No upload progress events on windows
  • trunk/WebCore/ChangeLog

    r55987 r55988  
     12010-03-14  Yuzo Fujishima  <yuzo@google.com>
     2
     3        Reviewed by Shinichiro Hamaji.
     4
     5        Always call PrintContext.end() from PrintContext::pageNumberForElement().
     6
     7        Without this change, WebKit remains in printing mode after determining the page number if the specified element is found.
     8
     9        https://bugs.webkit.org/show_bug.cgi?id=36049
     10
     11        Test: printing/return-from-printing-mode.html
     12
     13        * page/PrintContext.cpp:
     14        (WebCore::PrintContext::pageNumberForElement):
     15
    1162010-03-11  Philippe Normand  <pnormand@igalia.com>
    217
  • trunk/WebCore/page/PrintContext.cpp

    r54533 r55988  
    180180    int top = box->offsetTop();
    181181    int left = box->offsetLeft();
    182     for (int pageNumber = 0; pageNumber < printContext.pageCount(); pageNumber++) {
     182    int pageNumber = 0;
     183    for (; pageNumber < printContext.pageCount(); pageNumber++) {
    183184        const IntRect& page = printContext.pageRect(pageNumber);
    184185        if (page.x() <= left && left < page.right() && page.y() <= top && top < page.bottom())
    185             return pageNumber;
     186            break;
    186187    }
    187188    printContext.end();
    188     return -1;
     189    return (pageNumber < printContext.pageCount() ? pageNumber : -1);
    189190}
    190191
Note: See TracChangeset for help on using the changeset viewer.