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

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

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Blind fix for Mac. Created 5 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org) 3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
5 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 { 371 {
372 ASSERT(preferredLogicalWidthsDirty()); 372 ASSERT(preferredLogicalWidthsDirty());
373 373
374 // We cannot resolve any percent logical width here as the available logical 374 // We cannot resolve any percent logical width here as the available logical
375 // width may not be set on our containing block. 375 // width may not be set on our containing block.
376 if (style()->logicalWidth().isPercent()) 376 if (style()->logicalWidth().isPercent())
377 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferred LogicalWidth); 377 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferred LogicalWidth);
378 else 378 else
379 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeReplace dLogicalWidth(ComputePreferred); 379 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeReplace dLogicalWidth(ComputePreferred);
380 380
381 RenderStyle* styleToUse = style(); 381 const RenderStyle* styleToUse = style();
382 if (styleToUse->logicalWidth().isPercent() || styleToUse->logicalMaxWidth(). isPercent()) 382 if (styleToUse->logicalWidth().isPercent() || styleToUse->logicalMaxWidth(). isPercent())
383 m_minPreferredLogicalWidth = 0; 383 m_minPreferredLogicalWidth = 0;
384 384
385 if (styleToUse->logicalMinWidth().isFixed() && styleToUse->logicalMinWidth() .value() > 0) { 385 if (styleToUse->logicalMinWidth().isFixed() && styleToUse->logicalMinWidth() .value() > 0) {
386 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value())); 386 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value()));
387 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value())); 387 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value()));
388 } 388 }
389 389
390 if (styleToUse->logicalMaxWidth().isFixed()) { 390 if (styleToUse->logicalMaxWidth().isFixed()) {
391 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value())); 391 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value()));
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 return LayoutRect(); 502 return LayoutRect();
503 503
504 // The selectionRect can project outside of the overflowRect, so take their union 504 // The selectionRect can project outside of the overflowRect, so take their union
505 // for paint invalidation to avoid selection painting glitches. 505 // for paint invalidation to avoid selection painting glitches.
506 LayoutRect r = isSelected() ? localSelectionRect() : visualOverflowRect(); 506 LayoutRect r = isSelected() ? localSelectionRect() : visualOverflowRect();
507 mapRectToPaintInvalidationBacking(paintInvalidationContainer, r, paintInvali dationState); 507 mapRectToPaintInvalidationBacking(paintInvalidationContainer, r, paintInvali dationState);
508 return r; 508 return r;
509 } 509 }
510 510
511 } 511 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698