Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 3263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3274 LayoutUnit logicalBottomForFloat = std::min(this->logicalBottomForFloat( floatingObject), LayoutUnit::max() - childLogicalTop); | 3274 LayoutUnit logicalBottomForFloat = std::min(this->logicalBottomForFloat( floatingObject), LayoutUnit::max() - childLogicalTop); |
| 3275 LayoutUnit logicalBottom = childLogicalTop + logicalBottomForFloat; | 3275 LayoutUnit logicalBottom = childLogicalTop + logicalBottomForFloat; |
| 3276 | 3276 |
| 3277 if (logicalBottom > logicalHeight()) { | 3277 if (logicalBottom > logicalHeight()) { |
| 3278 // If the object is not in the list, we add it now. | 3278 // If the object is not in the list, we add it now. |
| 3279 if (!containsFloat(floatingObject.layoutObject())) { | 3279 if (!containsFloat(floatingObject.layoutObject())) { |
| 3280 LayoutSize offset = isHorizontalWritingMode() ? LayoutSize(-chil dLogicalLeft, -childLogicalTop) : LayoutSize(-childLogicalTop, -childLogicalLeft ); | 3280 LayoutSize offset = isHorizontalWritingMode() ? LayoutSize(-chil dLogicalLeft, -childLogicalTop) : LayoutSize(-childLogicalTop, -childLogicalLeft ); |
| 3281 bool shouldPaint = false; | 3281 bool shouldPaint = false; |
| 3282 | 3282 |
| 3283 // The nearest enclosing layer always paints the float (so that zindex and stacking | 3283 // The nearest enclosing layer always paints the float (so that zindex and stacking |
| 3284 // behaves properly). We always want to propagate the desire to paint the float as | 3284 // behaves properly). We always want to propagate the desire to pain t the float as |
|
Xianzhu
2016/05/26 18:29:54
Nit: Unnecessary change
chrishtr
2016/05/26 18:49:29
Done.
| |
| 3285 // far out as we can, to the outermost block that overlaps the f loat, stopping only | 3285 // far out as we can, to the outermost block that overlaps the f loat, stopping only |
| 3286 // if we hit a self-painting layer boundary. | 3286 // if we hit a self-painting layer boundary. |
| 3287 if (floatingObject.layoutObject()->enclosingFloatPaintingLayer() == enclosingFloatPaintingLayer() && !floatingObject.isLowestNonOverhangingFloat InChild()) { | 3287 if (floatingObject.layoutObject()->enclosingFloatPaintingLayer() == enclosingFloatPaintingLayer() && !floatingObject.isLowestNonOverhangingFloat InChild()) { |
| 3288 floatingObject.setShouldPaint(false); | 3288 floatingObject.setShouldPaint(false); |
| 3289 shouldPaint = true; | 3289 shouldPaint = true; |
| 3290 } | 3290 } |
| 3291 // We create the floating object list lazily. | 3291 // We create the floating object list lazily. |
| 3292 if (!m_floatingObjects) | 3292 if (!m_floatingObjects) |
| 3293 createFloatingObjects(); | 3293 createFloatingObjects(); |
| 3294 | 3294 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3371 if (isLayoutView()) { | 3371 if (isLayoutView()) { |
| 3372 DoublePoint position = toLayoutView(this)->frameView()->scrollPositionDo uble(); | 3372 DoublePoint position = toLayoutView(this)->frameView()->scrollPositionDo uble(); |
| 3373 adjustedLocation.move(position.x(), position.y()); | 3373 adjustedLocation.move(position.x(), position.y()); |
| 3374 } | 3374 } |
| 3375 | 3375 |
| 3376 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); | 3376 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); |
| 3377 FloatingObjectSetIterator begin = floatingObjectSet.begin(); | 3377 FloatingObjectSetIterator begin = floatingObjectSet.begin(); |
| 3378 for (FloatingObjectSetIterator it = floatingObjectSet.end(); it != begin;) { | 3378 for (FloatingObjectSetIterator it = floatingObjectSet.end(); it != begin;) { |
| 3379 --it; | 3379 --it; |
| 3380 const FloatingObject& floatingObject = *it->get(); | 3380 const FloatingObject& floatingObject = *it->get(); |
| 3381 if (floatingObject.shouldPaint() && !floatingObject.layoutObject()->hasS elfPaintingLayer()) { | 3381 if (floatingObject.shouldPaint()) { |
| 3382 LayoutUnit xOffset = xPositionForFloatIncludingMargin(floatingObject ) - floatingObject.layoutObject()->location().x(); | 3382 LayoutUnit xOffset = xPositionForFloatIncludingMargin(floatingObject ) - floatingObject.layoutObject()->location().x(); |
| 3383 LayoutUnit yOffset = yPositionForFloatIncludingMargin(floatingObject ) - floatingObject.layoutObject()->location().y(); | 3383 LayoutUnit yOffset = yPositionForFloatIncludingMargin(floatingObject ) - floatingObject.layoutObject()->location().y(); |
| 3384 LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObj ect, adjustedLocation + LayoutSize(xOffset, yOffset)); | 3384 LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObj ect, adjustedLocation + LayoutSize(xOffset, yOffset)); |
| 3385 if (floatingObject.layoutObject()->hitTest(result, locationInContain er, childPoint)) { | 3385 if (floatingObject.layoutObject()->hitTest(result, locationInContain er, childPoint)) { |
| 3386 updateHitTestResult(result, locationInContainer.point() - toLayo utSize(childPoint)); | 3386 updateHitTestResult(result, locationInContainer.point() - toLayo utSize(childPoint)); |
| 3387 return true; | 3387 return true; |
| 3388 } | 3388 } |
| 3389 } | 3389 } |
| 3390 } | 3390 } |
| 3391 | 3391 |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3850 if (!rect.isEmpty()) | 3850 if (!rect.isEmpty()) |
| 3851 rects.append(rect); | 3851 rects.append(rect); |
| 3852 } | 3852 } |
| 3853 } | 3853 } |
| 3854 | 3854 |
| 3855 if (inlineElementContinuation) | 3855 if (inlineElementContinuation) |
| 3856 inlineElementContinuation->addOutlineRects(rects, additionalOffset + (in lineElementContinuation->containingBlock()->location() - location()), includeBlo ckOverflows); | 3856 inlineElementContinuation->addOutlineRects(rects, additionalOffset + (in lineElementContinuation->containingBlock()->location() - location()), includeBlo ckOverflows); |
| 3857 } | 3857 } |
| 3858 | 3858 |
| 3859 } // namespace blink | 3859 } // namespace blink |
| OLD | NEW |