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

Unified Diff: Source/core/rendering/RenderLayerScrollableArea.cpp

Issue 239983004: Textarea resize-able only to larger; min-height and min-width properly set (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressing the changes asked in comments in patch set 1 Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/RenderLayerScrollableArea.cpp
diff --git a/Source/core/rendering/RenderLayerScrollableArea.cpp b/Source/core/rendering/RenderLayerScrollableArea.cpp
index 3e96139bd8e833d2ee5d60f9403dd430b7dd0ae4..8eab87e78be66c37c15eb4c55cf32443d15fecc7 100644
--- a/Source/core/rendering/RenderLayerScrollableArea.cpp
+++ b/Source/core/rendering/RenderLayerScrollableArea.cpp
@@ -716,6 +716,18 @@ void RenderLayerScrollableArea::updateAfterStyleChange(const RenderStyle* oldSty
EOverflow overflowX = m_box->style()->overflowX();
EOverflow overflowY = m_box->style()->overflowY();
+ Node* node = m_box->node();
+ if (node && node->isElementNode()) {
+ Element* element = toElement(node);
+ LayoutUnit minimumWidth = valueForLength(m_box->style()->logicalMinWidth(), m_box->logicalWidth());
+ LayoutUnit minimumHeight = valueForLength(m_box->style()->logicalMinHeight(), m_box->logicalHeight());
+ if (minimumWidth == 0)
+ minimumWidth = LayoutUnit(15);
+ if (minimumHeight == 0)
+ minimumHeight = LayoutUnit(15);
Julien - ping for review 2014/04/21 17:46:46 I don't think we should only check for 0. We shoul
harpreet.sk 2014/04/24 15:28:27 Now added a check doing a max between the internal
+ element->setMinimumSizeForResizing(LayoutSize(minimumWidth, minimumHeight));
Julien - ping for review 2014/04/21 17:46:46 The fact that we do a round-trip through the DOM i
harpreet.sk 2014/04/22 13:56:36 The classes deriving from ScrollableArea other tha
Julien - ping for review 2014/04/22 22:35:12 Your analysis is fine by me.
+ }
+
// To avoid doing a relayout in updateScrollbarsAfterLayout, we try to keep any automatic scrollbar that was already present.
bool needsHorizontalScrollbar = (hasHorizontalScrollbar() && overflowDefinesAutomaticScrollbar(overflowX)) || overflowRequiresScrollbar(overflowX);
bool needsVerticalScrollbar = (hasVerticalScrollbar() && overflowDefinesAutomaticScrollbar(overflowY)) || overflowRequiresScrollbar(overflowY);
@@ -1358,8 +1370,7 @@ void RenderLayerScrollableArea::resize(const PlatformEvent& evt, const LayoutSiz
newOffset.setHeight(newOffset.height() / zoomFactor);
LayoutSize currentSize = LayoutSize(m_box->width() / zoomFactor, m_box->height() / zoomFactor);
- LayoutSize minimumSize = element->minimumSizeForResizing().shrunkTo(currentSize);
Julien - ping for review 2014/04/21 17:46:46 Don't we need the shrunkTo call ias zoomFactor can
harpreet.sk 2014/04/24 15:28:27 We do not need shrunkTo() as over here m_box->widt
- element->setMinimumSizeForResizing(minimumSize);
+ LayoutSize minimumSize = element->minimumSizeForResizing();
LayoutSize adjustedOldOffset = LayoutSize(oldOffset.width() / zoomFactor, oldOffset.height() / zoomFactor);
if (m_box->style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) {

Powered by Google App Engine
This is Rietveld 408576698