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

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

Issue 2261663002: Disallow cast/implicit conversion from LayoutUnit to int/unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 3 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 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 m_scrollingLayer->setOffsetFromLayoutObject(-toIntSize(overflowClipRect.loca tion())); 987 m_scrollingLayer->setOffsetFromLayoutObject(-toIntSize(overflowClipRect.loca tion()));
988 988
989 if (m_childClippingMaskLayer && !layoutObject()->style()->clipPath()) { 989 if (m_childClippingMaskLayer && !layoutObject()->style()->clipPath()) {
990 m_childClippingMaskLayer->setPosition(m_scrollingLayer->position()); 990 m_childClippingMaskLayer->setPosition(m_scrollingLayer->position());
991 m_childClippingMaskLayer->setSize(m_scrollingLayer->size()); 991 m_childClippingMaskLayer->setSize(m_scrollingLayer->size());
992 m_childClippingMaskLayer->setOffsetFromLayoutObject(toIntSize(overflowCl ipRect.location())); 992 m_childClippingMaskLayer->setOffsetFromLayoutObject(toIntSize(overflowCl ipRect.location()));
993 } 993 }
994 994
995 bool overflowClipRectOffsetChanged = oldScrollingLayerOffset != m_scrollingL ayer->offsetFromLayoutObject(); 995 bool overflowClipRectOffsetChanged = oldScrollingLayerOffset != m_scrollingL ayer->offsetFromLayoutObject();
996 996
997 IntSize scrollSize(layoutBox->scrollWidth(), layoutBox->scrollHeight()); 997 IntSize scrollSize(layoutBox->scrollWidth().toInt(), layoutBox->scrollHeight ().toInt());
998 if (scrollSize != m_scrollingContentsLayer->size() || overflowClipRectOffset Changed) 998 if (scrollSize != m_scrollingContentsLayer->size() || overflowClipRectOffset Changed)
999 m_scrollingContentsLayer->setNeedsDisplay(); 999 m_scrollingContentsLayer->setNeedsDisplay();
1000 1000
1001 DoubleSize scrollingContentsOffset(overflowClipRect.location().x() - adjuste dScrollOffset.width(), overflowClipRect.location().y() - adjustedScrollOffset.he ight()); 1001 DoubleSize scrollingContentsOffset(overflowClipRect.location().x() - adjuste dScrollOffset.width(), overflowClipRect.location().y() - adjustedScrollOffset.he ight());
1002 // The scroll offset change is compared using floating point so that fractio nal scroll offset 1002 // The scroll offset change is compared using floating point so that fractio nal scroll offset
1003 // change can be propagated to compositor. 1003 // change can be propagated to compositor.
1004 if (scrollingContentsOffset != m_scrollingContentsOffset || scrollSize != m_ scrollingContentsLayer->size()) { 1004 if (scrollingContentsOffset != m_scrollingContentsOffset || scrollSize != m_ scrollingContentsLayer->size()) {
1005 bool coordinatorHandlesOffset = compositor()->scrollingLayerDidChange(&m _owningLayer); 1005 bool coordinatorHandlesOffset = compositor()->scrollingLayerDidChange(&m _owningLayer);
1006 m_scrollingContentsLayer->setPosition(coordinatorHandlesOffset ? FloatPo int() : FloatPoint(-toFloatSize(adjustedScrollOffset))); 1006 m_scrollingContentsLayer->setPosition(coordinatorHandlesOffset ? FloatPo int() : FloatPoint(-toFloatSize(adjustedScrollOffset)));
1007 } 1007 }
(...skipping 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after
2693 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2693 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2694 name = "Scrolling Contents Layer"; 2694 name = "Scrolling Contents Layer";
2695 } else { 2695 } else {
2696 ASSERT_NOT_REACHED(); 2696 ASSERT_NOT_REACHED();
2697 } 2697 }
2698 2698
2699 return name; 2699 return name;
2700 } 2700 }
2701 2701
2702 } // namespace blink 2702 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698