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

Side by Side Diff: Source/core/rendering/RenderBox.cpp

Issue 26355002: Disable offsetWidth optimization in perparation for disabling it on M30. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 return snapSizeToPixel(offsetWidth(), x() + clientLeft()); 403 return snapSizeToPixel(offsetWidth(), x() + clientLeft());
404 } 404 }
405 405
406 int RenderBox::pixelSnappedOffsetHeight() const 406 int RenderBox::pixelSnappedOffsetHeight() const
407 { 407 {
408 return snapSizeToPixel(offsetHeight(), y() + clientTop()); 408 return snapSizeToPixel(offsetHeight(), y() + clientTop());
409 } 409 }
410 410
411 bool RenderBox::canDetermineWidthWithoutLayout() const 411 bool RenderBox::canDetermineWidthWithoutLayout() const
412 { 412 {
413 // THIS OPTIMIZATION IS INCORRECT AS WRITTEN. 413 // FIXME: This optimization is incorrect as written.
414 // We need to be able to opt-in to this behavior only when
415 // it's guarentted correct.
abarth-chromium 2013/10/07 21:17:47 typo: guarentted
416 // Until then disabling this optimization to be safe.
417 return false;
418
414 // FIXME: There are likely many subclasses of RenderBlockFlow which 419 // FIXME: There are likely many subclasses of RenderBlockFlow which
415 // cannot determine their layout just from style! 420 // cannot determine their layout just from style!
416 // Perhaps we should create a "PlainRenderBlockFlow" 421 // Perhaps we should create a "PlainRenderBlockFlow"
417 // and move this optimization there? 422 // and move this optimization there?
418 if (!isRenderBlockFlow() 423 if (!isRenderBlockFlow()
419 // Flexbox items can be expanded beyond their width. 424 // Flexbox items can be expanded beyond their width.
420 || isFlexItemIncludingDeprecated() 425 || isFlexItemIncludingDeprecated()
421 // Table Layout controls cell size and can expand beyond width. 426 // Table Layout controls cell size and can expand beyond width.
422 || isTableCell()) 427 || isTableCell())
423 return false; 428 return false;
(...skipping 4359 matching lines...) Expand 10 before | Expand all | Expand 10 after
4783 return 0; 4788 return 0;
4784 4789
4785 if (!layoutState && !flowThreadContainingBlock()) 4790 if (!layoutState && !flowThreadContainingBlock())
4786 return 0; 4791 return 0;
4787 4792
4788 RenderBlock* containerBlock = containingBlock(); 4793 RenderBlock* containerBlock = containingBlock();
4789 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); 4794 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop();
4790 } 4795 }
4791 4796
4792 } // namespace WebCore 4797 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698