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 2628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2639 if (shapeLogicalBottom < floatLogicalBottom) | 2639 if (shapeLogicalBottom < floatLogicalBottom) |
2640 floatLogicalBottom = shapeLogicalBottom; | 2640 floatLogicalBottom = shapeLogicalBottom; |
2641 } | 2641 } |
2642 if (floatLogicalBottom > logicalHeight) | 2642 if (floatLogicalBottom > logicalHeight) |
2643 logicalBottom = logicalBottom ? std::min(floatLogicalBottom, logical
Bottom) : floatLogicalBottom; | 2643 logicalBottom = logicalBottom ? std::min(floatLogicalBottom, logical
Bottom) : floatLogicalBottom; |
2644 } | 2644 } |
2645 | 2645 |
2646 return logicalBottom; | 2646 return logicalBottom; |
2647 } | 2647 } |
2648 | 2648 |
2649 bool LayoutBlockFlow::hitTestFloats(const HitTestRequest& request, HitTestResult
& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumul
atedOffset) | 2649 bool LayoutBlockFlow::hitTestFloats(HitTestResult& result, const HitTestLocation
& locationInContainer, const LayoutPoint& accumulatedOffset) |
2650 { | 2650 { |
2651 if (!m_floatingObjects) | 2651 if (!m_floatingObjects) |
2652 return false; | 2652 return false; |
2653 | 2653 |
2654 LayoutPoint adjustedLocation = accumulatedOffset; | 2654 LayoutPoint adjustedLocation = accumulatedOffset; |
2655 if (isLayoutView()) { | 2655 if (isLayoutView()) { |
2656 DoublePoint position = toLayoutView(this)->frameView()->scrollPositionDo
uble(); | 2656 DoublePoint position = toLayoutView(this)->frameView()->scrollPositionDo
uble(); |
2657 adjustedLocation.move(position.x(), position.y()); | 2657 adjustedLocation.move(position.x(), position.y()); |
2658 } | 2658 } |
2659 | 2659 |
2660 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); | 2660 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); |
2661 FloatingObjectSetIterator begin = floatingObjectSet.begin(); | 2661 FloatingObjectSetIterator begin = floatingObjectSet.begin(); |
2662 for (FloatingObjectSetIterator it = floatingObjectSet.end(); it != begin;) { | 2662 for (FloatingObjectSetIterator it = floatingObjectSet.end(); it != begin;) { |
2663 --it; | 2663 --it; |
2664 FloatingObject* floatingObject = it->get(); | 2664 FloatingObject* floatingObject = it->get(); |
2665 if (floatingObject->shouldPaint() && !floatingObject->layoutObject()->ha
sSelfPaintingLayer()) { | 2665 if (floatingObject->shouldPaint() && !floatingObject->layoutObject()->ha
sSelfPaintingLayer()) { |
2666 LayoutUnit xOffset = xPositionForFloatIncludingMargin(floatingObject
) - floatingObject->layoutObject()->location().x(); | 2666 LayoutUnit xOffset = xPositionForFloatIncludingMargin(floatingObject
) - floatingObject->layoutObject()->location().x(); |
2667 LayoutUnit yOffset = yPositionForFloatIncludingMargin(floatingObject
) - floatingObject->layoutObject()->location().y(); | 2667 LayoutUnit yOffset = yPositionForFloatIncludingMargin(floatingObject
) - floatingObject->layoutObject()->location().y(); |
2668 LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObj
ect, adjustedLocation + LayoutSize(xOffset, yOffset)); | 2668 LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObj
ect, adjustedLocation + LayoutSize(xOffset, yOffset)); |
2669 if (floatingObject->layoutObject()->hitTest(request, result, locatio
nInContainer, childPoint)) { | 2669 if (floatingObject->layoutObject()->hitTest(result, locationInContai
ner, childPoint)) { |
2670 updateHitTestResult(result, locationInContainer.point() - toLayo
utSize(childPoint)); | 2670 updateHitTestResult(result, locationInContainer.point() - toLayo
utSize(childPoint)); |
2671 return true; | 2671 return true; |
2672 } | 2672 } |
2673 } | 2673 } |
2674 } | 2674 } |
2675 | 2675 |
2676 return false; | 2676 return false; |
2677 } | 2677 } |
2678 | 2678 |
2679 LayoutUnit LayoutBlockFlow::logicalLeftFloatOffsetForLine(LayoutUnit logicalTop,
LayoutUnit fixedOffset, LayoutUnit logicalHeight) const | 2679 LayoutUnit LayoutBlockFlow::logicalLeftFloatOffsetForLine(LayoutUnit logicalTop,
LayoutUnit fixedOffset, LayoutUnit logicalHeight) const |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3156 } | 3156 } |
3157 if (isAnonymous()) | 3157 if (isAnonymous()) |
3158 return "LayoutBlockFlow (anonymous)"; | 3158 return "LayoutBlockFlow (anonymous)"; |
3159 if (isRelPositioned()) | 3159 if (isRelPositioned()) |
3160 return "LayoutBlockFlow (relative positioned)"; | 3160 return "LayoutBlockFlow (relative positioned)"; |
3161 return "LayoutBlockFlow"; | 3161 return "LayoutBlockFlow"; |
3162 } | 3162 } |
3163 | 3163 |
3164 | 3164 |
3165 } // namespace blink | 3165 } // namespace blink |
OLD | NEW |