Changeset 53527 in webkit


Ignore:
Timestamp:
Jan 20, 2010 12:26:18 AM (14 years ago)
Author:
hamaji@chromium.org
Message:

2010-01-20 Shinichiro Hamaji <hamaji@chromium.org>

Reviewed by Darin Fisher.

[Chromium] computePageRectsForFrame seems to be unnecessary
https://bugs.webkit.org/show_bug.cgi?id=33881

  • WebCore.gypi: Removed FrameChromium.h
  • page/chromium/FrameChromium.cpp: Removed computePageRectsForFrame.
  • page/chromium/FrameChromium.h: Removed.

2010-01-20 Shinichiro Hamaji <hamaji@chromium.org>

Reviewed by Darin Fisher.

[Chromium] computePageRectsForFrame seems to be unnecessary
https://bugs.webkit.org/show_bug.cgi?id=33881

  • src/WebFrameImpl.cpp: Stop including FrameChromium.h
Location:
trunk
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r53525 r53527  
     12010-01-20  Shinichiro Hamaji  <hamaji@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        [Chromium] computePageRectsForFrame seems to be unnecessary
     6        https://bugs.webkit.org/show_bug.cgi?id=33881
     7
     8        * WebCore.gypi: Removed FrameChromium.h
     9        * page/chromium/FrameChromium.cpp: Removed computePageRectsForFrame.
     10        * page/chromium/FrameChromium.h: Removed.
     11
    1122010-01-20  Roland Steiner  <rolandsteiner@chromium.org>
    213
  • trunk/WebCore/WebCore.gypi

    r53512 r53527  
    17441744            'page/chromium/EventHandlerChromium.cpp',
    17451745            'page/chromium/FrameChromium.cpp',
    1746             'page/chromium/FrameChromium.h',
    17471746            'page/gtk/DragControllerGtk.cpp',
    17481747            'page/gtk/EventHandlerGtk.cpp',
  • trunk/WebCore/page/chromium/FrameChromium.cpp

    r47451 r53527  
    2626
    2727#include "config.h"
    28 #include "FrameChromium.h"
    2928
    3029#include "Document.h"
     
    3736namespace WebCore {
    3837
    39 void computePageRectsForFrame(Frame* frame, const IntRect& printRect, float headerHeight, float footerHeight, float userScaleFactor, Vector<IntRect>& pages, int& outPageHeight)
    40 {
    41     ASSERT(frame);
    42 
    43     pages.clear();
    44     outPageHeight = 0;
    45 
    46     if (!frame->document() || !frame->view() || !frame->document()->renderer())
    47         return;
    48  
    49     RenderView* root = toRenderView(frame->document()->renderer());
    50 
    51     if (!root) {
    52         LOG_ERROR("document to be printed has no renderer");
    53         return;
    54     }
    55 
    56     if (userScaleFactor <= 0) {
    57         LOG_ERROR("userScaleFactor has bad value %.2f", userScaleFactor);
    58         return;
    59     }
    60    
    61     float ratio = static_cast<float>(printRect.height()) / static_cast<float>(printRect.width());
    62  
    63     float pageWidth  = static_cast<float>(root->rightLayoutOverflow());
    64     float pageHeight = pageWidth * ratio;
    65     outPageHeight = static_cast<int>(pageHeight);   // this is the height of the page adjusted by margins
    66     pageHeight -= (headerHeight + footerHeight);
    67 
    68     if (pageHeight <= 0) {
    69         LOG_ERROR("pageHeight has bad value %.2f", pageHeight);
    70         return;
    71     }
    72 
    73     float currPageHeight = pageHeight / userScaleFactor;
    74     float docHeight      = root->layer()->height();
    75     float currPageWidth  = pageWidth / userScaleFactor;
    76 
    77    
    78     // always return at least one page, since empty files should print a blank page
    79     float printedPagesHeight = 0.0f;
    80     do {
    81         float proposedBottom = min(docHeight, printedPagesHeight + pageHeight);
    82         frame->view()->adjustPageHeight(&proposedBottom, printedPagesHeight, proposedBottom, printedPagesHeight);
    83         currPageHeight = max(1.0f, proposedBottom - printedPagesHeight);
    84        
    85         pages.append(IntRect(0, printedPagesHeight, currPageWidth, currPageHeight));
    86         printedPagesHeight += currPageHeight;
    87     } while (printedPagesHeight < docHeight);
    88 }
    89 
    9038DragImageRef Frame::dragImageForSelection()
    9139{   
  • trunk/WebKit/chromium/ChangeLog

    r53515 r53527  
     12010-01-20  Shinichiro Hamaji  <hamaji@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        [Chromium] computePageRectsForFrame seems to be unnecessary
     6        https://bugs.webkit.org/show_bug.cgi?id=33881
     7
     8        * src/WebFrameImpl.cpp: Stop including FrameChromium.h
     9
    1102010-01-19  Jon Honeycutt  <jhoneycutt@apple.com>
    211
  • trunk/WebKit/chromium/src/WebFrameImpl.cpp

    r53046 r53527  
    8585#include "EventHandler.h"
    8686#include "FormState.h"
    87 #include "FrameChromium.h"
    8887#include "FrameLoader.h"
    8988#include "FrameLoadRequest.h"
Note: See TracChangeset for help on using the changeset viewer.