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 1918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1929 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox())
{ | 1929 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox())
{ |
1930 LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top()); | 1930 LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top()); |
1931 LayoutUnit bottom = std::min<LayoutUnit>(curr->lineBottom(), curr->top()
+ curr->height()); | 1931 LayoutUnit bottom = std::min<LayoutUnit>(curr->lineBottom(), curr->top()
+ curr->height()); |
1932 LayoutRect rect(layerOffset.x() + curr->x(), layerOffset.y() + top, curr
->width(), bottom - top); | 1932 LayoutRect rect(layerOffset.x() + curr->x(), layerOffset.y() + top, curr
->width(), bottom - top); |
1933 // It's common for this rect to be entirely contained in our box, so exc
lude that simple case. | 1933 // It's common for this rect to be entirely contained in our box, so exc
lude that simple case. |
1934 if (!rect.isEmpty() && (rects.isEmpty() || !rects[0].contains(rect))) | 1934 if (!rect.isEmpty() && (rects.isEmpty() || !rects[0].contains(rect))) |
1935 rects.append(rect); | 1935 rects.append(rect); |
1936 } | 1936 } |
1937 } | 1937 } |
1938 | 1938 |
| 1939 void LayoutBlockFlow::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& a
ccumulatedOffset) const |
| 1940 { |
| 1941 if (!isAnonymousBlockContinuation()) { |
| 1942 LayoutBlock::absoluteRects(rects, accumulatedOffset); |
| 1943 return; |
| 1944 } |
| 1945 // For blocks inside inlines, we go ahead and include margins so that we run
right up to the |
| 1946 // inline boxes above and below us (thus getting merged with them to form a
single irregular |
| 1947 // shape). |
| 1948 // FIXME: This is wrong for vertical writing-modes. |
| 1949 // https://bugs.webkit.org/show_bug.cgi?id=46781 |
| 1950 LayoutRect rect(accumulatedOffset, size()); |
| 1951 rect.expand(collapsedMarginBoxLogicalOutsets()); |
| 1952 rects.append(pixelSnappedIntRect(rect)); |
| 1953 continuation()->absoluteRects(rects, accumulatedOffset - toLayoutSize(locati
on() + inlineElementContinuation()->containingBlock()->location())); |
| 1954 } |
| 1955 |
| 1956 void LayoutBlockFlow::absoluteQuads(Vector<FloatQuad>& quads) const |
| 1957 { |
| 1958 if (!isAnonymousBlockContinuation()) { |
| 1959 LayoutBlock::absoluteQuads(quads); |
| 1960 return; |
| 1961 } |
| 1962 // For blocks inside inlines, we go ahead and include margins so that we run
right up to the |
| 1963 // inline boxes above and below us (thus getting merged with them to form a
single irregular |
| 1964 // shape). |
| 1965 // FIXME: This is wrong for vertical writing-modes. |
| 1966 // https://bugs.webkit.org/show_bug.cgi?id=46781 |
| 1967 LayoutRect localRect(LayoutPoint(), size()); |
| 1968 localRect.expand(collapsedMarginBoxLogicalOutsets()); |
| 1969 quads.append(localToAbsoluteQuad(FloatRect(localRect))); |
| 1970 continuation()->absoluteQuads(quads); |
| 1971 } |
| 1972 |
1939 RootInlineBox* LayoutBlockFlow::createAndAppendRootInlineBox() | 1973 RootInlineBox* LayoutBlockFlow::createAndAppendRootInlineBox() |
1940 { | 1974 { |
1941 RootInlineBox* rootBox = createRootInlineBox(); | 1975 RootInlineBox* rootBox = createRootInlineBox(); |
1942 m_lineBoxes.appendLineBox(rootBox); | 1976 m_lineBoxes.appendLineBox(rootBox); |
1943 | 1977 |
1944 return rootBox; | 1978 return rootBox; |
1945 } | 1979 } |
1946 | 1980 |
1947 void LayoutBlockFlow::deleteLineBoxTree() | 1981 void LayoutBlockFlow::deleteLineBoxTree() |
1948 { | 1982 { |
(...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3342 if (!rect.isEmpty()) | 3376 if (!rect.isEmpty()) |
3343 rects.append(rect); | 3377 rects.append(rect); |
3344 } | 3378 } |
3345 } | 3379 } |
3346 | 3380 |
3347 if (inlineElementContinuation) | 3381 if (inlineElementContinuation) |
3348 inlineElementContinuation->addOutlineRects(rects, additionalOffset + (in
lineElementContinuation->containingBlock()->location() - location()), includeBlo
ckOverflows); | 3382 inlineElementContinuation->addOutlineRects(rects, additionalOffset + (in
lineElementContinuation->containingBlock()->location() - location()), includeBlo
ckOverflows); |
3349 } | 3383 } |
3350 | 3384 |
3351 } // namespace blink | 3385 } // namespace blink |
OLD | NEW |