Index: Source/core/rendering/RenderBox.cpp |
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp |
index aa0d945978ed0ae33bee836137863d5b8d8a6d6b..c99800338ddb2160dd8a5995d6adc0b1496117f7 100644 |
--- a/Source/core/rendering/RenderBox.cpp |
+++ b/Source/core/rendering/RenderBox.cpp |
@@ -333,17 +333,9 @@ void RenderBox::updateFromStyle() |
setFloating(!isOutOfFlowPositioned() && styleToUse->isFloating()); |
bool boxHasOverflowClip = false; |
- // We also handle <body> and <html>, whose overflow applies to the viewport. |
- if (!styleToUse->isOverflowVisible() && !isRootObject && isRenderBlock()) { |
- // Overflow on the body can propagate to the viewport under the following conditions. |
- // (1) The root element is <html>. |
- // (2) We are the primary <body> (can be checked by looking at document.body). |
- // (3) The root element has visible overflow. |
- if (isBody() && document().documentElement()->hasTagName(htmlTag) |
- && document().body() == node() |
- && document().documentElement()->renderer()->style()->isOverflowVisible()) { |
- boxHasOverflowClip = false; |
- } else { |
+ if (!styleToUse->isOverflowVisible() && isRenderBlock() && !isViewObject) { |
+ // If overflow has been propagated to the viewport, it has no effect here. |
+ if (node() != document().viewportDefiningElement()) { |
boxHasOverflowClip = true; |
if (!hasOverflowClip()) { |
// If we are getting an overflow clip, preemptively erase any overflowing content. |