Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: Source/core/page/PrintContext.cpp

Issue 301523002: Oilpan: convert remaining dom + page Element refs to transition types. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/page/DragController.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 2 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
3 * Copyright (C) 2007 Apple Inc. 3 * Copyright (C) 2007 Apple Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 while (object && !object->isBoxModelObject()) 202 while (object && !object->isBoxModelObject())
203 object = object->parent(); 203 object = object->parent();
204 if (!object) 204 if (!object)
205 return 0; 205 return 0;
206 return toRenderBoxModelObject(object); 206 return toRenderBoxModelObject(object);
207 } 207 }
208 208
209 int PrintContext::pageNumberForElement(Element* element, const FloatSize& pageSi zeInPixels) 209 int PrintContext::pageNumberForElement(Element* element, const FloatSize& pageSi zeInPixels)
210 { 210 {
211 // Make sure the element is not freed during the layout. 211 // Make sure the element is not freed during the layout.
212 RefPtrWillBeRawPtr<Element> elementRef(element); 212 RefPtrWillBeRawPtr<Element> protect(element);
213 element->document().updateLayout(); 213 element->document().updateLayout();
214 214
215 RenderBoxModelObject* box = enclosingBoxModelObject(element->renderer()); 215 RenderBoxModelObject* box = enclosingBoxModelObject(element->renderer());
216 if (!box) 216 if (!box)
217 return -1; 217 return -1;
218 218
219 LocalFrame* frame = element->document().frame(); 219 LocalFrame* frame = element->document().frame();
220 FloatRect pageRect(FloatPoint(0, 0), pageSizeInPixels); 220 FloatRect pageRect(FloatPoint(0, 0), pageSizeInPixels);
221 PrintContext printContext(frame); 221 PrintContext printContext(frame);
222 printContext.begin(pageRect.width(), pageRect.height()); 222 printContext.begin(pageRect.width(), pageRect.height());
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 printContext.spoolPage(graphicsContext, pageIndex, pageWidth); 373 printContext.spoolPage(graphicsContext, pageIndex, pageWidth);
374 graphicsContext.restore(); 374 graphicsContext.restore();
375 375
376 currentHeight += pageSizeInPixels.height() + 1; 376 currentHeight += pageSizeInPixels.height() + 1;
377 } 377 }
378 378
379 graphicsContext.restore(); 379 graphicsContext.restore();
380 } 380 }
381 381
382 } 382 }
OLDNEW
« no previous file with comments | « Source/core/page/DragController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698