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