Commit f5ad4efe authored by abarth@chromium.org's avatar abarth@chromium.org

Don't setStyle the RenderView every style recalc

Prior to this CL, we were setting the style of the RenderView on every style
recalc because we were comparing the RenderView's overflow style with the wrong
value. This CL corrects the bug.

This CL doesn't have much effect yet, but it will become important in a future
CL when we use style modification on RenderLayers to scope compositing updates.

Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=168254

Review URL: https://codereview.chromium.org/185263002

git-svn-id: svn://svn.chromium.org/blink/trunk@168412 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent aac45e74
...@@ -1662,28 +1662,32 @@ void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change) ...@@ -1662,28 +1662,32 @@ void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change)
documentElement()->setNeedsStyleRecalc(SubtreeStyleChange); documentElement()->setNeedsStyleRecalc(SubtreeStyleChange);
} }
EOverflow overflowX = OAUTO;
EOverflow overflowY = OAUTO;
float columnGap = 0;
if (overflowStyle) {
overflowX = overflowStyle->overflowX();
overflowY = overflowStyle->overflowY();
// Visible overflow on the viewport is meaningless, and the spec says to treat it as 'auto':
if (overflowX == OVISIBLE)
overflowX = OAUTO;
if (overflowY == OVISIBLE)
overflowY = OAUTO;
// Column-gap is (ab)used by the current paged overflow implementation (in lack of other
// ways to specify gaps between pages), so we have to propagate it too.
columnGap = overflowStyle->columnGap();
}
RefPtr<RenderStyle> documentStyle = renderView()->style(); RefPtr<RenderStyle> documentStyle = renderView()->style();
if (documentStyle->writingMode() != rootWritingMode if (documentStyle->writingMode() != rootWritingMode
|| documentStyle->direction() != rootDirection || documentStyle->direction() != rootDirection
|| (overflowStyle && (documentStyle->overflowX() != overflowStyle->overflowX() || documentStyle->overflowY() != overflowStyle->overflowY()))) { || documentStyle->overflowX() != overflowX
|| documentStyle->overflowY() != overflowY
|| documentStyle->columnGap() != columnGap) {
RefPtr<RenderStyle> newStyle = RenderStyle::clone(documentStyle.get()); RefPtr<RenderStyle> newStyle = RenderStyle::clone(documentStyle.get());
newStyle->setWritingMode(rootWritingMode); newStyle->setWritingMode(rootWritingMode);
newStyle->setDirection(rootDirection); newStyle->setDirection(rootDirection);
EOverflow overflowX = OAUTO; newStyle->setColumnGap(columnGap);
EOverflow overflowY = OAUTO;
if (overflowStyle) {
overflowX = overflowStyle->overflowX();
overflowY = overflowStyle->overflowY();
// Visible overflow on the viewport is meaningless, and the spec says to treat it as 'auto':
if (overflowX == OVISIBLE)
overflowX = OAUTO;
if (overflowY == OVISIBLE)
overflowY = OAUTO;
// Column-gap is (ab)used by the current paged overflow implementation (in lack of other
// ways to specify gaps between pages), so we have to propagate it too.
newStyle->setColumnGap(overflowStyle->columnGap());
}
newStyle->setOverflowX(overflowX); newStyle->setOverflowX(overflowX);
newStyle->setOverflowY(overflowY); newStyle->setOverflowY(overflowY);
renderView()->setStyle(newStyle); renderView()->setStyle(newStyle);
......
...@@ -3366,6 +3366,8 @@ bool WebViewImpl::isTransparent() const ...@@ -3366,6 +3366,8 @@ bool WebViewImpl::isTransparent() const
void WebViewImpl::setBaseBackgroundColor(WebColor color) void WebViewImpl::setBaseBackgroundColor(WebColor color)
{ {
layout();
if (m_baseBackgroundColor == color) if (m_baseBackgroundColor == color)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment