| OLD | NEW |
| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 while (object && !object->isBoxModelObject()) | 178 while (object && !object->isBoxModelObject()) |
| 179 object = object->parent(); | 179 object = object->parent(); |
| 180 if (!object) | 180 if (!object) |
| 181 return nullptr; | 181 return nullptr; |
| 182 return toLayoutBoxModelObject(object); | 182 return toLayoutBoxModelObject(object); |
| 183 } | 183 } |
| 184 | 184 |
| 185 int PrintContext::pageNumberForElement(Element* element, const FloatSize& pageSi
zeInPixels) | 185 int PrintContext::pageNumberForElement(Element* element, const FloatSize& pageSi
zeInPixels) |
| 186 { | 186 { |
| 187 // Make sure the element is not freed during the layout. | 187 // Make sure the element is not freed during the layout. |
| 188 RefPtrWillBeRawPtr<Element> protect(element); | 188 RawPtr<Element> protect(element); |
| 189 element->document().updateLayout(); | 189 element->document().updateLayout(); |
| 190 | 190 |
| 191 LayoutBoxModelObject* box = enclosingBoxModelObject(element->layoutObject())
; | 191 LayoutBoxModelObject* box = enclosingBoxModelObject(element->layoutObject())
; |
| 192 if (!box) | 192 if (!box) |
| 193 return -1; | 193 return -1; |
| 194 | 194 |
| 195 LocalFrame* frame = element->document().frame(); | 195 LocalFrame* frame = element->document().frame(); |
| 196 FloatRect pageRect(FloatPoint(0, 0), pageSizeInPixels); | 196 FloatRect pageRect(FloatPoint(0, 0), pageSizeInPixels); |
| 197 PrintContext printContext(frame); | 197 PrintContext printContext(frame); |
| 198 printContext.begin(pageRect.width(), pageRect.height()); | 198 printContext.begin(pageRect.width(), pageRect.height()); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 | 314 |
| 315 DEFINE_TRACE(PrintContext) | 315 DEFINE_TRACE(PrintContext) |
| 316 { | 316 { |
| 317 #if ENABLE(OILPAN) | 317 #if ENABLE(OILPAN) |
| 318 visitor->trace(m_frame); | 318 visitor->trace(m_frame); |
| 319 visitor->trace(m_linkedDestinations); | 319 visitor->trace(m_linkedDestinations); |
| 320 #endif | 320 #endif |
| 321 } | 321 } |
| 322 | 322 |
| 323 } // namespace blink | 323 } // namespace blink |
| OLD | NEW |