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

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

Issue 839103002: Consider transformed container's scroll offset when calculating fixed descendant's offset (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ASSERT and comments about the scrollable container of the fixed-position Created 5 years, 11 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
« no previous file with comments | « LayoutTests/fast/repaint/fixed-descendant-of-transformed-scrolled-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayer.cpp
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index 350a96c44547cbcc058aa4e77a3511d97f2b72cb..7e1cd71facf5ec6a78405feea570ed77542d90e5 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -1381,7 +1381,17 @@ static inline const RenderLayer* accumulateOffsetTowardsAncestor(const RenderLay
location += (fixedContainerCoords - ancestorCoords);
} else {
+ // RenderView has been handled in the first top-level 'if' block above.
+ ASSERT(ancestorLayer != renderer->view()->layer());
+ ASSERT(ancestorLayer->hasTransformRelatedProperty());
+
location += layer->location();
+
+ // The spec (http://dev.w3.org/csswg/css-transforms/#transform-rendering) doesn't say if a
+ // fixed-position element under a scrollable transformed element should scroll. However,
+ // other parts of blink scroll the fixed-position element, and the following keeps the consistency.
+ if (RenderLayerScrollableArea* scrollableArea = ancestorLayer->scrollableArea())
+ location -= LayoutSize(scrollableArea->scrollOffset());
}
return ancestorLayer;
}
« no previous file with comments | « LayoutTests/fast/repaint/fixed-descendant-of-transformed-scrolled-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698