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/layout/compositing/CompositedLayerMapping.cpp

Issue 2730343003: Fix overflow:overlay scrollbar width for paint. (Closed)
Patch Set: rebase Created 3 years, 9 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 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 543
544 // We ignore overflow clip here; we want composited overflow content to 544 // We ignore overflow clip here; we want composited overflow content to
545 // behave as if it lives in an unclipped universe so it can prepaint, etc. 545 // behave as if it lives in an unclipped universe so it can prepaint, etc.
546 // This means that we need to check if we are actually clipped before 546 // This means that we need to check if we are actually clipped before
547 // setting up m_ancestorClippingLayer otherwise 547 // setting up m_ancestorClippingLayer otherwise
548 // updateAncestorClippingLayerGeometry will fail as the clip rect will be 548 // updateAncestorClippingLayerGeometry will fail as the clip rect will be
549 // infinite. 549 // infinite.
550 // FIXME: this should use cached clip rects, but this sometimes give 550 // FIXME: this should use cached clip rects, but this sometimes give
551 // inaccurate results (and trips the ASSERTS in PaintLayerClipper). 551 // inaccurate results (and trips the ASSERTS in PaintLayerClipper).
552 ClipRectsContext clipRectsContext(compositingAncestor, UncachedClipRects, 552 ClipRectsContext clipRectsContext(compositingAncestor, UncachedClipRects,
553 IgnoreOverlayScrollbarSize); 553 IgnorePlatformOverlayScrollbarSize);
554 clipRectsContext.setIgnoreOverflowClip(); 554 clipRectsContext.setIgnoreOverflowClip();
555 555
556 ClipRect clipRect; 556 ClipRect clipRect;
557 m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper) 557 m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper)
558 .calculateBackgroundClipRect(clipRectsContext, clipRect); 558 .calculateBackgroundClipRect(clipRectsContext, clipRect);
559 IntRect parentClipRect = pixelSnappedIntRect(clipRect.rect()); 559 IntRect parentClipRect = pixelSnappedIntRect(clipRect.rect());
560 owningLayerIsClipped = parentClipRect != LayoutRect::infiniteIntRect(); 560 owningLayerIsClipped = parentClipRect != LayoutRect::infiniteIntRect();
561 561
562 // TODO(schenney): CSS clips are not applied to composited children, and 562 // TODO(schenney): CSS clips are not applied to composited children, and
563 // should be via mask or by compositing the parent too. 563 // should be via mask or by compositing the parent too.
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 1155
1156 void CompositedLayerMapping::updateAncestorClippingLayerGeometry( 1156 void CompositedLayerMapping::updateAncestorClippingLayerGeometry(
1157 const PaintLayer* compositingContainer, 1157 const PaintLayer* compositingContainer,
1158 const IntPoint& snappedOffsetFromCompositedAncestor, 1158 const IntPoint& snappedOffsetFromCompositedAncestor,
1159 IntPoint& graphicsLayerParentLocation) { 1159 IntPoint& graphicsLayerParentLocation) {
1160 if (!compositingContainer || !m_ancestorClippingLayer) 1160 if (!compositingContainer || !m_ancestorClippingLayer)
1161 return; 1161 return;
1162 1162
1163 ClipRectsContext clipRectsContext(compositingContainer, 1163 ClipRectsContext clipRectsContext(compositingContainer,
1164 PaintingClipRectsIgnoringOverflowClip, 1164 PaintingClipRectsIgnoringOverflowClip,
1165 IgnoreOverlayScrollbarSize); 1165 IgnorePlatformOverlayScrollbarSize);
1166 1166
1167 ClipRect parentClipRect; 1167 ClipRect parentClipRect;
1168 m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper) 1168 m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper)
1169 .calculateBackgroundClipRect(clipRectsContext, parentClipRect); 1169 .calculateBackgroundClipRect(clipRectsContext, parentClipRect);
1170 1170
1171 IntRect snappedParentClipRect(pixelSnappedIntRect(parentClipRect.rect())); 1171 IntRect snappedParentClipRect(pixelSnappedIntRect(parentClipRect.rect()));
1172 1172
1173 DCHECK(snappedParentClipRect != LayoutRect::infiniteIntRect()); 1173 DCHECK(snappedParentClipRect != LayoutRect::infiniteIntRect());
1174 m_ancestorClippingLayer->setPosition(FloatPoint( 1174 m_ancestorClippingLayer->setPosition(FloatPoint(
1175 snappedParentClipRect.location() - graphicsLayerParentLocation)); 1175 snappedParentClipRect.location() - graphicsLayerParentLocation));
(...skipping 2322 matching lines...) Expand 10 before | Expand all | Expand 10 after
3498 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { 3498 } else if (graphicsLayer == m_decorationOutlineLayer.get()) {
3499 name = "Decoration Layer"; 3499 name = "Decoration Layer";
3500 } else { 3500 } else {
3501 ASSERT_NOT_REACHED(); 3501 ASSERT_NOT_REACHED();
3502 } 3502 }
3503 3503
3504 return name; 3504 return name;
3505 } 3505 }
3506 3506
3507 } // namespace blink 3507 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/api/LayoutBoxItem.h ('k') | third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698