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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutPart.cpp

Issue 1513573013: Don't call LayoutPart::widgetPositionsUpdated unnecessarily. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
OLDNEW
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
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 bool 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 false;
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 return boundsChanged;
297 } 298 }
298 299
299 void LayoutPart::widgetPositionsUpdated() 300 void LayoutPart::widgetGeometriesUpdated()
300 { 301 {
301 Widget* widget = this->widget(); 302 Widget* widget = this->widget();
302 if (!widget) 303 if (!widget)
303 return; 304 return;
304 widget->widgetPositionsUpdated(); 305 widget->widgetGeometriesUpdated();
305 } 306 }
306 307
307 bool LayoutPart::updateWidgetGeometry() 308 bool LayoutPart::updateWidgetGeometryInternal()
308 { 309 {
309 Widget* widget = this->widget(); 310 Widget* widget = this->widget();
310 ASSERT(widget); 311 ASSERT(widget);
311 312
312 LayoutRect contentBox = contentBoxRect(); 313 LayoutRect contentBox = contentBoxRect();
313 LayoutRect absoluteContentBox(localToAbsoluteQuad(FloatQuad(FloatRect(conten tBox))).boundingBox()); 314 LayoutRect absoluteContentBox(localToAbsoluteQuad(FloatQuad(FloatRect(conten tBox))).boundingBox());
314 if (widget->isFrameView()) { 315 if (widget->isFrameView()) {
315 contentBox.setLocation(absoluteContentBox.location()); 316 contentBox.setLocation(absoluteContentBox.location());
316 return setWidgetGeometry(contentBox); 317 return setWidgetGeometry(contentBox);
317 } 318 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 360
360 bool LayoutPart::isThrottledFrameView() const 361 bool LayoutPart::isThrottledFrameView() const
361 { 362 {
362 if (!widget() || !widget()->isFrameView()) 363 if (!widget() || !widget()->isFrameView())
363 return false; 364 return false;
364 const FrameView* frameView = toFrameView(widget()); 365 const FrameView* frameView = toFrameView(widget());
365 return frameView->shouldThrottleRendering(); 366 return frameView->shouldThrottleRendering();
366 } 367 }
367 368
368 } 369 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698