[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
hyatt at apple.com
hyatt at apple.com
Wed Dec 22 17:48:44 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 117fade71c9718c3dd509e6a5a46dc0db0dfa7c0
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Nov 30 19:48:39 2010 +0000
https://bugs.webkit.org/show_bug.cgi?id=50183
Reviewed by Simon Fraser.
Code got commented out by accident during render tree refactoring last year. Put the code back in, since
it hurts performance to have that line commented out.
In order to put this code back in, I had to fix some bugs with preferred width computations and
overflow: scroll. Make the pref widths computation create the scrollbar if it doesn't exist yet.
Make sure the scrollbar size is included prior to checking for defined width/min-width/max-width values. Otherwise
the scrollbar inflates the width beyond the fixed size that was specified.
For table cells, there is an additional wrinkle. Make sure not to include the scrollbar size as part of the minimum
intrinsic width so that we don't incorrectly grow.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::layoutPositionedObjects):
(WebCore::RenderBlock::computePreferredLogicalWidths):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computePreferredLogicalWidths):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72947 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 12693bb..c69ae24 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,27 @@
+2010-11-30 David Hyatt <hyatt at apple.com>
+
+ Reviewed by Simon Fraser.
+
+ https://bugs.webkit.org/show_bug.cgi?id=50183
+
+ Code got commented out by accident during render tree refactoring last year. Put the code back in, since
+ it hurts performance to have that line commented out.
+
+ In order to put this code back in, I had to fix some bugs with preferred width computations and
+ overflow: scroll. Make the pref widths computation create the scrollbar if it doesn't exist yet.
+
+ Make sure the scrollbar size is included prior to checking for defined width/min-width/max-width values. Otherwise
+ the scrollbar inflates the width beyond the fixed size that was specified.
+
+ For table cells, there is an additional wrinkle. Make sure not to include the scrollbar size as part of the minimum
+ intrinsic width so that we don't incorrectly grow.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::layoutPositionedObjects):
+ (WebCore::RenderBlock::computePreferredLogicalWidths):
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::computePreferredLogicalWidths):
+
2010-11-30 Vitaly Repeshko <vitalyr at chromium.org>
Unreviewed.
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index 37df281..e00277c 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -2027,7 +2027,7 @@ void RenderBlock::layoutPositionedObjects(bool relayoutChildren)
r->setChildNeedsLayout(true, false);
// If relayoutChildren is set and we have percentage padding, we also need to invalidate the child's pref widths.
- //if (relayoutChildren && (r->style()->paddingLeft().isPercent() || r->style()->paddingRight().isPercent()))
+ if (relayoutChildren && (r->style()->paddingStart().isPercent() || r->style()->paddingEnd().isPercent()))
r->setPreferredLogicalWidthsDirty(true, false);
if (!r->needsLayout())
@@ -4732,11 +4732,22 @@ void RenderBlock::computePreferredLogicalWidths()
m_minPreferredLogicalWidth = 0;
}
+ int scrollbarWidth = 0;
+ if (hasOverflowClip() && style()->overflowY() == OSCROLL) {
+ layer()->setHasVerticalScrollbar(true);
+ scrollbarWidth = verticalScrollbarWidth();
+ m_maxPreferredLogicalWidth += scrollbarWidth;
+ }
+
if (isTableCell()) {
Length w = toRenderTableCell(this)->styleOrColLogicalWidth();
- if (w.isFixed() && w.value() > 0)
+ if (w.isFixed() && w.value() > 0) {
m_maxPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(w.value()));
+ scrollbarWidth = 0;
+ }
}
+
+ m_minPreferredLogicalWidth += scrollbarWidth;
}
if (style()->logicalMinWidth().isFixed() && style()->logicalMinWidth().value() > 0) {
@@ -4749,14 +4760,9 @@ void RenderBlock::computePreferredLogicalWidths()
m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->logicalMaxWidth().value()));
}
- int toAdd = 0;
- toAdd = borderAndPaddingLogicalWidth();
-
- if (hasOverflowClip() && style()->overflowY() == OSCROLL)
- toAdd += verticalScrollbarWidth();
-
- m_minPreferredLogicalWidth += toAdd;
- m_maxPreferredLogicalWidth += toAdd;
+ int borderAndPadding = borderAndPaddingLogicalWidth();
+ m_minPreferredLogicalWidth += borderAndPadding;
+ m_maxPreferredLogicalWidth += borderAndPadding;
setPreferredLogicalWidthsDirty(false);
}
diff --git a/WebCore/rendering/RenderFlexibleBox.cpp b/WebCore/rendering/RenderFlexibleBox.cpp
index 6482eb0..7612961 100644
--- a/WebCore/rendering/RenderFlexibleBox.cpp
+++ b/WebCore/rendering/RenderFlexibleBox.cpp
@@ -180,6 +180,13 @@ void RenderFlexibleBox::computePreferredLogicalWidths()
m_maxPreferredLogicalWidth = max(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
}
+ if (hasOverflowClip() && style()->overflowY() == OSCROLL) {
+ layer()->setHasVerticalScrollbar(true);
+ int scrollbarWidth = verticalScrollbarWidth();
+ m_maxPreferredLogicalWidth += scrollbarWidth;
+ m_minPreferredLogicalWidth += scrollbarWidth;
+ }
+
if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
@@ -190,13 +197,9 @@ void RenderFlexibleBox::computePreferredLogicalWidths()
m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
}
- int toAdd = borderAndPaddingWidth();
-
- if (hasOverflowClip() && style()->overflowY() == OSCROLL)
- toAdd += verticalScrollbarWidth();
-
- m_minPreferredLogicalWidth += toAdd;
- m_maxPreferredLogicalWidth += toAdd;
+ int borderAndPadding = borderAndPaddingLogicalWidth();
+ m_minPreferredLogicalWidth += borderAndPadding;
+ m_maxPreferredLogicalWidth += borderAndPadding;
setPreferredLogicalWidthsDirty(false);
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list