| 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 2407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2418 | 2418 |
| 2419 void LayoutBlockFlow::computeSelfHitTestRects( | 2419 void LayoutBlockFlow::computeSelfHitTestRects( |
| 2420 Vector<LayoutRect>& rects, | 2420 Vector<LayoutRect>& rects, |
| 2421 const LayoutPoint& layerOffset) const { | 2421 const LayoutPoint& layerOffset) const { |
| 2422 LayoutBlock::computeSelfHitTestRects(rects, layerOffset); | 2422 LayoutBlock::computeSelfHitTestRects(rects, layerOffset); |
| 2423 | 2423 |
| 2424 if (!hasHorizontalLayoutOverflow() && !hasVerticalLayoutOverflow()) | 2424 if (!hasHorizontalLayoutOverflow() && !hasVerticalLayoutOverflow()) |
| 2425 return; | 2425 return; |
| 2426 | 2426 |
| 2427 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) { | 2427 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) { |
| 2428 LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top()); | 2428 LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->y()); |
| 2429 LayoutUnit bottom = | 2429 LayoutUnit bottom = |
| 2430 std::min<LayoutUnit>(curr->lineBottom(), curr->top() + curr->height()); | 2430 std::min<LayoutUnit>(curr->lineBottom(), curr->y() + curr->height()); |
| 2431 LayoutRect rect(layerOffset.x() + curr->x(), layerOffset.y() + top, | 2431 LayoutRect rect(layerOffset.x() + curr->x(), layerOffset.y() + top, |
| 2432 curr->width(), bottom - top); | 2432 curr->width(), bottom - top); |
| 2433 // It's common for this rect to be entirely contained in our box, so exclude | 2433 // It's common for this rect to be entirely contained in our box, so exclude |
| 2434 // that simple case. | 2434 // that simple case. |
| 2435 if (!rect.isEmpty() && (rects.isEmpty() || !rects[0].contains(rect))) | 2435 if (!rect.isEmpty() && (rects.isEmpty() || !rects[0].contains(rect))) |
| 2436 rects.append(rect); | 2436 rects.append(rect); |
| 2437 } | 2437 } |
| 2438 } | 2438 } |
| 2439 | 2439 |
| 2440 void LayoutBlockFlow::absoluteRects( | 2440 void LayoutBlockFlow::absoluteRects( |
| (...skipping 2064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4505 rects.append(rect); | 4505 rects.append(rect); |
| 4506 } | 4506 } |
| 4507 } | 4507 } |
| 4508 | 4508 |
| 4509 LayoutBlock::addOutlineRects(rects, additionalOffset, includeBlockOverflows); | 4509 LayoutBlock::addOutlineRects(rects, additionalOffset, includeBlockOverflows); |
| 4510 | 4510 |
| 4511 if (includeBlockOverflows == IncludeBlockVisualOverflow && | 4511 if (includeBlockOverflows == IncludeBlockVisualOverflow && |
| 4512 !hasOverflowClip() && !hasControlClip()) { | 4512 !hasOverflowClip() && !hasControlClip()) { |
| 4513 for (RootInlineBox* curr = firstRootBox(); curr; | 4513 for (RootInlineBox* curr = firstRootBox(); curr; |
| 4514 curr = curr->nextRootBox()) { | 4514 curr = curr->nextRootBox()) { |
| 4515 LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top()); | 4515 LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->y()); |
| 4516 LayoutUnit bottom = std::min<LayoutUnit>(curr->lineBottom(), | 4516 LayoutUnit bottom = |
| 4517 curr->top() + curr->height()); | 4517 std::min<LayoutUnit>(curr->lineBottom(), curr->y() + curr->height()); |
| 4518 LayoutRect rect(additionalOffset.x() + curr->x(), | 4518 LayoutRect rect(additionalOffset.x() + curr->x(), |
| 4519 additionalOffset.y() + top, curr->width(), bottom - top); | 4519 additionalOffset.y() + top, curr->width(), bottom - top); |
| 4520 if (!rect.isEmpty()) | 4520 if (!rect.isEmpty()) |
| 4521 rects.append(rect); | 4521 rects.append(rect); |
| 4522 } | 4522 } |
| 4523 } | 4523 } |
| 4524 | 4524 |
| 4525 if (inlineElementContinuation) | 4525 if (inlineElementContinuation) |
| 4526 inlineElementContinuation->addOutlineRects( | 4526 inlineElementContinuation->addOutlineRects( |
| 4527 rects, additionalOffset + | 4527 rects, additionalOffset + |
| (...skipping 10 matching lines...) Expand all Loading... |
| 4538 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); | 4538 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); |
| 4539 } | 4539 } |
| 4540 | 4540 |
| 4541 void LayoutBlockFlow::invalidateDisplayItemClients( | 4541 void LayoutBlockFlow::invalidateDisplayItemClients( |
| 4542 PaintInvalidationReason invalidationReason) const { | 4542 PaintInvalidationReason invalidationReason) const { |
| 4543 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( | 4543 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( |
| 4544 invalidationReason); | 4544 invalidationReason); |
| 4545 } | 4545 } |
| 4546 | 4546 |
| 4547 } // namespace blink | 4547 } // namespace blink |
| OLD | NEW |