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

Unified Diff: third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp

Issue 2575423003: Fix geometry mapping issues for float under inline (Closed)
Patch Set: SVG floating Created 3 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
Index: third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
diff --git a/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp b/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
index 88cbeb248511d5dc061973604ccc6aa2f33f2ddf..0b0355cce3cca66fadfc780b7b52573510b3dbdf 100644
--- a/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
+++ b/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
@@ -98,11 +98,7 @@ PaintInvalidationState::PaintInvalidationState(
m_svgTransform(parentState.m_svgTransform),
m_pendingDelayedPaintInvalidations(
parentState.m_pendingDelayedPaintInvalidations),
- m_paintingLayer(
- currentObject.hasLayer() &&
- toLayoutBoxModelObject(currentObject).hasSelfPaintingLayer()
- ? *toLayoutBoxModelObject(currentObject).layer()
- : parentState.m_paintingLayer)
+ m_paintingLayer(parentState.childPaintingLayer(currentObject))
#if ENABLE(ASSERT)
,
m_didUpdateForChildren(false)
@@ -145,6 +141,12 @@ PaintInvalidationState::PaintInvalidationState(
// paintInvalidationContainer.
m_paintInvalidationContainerForStackedContents =
m_paintInvalidationContainer;
+ } else if (currentObject.isFloating() &&
+ !currentObject.parent()->isLayoutBlock()) {
+ // See LayoutObject::paintingLayer() for specialty of floating objects.
+ m_paintInvalidationContainer =
+ &currentObject.containerForPaintInvalidation();
+ m_cachedOffsetsEnabled = false;
} else if (currentObject.styleRef().isStacked() &&
// This is to exclude some objects (e.g. LayoutText) inheriting
// stacked style from parent but aren't actually stacked.
@@ -230,6 +232,16 @@ PaintInvalidationState::PaintInvalidationState(
updateForCurrentObject(parentState);
}
+PaintLayer& PaintInvalidationState::childPaintingLayer(
+ const LayoutObject& child) const {
+ if (child.hasLayer() && toLayoutBoxModelObject(child).hasSelfPaintingLayer())
+ return *toLayoutBoxModelObject(child).layer();
+ // See LayoutObject::paintingLayer() for specialty of floating objects.
+ if (child.isFloating() && !m_currentObject.isLayoutBlock())
+ return *child.paintingLayer();
+ return m_paintingLayer;
+}
+
void PaintInvalidationState::updateForCurrentObject(
const PaintInvalidationState& parentState) {
if (!m_cachedOffsetsEnabled)

Powered by Google App Engine
This is Rietveld 408576698