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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp

Issue 2078343005: Fix positioning of CSS reference clips in composited layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add virtual expectation Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/PaintLayerPainter.h" 5 #include "core/paint/PaintLayerPainter.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/Settings.h" 8 #include "core/frame/Settings.h"
9 #include "core/layout/ClipPathOperation.h" 9 #include "core/layout/ClipPathOperation.h"
10 #include "core/layout/LayoutBlock.h" 10 #include "core/layout/LayoutBlock.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 Document& document = paintLayer.layoutObject()->document(); 153 Document& document = paintLayer.layoutObject()->document();
154 // FIXME: It doesn't work with forward or external SVG references (h ttps://bugs.webkit.org/show_bug.cgi?id=90405) 154 // FIXME: It doesn't work with forward or external SVG references (h ttps://bugs.webkit.org/show_bug.cgi?id=90405)
155 Element* element = document.getElementById(referenceClipPathOperatio n->fragment()); 155 Element* element = document.getElementById(referenceClipPathOperatio n->fragment());
156 if (isSVGClipPathElement(element) && element->layoutObject()) { 156 if (isSVGClipPathElement(element) && element->layoutObject()) {
157 if (!rootRelativeBoundsComputed) { 157 if (!rootRelativeBoundsComputed) {
158 rootRelativeBounds = paintLayer.physicalBoundingBoxIncluding ReflectionAndStackingChildren(offsetFromRoot); 158 rootRelativeBounds = paintLayer.physicalBoundingBoxIncluding ReflectionAndStackingChildren(offsetFromRoot);
159 rootRelativeBoundsComputed = true; 159 rootRelativeBoundsComputed = true;
160 } 160 }
161 161
162 m_resourceClipper = toLayoutSVGResourceClipper(toLayoutSVGResour ceContainer(element->layoutObject())); 162 m_resourceClipper = toLayoutSVGResourceClipper(toLayoutSVGResour ceContainer(element->layoutObject()));
163 // When SVG applies the clip and the coordinate system is "user space on use", we must explicitly pass in
164 // the layer offset to have the clip paint in the correct locati on. When the coordinate system is
165 // "object bounding box" the offset is already accounted for in the rootRelativeBounds.
166 FloatPoint layerPositionOffset = m_resourceClipper->clipPathUnit s() == SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE ?
167 FloatPoint(offsetFromRoot) : FloatPoint();
163 if (!SVGClipPainter(*m_resourceClipper).prepareEffect(*paintLaye r.layoutObject(), FloatRect(rootRelativeBounds), 168 if (!SVGClipPainter(*m_resourceClipper).prepareEffect(*paintLaye r.layoutObject(), FloatRect(rootRelativeBounds),
164 FloatRect(rootRelativeBounds), context, m_clipperState)) { 169 FloatRect(rootRelativeBounds), layerPositionOffset, context, m_clipperState)) {
165 // No need to post-apply the clipper if this failed. 170 // No need to post-apply the clipper if this failed.
166 m_resourceClipper = 0; 171 m_resourceClipper = 0;
167 } 172 }
168 } 173 }
169 } 174 }
170 } 175 }
171 176
172 ~ClipPathHelper() 177 ~ClipPathHelper()
173 { 178 {
174 if (m_resourceClipper) 179 if (m_resourceClipper)
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 if (!m_paintLayer.containsDirtyOverlayScrollbars()) 809 if (!m_paintLayer.containsDirtyOverlayScrollbars())
805 return; 810 return;
806 811
807 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize()); 812 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize());
808 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); 813 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars);
809 814
810 m_paintLayer.setContainsDirtyOverlayScrollbars(false); 815 m_paintLayer.setContainsDirtyOverlayScrollbars(false);
811 } 816 }
812 817
813 } // namespace blink 818 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698