| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Simon Hausmann <hausmann@kde.org> | 3 * (C) 2000 Simon Hausmann <hausmann@kde.org> |
| 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) | 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) |
| 5 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. |
| 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 288 |
| 289 void LayoutPart::updateOnWidgetChange() { | 289 void LayoutPart::updateOnWidgetChange() { |
| 290 FrameViewBase* frameViewBase = this->widget(); | 290 FrameViewBase* frameViewBase = this->widget(); |
| 291 if (!frameViewBase) | 291 if (!frameViewBase) |
| 292 return; | 292 return; |
| 293 | 293 |
| 294 if (!style()) | 294 if (!style()) |
| 295 return; | 295 return; |
| 296 | 296 |
| 297 if (!needsLayout()) | 297 if (!needsLayout()) |
| 298 updateWidgetGeometryInternal(); | 298 updateGeometryInternal(); |
| 299 | 299 |
| 300 if (style()->visibility() != EVisibility::kVisible) { | 300 if (style()->visibility() != EVisibility::kVisible) { |
| 301 frameViewBase->hide(); | 301 frameViewBase->hide(); |
| 302 } else { | 302 } else { |
| 303 frameViewBase->show(); | 303 frameViewBase->show(); |
| 304 // FIXME: Why do we issue a full paint invalidation in this case, but not | 304 // FIXME: Why do we issue a full paint invalidation in this case, but not |
| 305 // the other? | 305 // the other? |
| 306 setShouldDoFullPaintInvalidation(); | 306 setShouldDoFullPaintInvalidation(); |
| 307 } | 307 } |
| 308 } | 308 } |
| 309 | 309 |
| 310 void LayoutPart::updateWidgetGeometry() { | 310 void LayoutPart::updateGeometry() { |
| 311 FrameViewBase* frameViewBase = this->widget(); | 311 FrameViewBase* frameViewBase = this->widget(); |
| 312 if (!frameViewBase || | 312 if (!frameViewBase || |
| 313 !node()) // Check the node in case destroy() has been called. | 313 !node()) // Check the node in case destroy() has been called. |
| 314 return; | 314 return; |
| 315 | 315 |
| 316 LayoutRect newFrame = replacedContentRect(); | 316 LayoutRect newFrame = replacedContentRect(); |
| 317 DCHECK(newFrame.size() == roundedIntSize(newFrame.size())); | 317 DCHECK(newFrame.size() == roundedIntSize(newFrame.size())); |
| 318 bool boundsWillChange = | 318 bool boundsWillChange = |
| 319 LayoutSize(frameViewBase->frameRect().size()) != newFrame.size(); | 319 LayoutSize(frameViewBase->frameRect().size()) != newFrame.size(); |
| 320 | 320 |
| 321 FrameView* frameView = | 321 FrameView* frameView = |
| 322 frameViewBase->isFrameView() ? toFrameView(frameViewBase) : nullptr; | 322 frameViewBase->isFrameView() ? toFrameView(frameViewBase) : nullptr; |
| 323 | 323 |
| 324 // If frame bounds are changing mark the view for layout. Also check the | 324 // If frame bounds are changing mark the view for layout. Also check the |
| 325 // frame's page to make sure that the frame isn't in the process of being | 325 // frame's page to make sure that the frame isn't in the process of being |
| 326 // destroyed. If iframe scrollbars needs reconstruction from native to custom | 326 // destroyed. If iframe scrollbars needs reconstruction from native to custom |
| 327 // scrollbar, then also we need to layout the frameview. | 327 // scrollbar, then also we need to layout the frameview. |
| 328 if (frameView && frameView->frame().page() && | 328 if (frameView && frameView->frame().page() && |
| 329 (boundsWillChange || frameView->needsScrollbarReconstruction())) | 329 (boundsWillChange || frameView->needsScrollbarReconstruction())) |
| 330 frameView->setNeedsLayout(); | 330 frameView->setNeedsLayout(); |
| 331 | 331 |
| 332 updateWidgetGeometryInternal(); | 332 updateGeometryInternal(); |
| 333 | 333 |
| 334 // If view needs layout, either because bounds have changed or possibly | 334 // If view needs layout, either because bounds have changed or possibly |
| 335 // indicating content size is wrong, we have to do a layout to set the right | 335 // indicating content size is wrong, we have to do a layout to set the right |
| 336 // FrameViewBase size. | 336 // FrameViewBase size. |
| 337 if (frameView && frameView->needsLayout() && frameView->frame().page()) | 337 if (frameView && frameView->needsLayout() && frameView->frame().page()) |
| 338 frameView->layout(); | 338 frameView->layout(); |
| 339 | 339 |
| 340 frameViewBase->widgetGeometryMayHaveChanged(); | 340 frameViewBase->geometryMayHaveChanged(); |
| 341 } | 341 } |
| 342 | 342 |
| 343 void LayoutPart::updateWidgetGeometryInternal() { | 343 void LayoutPart::updateGeometryInternal() { |
| 344 FrameViewBase* frameViewBase = this->widget(); | 344 FrameViewBase* frameViewBase = this->widget(); |
| 345 DCHECK(frameViewBase); | 345 DCHECK(frameViewBase); |
| 346 | 346 |
| 347 // Ignore transform here, as we only care about the sub-pixel accumulation. | 347 // Ignore transform here, as we only care about the sub-pixel accumulation. |
| 348 // TODO(trchen): What about multicol? Need a LayoutBox function to query | 348 // TODO(trchen): What about multicol? Need a LayoutBox function to query |
| 349 // sub-pixel accumulation. | 349 // sub-pixel accumulation. |
| 350 LayoutPoint absoluteLocation(localToAbsolute(FloatPoint())); | 350 LayoutPoint absoluteLocation(localToAbsolute(FloatPoint())); |
| 351 LayoutRect absoluteReplacedRect = replacedContentRect(); | 351 LayoutRect absoluteReplacedRect = replacedContentRect(); |
| 352 absoluteReplacedRect.moveBy(absoluteLocation); | 352 absoluteReplacedRect.moveBy(absoluteLocation); |
| 353 | 353 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 } | 391 } |
| 392 | 392 |
| 393 bool LayoutPart::isThrottledFrameView() const { | 393 bool LayoutPart::isThrottledFrameView() const { |
| 394 if (!widget() || !widget()->isFrameView()) | 394 if (!widget() || !widget()->isFrameView()) |
| 395 return false; | 395 return false; |
| 396 const FrameView* frameView = toFrameView(widget()); | 396 const FrameView* frameView = toFrameView(widget()); |
| 397 return frameView->shouldThrottleRendering(); | 397 return frameView->shouldThrottleRendering(); |
| 398 } | 398 } |
| 399 | 399 |
| 400 } // namespace blink | 400 } // namespace blink |
| OLD | NEW |