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

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

Issue 2188483004: Remove extraneous frameView->setNeedsLayout() in LayoutPart (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove bogus test Created 4 years, 4 months 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 { 290 {
291 return IntRect(roundedIntPoint(rect.location()), roundedIntSize(rect.size()) ); 291 return IntRect(roundedIntPoint(rect.location()), roundedIntSize(rect.size()) );
292 } 292 }
293 293
294 void LayoutPart::updateWidgetGeometry() 294 void LayoutPart::updateWidgetGeometry()
295 { 295 {
296 Widget* widget = this->widget(); 296 Widget* widget = this->widget();
297 if (!widget || !node()) // Check the node in case destroy() has been called. 297 if (!widget || !node()) // Check the node in case destroy() has been called.
298 return; 298 return;
299 299
300 IntRect newFrame = roundedIntRect(contentBoxRect());
301 bool boundsWillChange = widget->frameRect().size() != newFrame.size();
302
303 FrameView* frameView = widget->isFrameView() ? toFrameView(widget) : nullptr ;
304
305 // If frame bounds are changing mark the view for layout. Also check the
306 // frame's page to make sure that the frame isn't in the process of being
307 // destroyed.
308 if (frameView && boundsWillChange && frameView->frame().page())
309 frameView->setNeedsLayout();
310
311 updateWidgetGeometryInternal(); 300 updateWidgetGeometryInternal();
312 301
313 // If view needs layout, either because bounds have changed or possibly 302 // If view needs layout, either because bounds have changed or possibly
314 // indicating content size is wrong, we have to do a layout to set the right 303 // indicating content size is wrong, we have to do a layout to set the right
315 // widget size. 304 // widget size.
305 FrameView* frameView = widget->isFrameView() ? toFrameView(widget) : nullptr ;
316 if (frameView && frameView->needsLayout() && frameView->frame().page()) 306 if (frameView && frameView->needsLayout() && frameView->frame().page())
317 frameView->layout(); 307 frameView->layout();
318 308
319 widget->widgetGeometryMayHaveChanged(); 309 widget->widgetGeometryMayHaveChanged();
320 } 310 }
321 311
322 void LayoutPart::updateWidgetGeometryInternal() 312 void LayoutPart::updateWidgetGeometryInternal()
323 { 313 {
324 Widget* widget = this->widget(); 314 Widget* widget = this->widget();
325 ASSERT(widget); 315 ASSERT(widget);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 359
370 bool LayoutPart::isThrottledFrameView() const 360 bool LayoutPart::isThrottledFrameView() const
371 { 361 {
372 if (!widget() || !widget()->isFrameView()) 362 if (!widget() || !widget()->isFrameView())
373 return false; 363 return false;
374 const FrameView* frameView = toFrameView(widget()); 364 const FrameView* frameView = toFrameView(widget());
375 return frameView->shouldThrottleRendering(); 365 return frameView->shouldThrottleRendering();
376 } 366 }
377 367
378 } // namespace blink 368 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698