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

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

Issue 2654843004: Fix shouldPaint issue when a composited floating iframe becomes non-self-painting (Closed)
Patch Set: Rename setAncestorShouldPaintFloatingObject to updateAncestorShouldPaintFloatingObject 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 3980 matching lines...) Expand 10 before | Expand all | Expand 10 after
3991 if (isLayoutView()) { 3991 if (isLayoutView()) {
3992 ScrollOffset offset = toLayoutView(this)->frameView()->getScrollOffset(); 3992 ScrollOffset offset = toLayoutView(this)->frameView()->getScrollOffset();
3993 adjustedLocation.move(LayoutSize(offset)); 3993 adjustedLocation.move(LayoutSize(offset));
3994 } 3994 }
3995 3995
3996 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3996 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
3997 FloatingObjectSetIterator begin = floatingObjectSet.begin(); 3997 FloatingObjectSetIterator begin = floatingObjectSet.begin();
3998 for (FloatingObjectSetIterator it = floatingObjectSet.end(); it != begin;) { 3998 for (FloatingObjectSetIterator it = floatingObjectSet.end(); it != begin;) {
3999 --it; 3999 --it;
4000 const FloatingObject& floatingObject = *it->get(); 4000 const FloatingObject& floatingObject = *it->get();
4001 if (floatingObject.shouldPaint()) { 4001 if (floatingObject.shouldPaint() &&
4002 // TODO(wangxianzhu): Should this be a DCHECK?
4003 !floatingObject.layoutObject()->hasSelfPaintingLayer()) {
4002 LayoutUnit xOffset = xPositionForFloatIncludingMargin(floatingObject) - 4004 LayoutUnit xOffset = xPositionForFloatIncludingMargin(floatingObject) -
4003 floatingObject.layoutObject()->location().x(); 4005 floatingObject.layoutObject()->location().x();
4004 LayoutUnit yOffset = yPositionForFloatIncludingMargin(floatingObject) - 4006 LayoutUnit yOffset = yPositionForFloatIncludingMargin(floatingObject) -
4005 floatingObject.layoutObject()->location().y(); 4007 floatingObject.layoutObject()->location().y();
4006 LayoutPoint childPoint = flipFloatForWritingModeForChild( 4008 LayoutPoint childPoint = flipFloatForWritingModeForChild(
4007 floatingObject, adjustedLocation + LayoutSize(xOffset, yOffset)); 4009 floatingObject, adjustedLocation + LayoutSize(xOffset, yOffset));
4008 if (floatingObject.layoutObject()->hitTest(result, locationInContainer, 4010 if (floatingObject.layoutObject()->hitTest(result, locationInContainer,
4009 childPoint)) { 4011 childPoint)) {
4010 updateHitTestResult( 4012 updateHitTestResult(
4011 result, locationInContainer.point() - toLayoutSize(childPoint)); 4013 result, locationInContainer.point() - toLayoutSize(childPoint));
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
4044 LayoutUnit logicalTop, 4046 LayoutUnit logicalTop,
4045 LayoutUnit fixedOffset, 4047 LayoutUnit fixedOffset,
4046 LayoutUnit logicalHeight) const { 4048 LayoutUnit logicalHeight) const {
4047 if (m_floatingObjects && m_floatingObjects->hasRightObjects()) 4049 if (m_floatingObjects && m_floatingObjects->hasRightObjects())
4048 return m_floatingObjects->logicalRightOffset(fixedOffset, logicalTop, 4050 return m_floatingObjects->logicalRightOffset(fixedOffset, logicalTop,
4049 logicalHeight); 4051 logicalHeight);
4050 4052
4051 return fixedOffset; 4053 return fixedOffset;
4052 } 4054 }
4053 4055
4054 void LayoutBlockFlow::setAncestorShouldPaintFloatingObject( 4056 void LayoutBlockFlow::updateAncestorShouldPaintFloatingObject(
4055 const LayoutBox& floatBox) { 4057 const LayoutBox& floatBox) {
4056 ASSERT(floatBox.isFloating()); 4058 ASSERT(floatBox.isFloating());
4057 bool floatBoxIsSelfPaintingLayer = 4059 bool floatBoxIsSelfPaintingLayer =
4058 floatBox.hasLayer() && floatBox.layer()->isSelfPaintingLayer(); 4060 floatBox.hasLayer() && floatBox.layer()->isSelfPaintingLayer();
4059 for (LayoutObject* ancestor = floatBox.parent(); 4061 for (LayoutObject* ancestor = floatBox.parent();
4060 ancestor && ancestor->isLayoutBlockFlow(); 4062 ancestor && ancestor->isLayoutBlockFlow();
4061 ancestor = ancestor->parent()) { 4063 ancestor = ancestor->parent()) {
4062 LayoutBlockFlow* ancestorBlock = toLayoutBlockFlow(ancestor); 4064 LayoutBlockFlow* ancestorBlock = toLayoutBlockFlow(ancestor);
4063 FloatingObjects* ancestorFloatingObjects = 4065 FloatingObjects* ancestorFloatingObjects =
4064 ancestorBlock->m_floatingObjects.get(); 4066 ancestorBlock->m_floatingObjects.get();
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
4598 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); 4600 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState);
4599 } 4601 }
4600 4602
4601 void LayoutBlockFlow::invalidateDisplayItemClients( 4603 void LayoutBlockFlow::invalidateDisplayItemClients(
4602 PaintInvalidationReason invalidationReason) const { 4604 PaintInvalidationReason invalidationReason) const {
4603 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( 4605 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients(
4604 invalidationReason); 4606 invalidationReason);
4605 } 4607 }
4606 4608
4607 } // namespace blink 4609 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698