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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2241663002: Take CSS Clip and contain: paint into account when computing visual rects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: none Created 4 years, 4 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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 574
575 m_owningLayer.update3DTransformedDescendantStatus(); 575 m_owningLayer.update3DTransformedDescendantStatus();
576 if (style.preserves3D() && style.hasOpacity() && m_owningLayer.has3DTransfor medDescendant()) 576 if (style.preserves3D() && style.hasOpacity() && m_owningLayer.has3DTransfor medDescendant())
577 UseCounter::count(layoutObject->document(), UseCounter::OpacityWithPrese rve3DQuirk); 577 UseCounter::count(layoutObject->document(), UseCounter::OpacityWithPrese rve3DQuirk);
578 578
579 return layerConfigChanged; 579 return layerConfigChanged;
580 } 580 }
581 581
582 static IntRect clipBox(LayoutBox* layoutObject) 582 static IntRect clipBox(LayoutBox* layoutObject)
583 { 583 {
584 LayoutRect result = LayoutRect(LayoutRect::infiniteIntRect()); 584 // TODO(chrishtr): pixel snapping is most likely incorrect here.
585 if (layoutObject->hasOverflowClip() || layoutObject->style()->containsPaint( )) 585 return pixelSnappedIntRect(layoutObject->clippingRect());
586 result = layoutObject->overflowClipRect(LayoutPoint());
587
588 if (layoutObject->hasClip())
589 result.intersect(layoutObject->clipRect(LayoutPoint()));
590
591 return pixelSnappedIntRect(result);
592 } 586 }
593 587
594 static LayoutPoint computeOffsetFromCompositedAncestor(const PaintLayer* layer, const PaintLayer* compositedAncestor) 588 static LayoutPoint computeOffsetFromCompositedAncestor(const PaintLayer* layer, const PaintLayer* compositedAncestor)
595 { 589 {
596 LayoutPoint offset = layer->visualOffsetFromAncestor(compositedAncestor); 590 LayoutPoint offset = layer->visualOffsetFromAncestor(compositedAncestor);
597 if (compositedAncestor) 591 if (compositedAncestor)
598 offset.move(compositedAncestor->compositedLayerMapping()->owningLayer(). subpixelAccumulation()); 592 offset.move(compositedAncestor->compositedLayerMapping()->owningLayer(). subpixelAccumulation());
599 return offset; 593 return offset;
600 } 594 }
601 595
(...skipping 2107 matching lines...) Expand 10 before | Expand all | Expand 10 after
2709 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2703 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2710 name = "Scrolling Contents Layer"; 2704 name = "Scrolling Contents Layer";
2711 } else { 2705 } else {
2712 ASSERT_NOT_REACHED(); 2706 ASSERT_NOT_REACHED();
2713 } 2707 }
2714 2708
2715 return name; 2709 return name;
2716 } 2710 }
2717 2711
2718 } // namespace blink 2712 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698