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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 void LayoutPart::updateOnWidgetChange() | 260 void LayoutPart::updateOnWidgetChange() |
261 { | 261 { |
262 Widget* widget = this->widget(); | 262 Widget* widget = this->widget(); |
263 if (!widget) | 263 if (!widget) |
264 return; | 264 return; |
265 | 265 |
266 if (!style()) | 266 if (!style()) |
267 return; | 267 return; |
268 | 268 |
269 if (!needsLayout()) | 269 if (!needsLayout()) |
270 updateWidgetGeometry(); | 270 updateWidgetGeometryInternal(); |
271 | 271 |
272 if (style()->visibility() != VISIBLE) { | 272 if (style()->visibility() != VISIBLE) { |
273 widget->hide(); | 273 widget->hide(); |
274 } else { | 274 } else { |
275 widget->show(); | 275 widget->show(); |
276 // FIXME: Why do we issue a full paint invalidation in this case, but no
t the other? | 276 // FIXME: Why do we issue a full paint invalidation in this case, but no
t the other? |
277 setShouldDoFullPaintInvalidation(); | 277 setShouldDoFullPaintInvalidation(); |
278 } | 278 } |
279 } | 279 } |
280 | 280 |
281 void LayoutPart::updateWidgetPosition() | 281 void LayoutPart::updateWidgetGeometry() |
282 { | 282 { |
283 Widget* widget = this->widget(); | 283 Widget* widget = this->widget(); |
284 if (!widget || !node()) // Check the node in case destroy() has been called. | 284 if (!widget || !node()) // Check the node in case destroy() has been called. |
285 return; | 285 return; |
286 | 286 |
287 bool boundsChanged = updateWidgetGeometry(); | 287 bool boundsChanged = updateWidgetGeometryInternal(); |
288 | 288 |
289 // If the frame bounds got changed, or if view needs layout (possibly indica
ting | 289 // If the frame bounds got changed, or if view needs layout (possibly indica
ting |
290 // content size is wrong) we have to do a layout to set the right widget siz
e. | 290 // content size is wrong) we have to do a layout to set the right widget siz
e. |
291 if (widget && widget->isFrameView()) { | 291 if (widget && widget->isFrameView()) { |
292 FrameView* frameView = toFrameView(widget); | 292 FrameView* frameView = toFrameView(widget); |
293 // Check the frame's page to make sure that the frame isn't in the proce
ss of being destroyed. | 293 // Check the frame's page to make sure that the frame isn't in the proce
ss of being destroyed. |
294 if ((boundsChanged || frameView->needsLayout()) && frameView->frame().pa
ge()) | 294 if ((boundsChanged || frameView->needsLayout()) && frameView->frame().pa
ge()) |
295 frameView->layout(); | 295 frameView->layout(); |
296 } | 296 } |
| 297 |
| 298 widget->widgetGeometryMayHaveChanged(); |
297 } | 299 } |
298 | 300 |
299 void LayoutPart::widgetPositionsUpdated() | 301 bool LayoutPart::updateWidgetGeometryInternal() |
300 { | |
301 Widget* widget = this->widget(); | |
302 if (!widget) | |
303 return; | |
304 widget->widgetPositionsUpdated(); | |
305 } | |
306 | |
307 bool LayoutPart::updateWidgetGeometry() | |
308 { | 302 { |
309 Widget* widget = this->widget(); | 303 Widget* widget = this->widget(); |
310 ASSERT(widget); | 304 ASSERT(widget); |
311 | 305 |
312 LayoutRect contentBox = contentBoxRect(); | 306 LayoutRect contentBox = contentBoxRect(); |
313 LayoutRect absoluteContentBox(localToAbsoluteQuad(FloatQuad(FloatRect(conten
tBox))).boundingBox()); | 307 LayoutRect absoluteContentBox(localToAbsoluteQuad(FloatQuad(FloatRect(conten
tBox))).boundingBox()); |
314 if (widget->isFrameView()) { | 308 if (widget->isFrameView()) { |
315 contentBox.setLocation(absoluteContentBox.location()); | 309 contentBox.setLocation(absoluteContentBox.location()); |
316 return setWidgetGeometry(contentBox); | 310 return setWidgetGeometry(contentBox); |
317 } | 311 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 | 353 |
360 bool LayoutPart::isThrottledFrameView() const | 354 bool LayoutPart::isThrottledFrameView() const |
361 { | 355 { |
362 if (!widget() || !widget()->isFrameView()) | 356 if (!widget() || !widget()->isFrameView()) |
363 return false; | 357 return false; |
364 const FrameView* frameView = toFrameView(widget()); | 358 const FrameView* frameView = toFrameView(widget()); |
365 return frameView->shouldThrottleRendering(); | 359 return frameView->shouldThrottleRendering(); |
366 } | 360 } |
367 | 361 |
368 } | 362 } |
OLD | NEW |