|
Lines 32-37
a/Source/WebCore/rendering/RenderInline.cpp_sec1
|
| 32 |
#include "InlineTextBox.h" |
32 |
#include "InlineTextBox.h" |
| 33 |
#include "Page.h" |
33 |
#include "Page.h" |
| 34 |
#include "RenderBlock.h" |
34 |
#include "RenderBlock.h" |
|
|
35 |
#include "RenderChildIterator.h" |
| 35 |
#include "RenderFullScreen.h" |
36 |
#include "RenderFullScreen.h" |
| 36 |
#include "RenderGeometryMap.h" |
37 |
#include "RenderGeometryMap.h" |
| 37 |
#include "RenderIterator.h" |
38 |
#include "RenderIterator.h" |
|
Lines 670-683
void RenderInline::generateCulledLineBoxRects(GeneratorContext& context, const R
a/Source/WebCore/rendering/RenderInline.cpp_sec2
|
| 670 |
|
671 |
|
| 671 |
bool isHorizontal = style().isHorizontalWritingMode(); |
672 |
bool isHorizontal = style().isHorizontalWritingMode(); |
| 672 |
|
673 |
|
| 673 |
for (RenderObject* current = firstChild(); current; current = current->nextSibling()) { |
674 |
for (auto& current : childrenOfType<RenderObject>(*this)) { |
| 674 |
if (current->isFloatingOrOutOfFlowPositioned()) |
675 |
if (current.isFloatingOrOutOfFlowPositioned()) |
| 675 |
continue; |
676 |
continue; |
| 676 |
|
677 |
|
| 677 |
// We want to get the margin box in the inline direction, and then use our font ascent/descent in the block |
678 |
// We want to get the margin box in the inline direction, and then use our font ascent/descent in the block |
| 678 |
// direction (aligned to the root box's baseline). |
679 |
// direction (aligned to the root box's baseline). |
| 679 |
if (is<RenderBox>(*current)) { |
680 |
if (is<RenderBox>(current)) { |
| 680 |
RenderBox& renderBox = downcast<RenderBox>(*current); |
681 |
auto& renderBox = downcast<RenderBox>(current); |
| 681 |
if (renderBox.inlineBoxWrapper()) { |
682 |
if (renderBox.inlineBoxWrapper()) { |
| 682 |
const RootInlineBox& rootBox = renderBox.inlineBoxWrapper()->root(); |
683 |
const RootInlineBox& rootBox = renderBox.inlineBoxWrapper()->root(); |
| 683 |
const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style(); |
684 |
const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style(); |
|
Lines 688-696
void RenderInline::generateCulledLineBoxRects(GeneratorContext& context, const R
a/Source/WebCore/rendering/RenderInline.cpp_sec3
|
| 688 |
else |
689 |
else |
| 689 |
context.addRect(FloatRect(logicalTop, renderBox.inlineBoxWrapper()->y() - renderBox.marginTop(), logicalHeight, renderBox.height() + renderBox.verticalMarginExtent())); |
690 |
context.addRect(FloatRect(logicalTop, renderBox.inlineBoxWrapper()->y() - renderBox.marginTop(), logicalHeight, renderBox.height() + renderBox.verticalMarginExtent())); |
| 690 |
} |
691 |
} |
| 691 |
} else if (is<RenderInline>(*current)) { |
692 |
} else if (is<RenderInline>(current)) { |
| 692 |
// If the child doesn't need line boxes either, then we can recur. |
693 |
// If the child doesn't need line boxes either, then we can recur. |
| 693 |
RenderInline& renderInline = downcast<RenderInline>(*current); |
694 |
auto& renderInline = downcast<RenderInline>(current); |
| 694 |
if (!renderInline.alwaysCreateLineBoxes()) |
695 |
if (!renderInline.alwaysCreateLineBoxes()) |
| 695 |
renderInline.generateCulledLineBoxRects(context, container); |
696 |
renderInline.generateCulledLineBoxRects(context, container); |
| 696 |
else { |
697 |
else { |
|
Lines 712-719
void RenderInline::generateCulledLineBoxRects(GeneratorContext& context, const R
a/Source/WebCore/rendering/RenderInline.cpp_sec4
|
| 712 |
} |
713 |
} |
| 713 |
} |
714 |
} |
| 714 |
} |
715 |
} |
| 715 |
} else if (is<RenderText>(*current)) { |
716 |
} else if (is<RenderText>(current)) { |
| 716 |
RenderText& currText = downcast<RenderText>(*current); |
717 |
auto& currText = downcast<RenderText>(current); |
| 717 |
for (InlineTextBox* childText = currText.firstTextBox(); childText; childText = childText->nextTextBox()) { |
718 |
for (InlineTextBox* childText = currText.firstTextBox(); childText; childText = childText->nextTextBox()) { |
| 718 |
const RootInlineBox& rootBox = childText->root(); |
719 |
const RootInlineBox& rootBox = childText->root(); |
| 719 |
const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style(); |
720 |
const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style(); |
|
Lines 724-731
void RenderInline::generateCulledLineBoxRects(GeneratorContext& context, const R
a/Source/WebCore/rendering/RenderInline.cpp_sec5
|
| 724 |
else |
725 |
else |
| 725 |
context.addRect(FloatRect(logicalTop, childText->y(), logicalHeight, childText->logicalWidth())); |
726 |
context.addRect(FloatRect(logicalTop, childText->y(), logicalHeight, childText->logicalWidth())); |
| 726 |
} |
727 |
} |
| 727 |
} else if (is<RenderLineBreak>(*current)) { |
728 |
} else if (is<RenderLineBreak>(current)) { |
| 728 |
if (InlineBox* inlineBox = downcast<RenderLineBreak>(*current).inlineBoxWrapper()) { |
729 |
if (auto* inlineBox = downcast<RenderLineBreak>(current).inlineBoxWrapper()) { |
| 729 |
// FIXME: This could use a helper to share these with text path. |
730 |
// FIXME: This could use a helper to share these with text path. |
| 730 |
const RootInlineBox& rootBox = inlineBox->root(); |
731 |
const RootInlineBox& rootBox = inlineBox->root(); |
| 731 |
const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style(); |
732 |
const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style(); |
|
Lines 1033-1058
IntRect RenderInline::linesBoundingBox() const
a/Source/WebCore/rendering/RenderInline.cpp_sec6
|
| 1033 |
|
1034 |
|
| 1034 |
InlineBox* RenderInline::culledInlineFirstLineBox() const |
1035 |
InlineBox* RenderInline::culledInlineFirstLineBox() const |
| 1035 |
{ |
1036 |
{ |
| 1036 |
for (RenderObject* current = firstChild(); current; current = current->nextSibling()) { |
1037 |
for (auto& current : childrenOfType<RenderObject>(*this)) { |
| 1037 |
if (current->isFloatingOrOutOfFlowPositioned()) |
1038 |
if (current.isFloatingOrOutOfFlowPositioned()) |
| 1038 |
continue; |
1039 |
continue; |
| 1039 |
|
1040 |
|
| 1040 |
// We want to get the margin box in the inline direction, and then use our font ascent/descent in the block |
1041 |
// We want to get the margin box in the inline direction, and then use our font ascent/descent in the block |
| 1041 |
// direction (aligned to the root box's baseline). |
1042 |
// direction (aligned to the root box's baseline). |
| 1042 |
if (is<RenderBox>(*current)) { |
1043 |
if (is<RenderBox>(current)) { |
| 1043 |
const auto& renderBox = downcast<RenderBox>(*current); |
1044 |
auto& renderBox = downcast<RenderBox>(current); |
| 1044 |
if (renderBox.inlineBoxWrapper()) |
1045 |
if (renderBox.inlineBoxWrapper()) |
| 1045 |
return renderBox.inlineBoxWrapper(); |
1046 |
return renderBox.inlineBoxWrapper(); |
| 1046 |
} else if (is<RenderLineBreak>(*current)) { |
1047 |
} else if (is<RenderLineBreak>(current)) { |
| 1047 |
RenderLineBreak& renderBR = downcast<RenderLineBreak>(*current); |
1048 |
auto& renderBR = downcast<RenderLineBreak>(current); |
| 1048 |
if (renderBR.inlineBoxWrapper()) |
1049 |
if (renderBR.inlineBoxWrapper()) |
| 1049 |
return renderBR.inlineBoxWrapper(); |
1050 |
return renderBR.inlineBoxWrapper(); |
| 1050 |
} else if (is<RenderInline>(*current)) { |
1051 |
} else if (is<RenderInline>(current)) { |
| 1051 |
RenderInline& renderInline = downcast<RenderInline>(*current); |
1052 |
auto& renderInline = downcast<RenderInline>(current); |
| 1052 |
if (InlineBox* result = renderInline.firstLineBoxIncludingCulling()) |
1053 |
if (InlineBox* result = renderInline.firstLineBoxIncludingCulling()) |
| 1053 |
return result; |
1054 |
return result; |
| 1054 |
} else if (is<RenderText>(*current)) { |
1055 |
} else if (is<RenderText>(current)) { |
| 1055 |
RenderText& renderText = downcast<RenderText>(*current); |
1056 |
auto& renderText = downcast<RenderText>(current); |
| 1056 |
if (renderText.firstTextBox()) |
1057 |
if (renderText.firstTextBox()) |
| 1057 |
return renderText.firstTextBox(); |
1058 |
return renderText.firstTextBox(); |
| 1058 |
} |
1059 |
} |
|
Lines 1096-1108
LayoutRect RenderInline::culledInlineVisualOverflowBoundingBox() const
a/Source/WebCore/rendering/RenderInline.cpp_sec7
|
| 1096 |
generateCulledLineBoxRects(context, this); |
1097 |
generateCulledLineBoxRects(context, this); |
| 1097 |
LayoutRect result(enclosingLayoutRect(floatResult)); |
1098 |
LayoutRect result(enclosingLayoutRect(floatResult)); |
| 1098 |
bool isHorizontal = style().isHorizontalWritingMode(); |
1099 |
bool isHorizontal = style().isHorizontalWritingMode(); |
| 1099 |
for (RenderObject* current = firstChild(); current; current = current->nextSibling()) { |
1100 |
for (auto& current : childrenOfType<RenderObject>(*this)) { |
| 1100 |
if (current->isFloatingOrOutOfFlowPositioned()) |
1101 |
if (current.isFloatingOrOutOfFlowPositioned()) |
| 1101 |
continue; |
1102 |
continue; |
| 1102 |
|
1103 |
|
| 1103 |
// For overflow we just have to propagate by hand and recompute it all. |
1104 |
// For overflow we just have to propagate by hand and recompute it all. |
| 1104 |
if (is<RenderBox>(*current)) { |
1105 |
if (is<RenderBox>(current)) { |
| 1105 |
RenderBox& renderBox = downcast<RenderBox>(*current); |
1106 |
auto& renderBox = downcast<RenderBox>(current); |
| 1106 |
if (!renderBox.hasSelfPaintingLayer() && renderBox.inlineBoxWrapper()) { |
1107 |
if (!renderBox.hasSelfPaintingLayer() && renderBox.inlineBoxWrapper()) { |
| 1107 |
LayoutRect logicalRect = renderBox.logicalVisualOverflowRectForPropagation(&style()); |
1108 |
LayoutRect logicalRect = renderBox.logicalVisualOverflowRectForPropagation(&style()); |
| 1108 |
if (isHorizontal) { |
1109 |
if (isHorizontal) { |
|
Lines 1113-1129
LayoutRect RenderInline::culledInlineVisualOverflowBoundingBox() const
a/Source/WebCore/rendering/RenderInline.cpp_sec8
|
| 1113 |
result.uniteIfNonZero(logicalRect.transposedRect()); |
1114 |
result.uniteIfNonZero(logicalRect.transposedRect()); |
| 1114 |
} |
1115 |
} |
| 1115 |
} |
1116 |
} |
| 1116 |
} else if (is<RenderInline>(*current)) { |
1117 |
} else if (is<RenderInline>(current)) { |
| 1117 |
// If the child doesn't need line boxes either, then we can recur. |
1118 |
// If the child doesn't need line boxes either, then we can recur. |
| 1118 |
RenderInline& renderInline = downcast<RenderInline>(*current); |
1119 |
auto& renderInline = downcast<RenderInline>(current); |
| 1119 |
if (!renderInline.alwaysCreateLineBoxes()) |
1120 |
if (!renderInline.alwaysCreateLineBoxes()) |
| 1120 |
result.uniteIfNonZero(renderInline.culledInlineVisualOverflowBoundingBox()); |
1121 |
result.uniteIfNonZero(renderInline.culledInlineVisualOverflowBoundingBox()); |
| 1121 |
else if (!renderInline.hasSelfPaintingLayer()) |
1122 |
else if (!renderInline.hasSelfPaintingLayer()) |
| 1122 |
result.uniteIfNonZero(renderInline.linesVisualOverflowBoundingBox()); |
1123 |
result.uniteIfNonZero(renderInline.linesVisualOverflowBoundingBox()); |
| 1123 |
} else if (is<RenderText>(*current)) { |
1124 |
} else if (is<RenderText>(current)) { |
| 1124 |
// FIXME; Overflow from text boxes is lost. We will need to cache this information in |
1125 |
// FIXME; Overflow from text boxes is lost. We will need to cache this information in |
| 1125 |
// InlineTextBoxes. |
1126 |
// InlineTextBoxes. |
| 1126 |
RenderText& renderText = downcast<RenderText>(*current); |
1127 |
auto& renderText = downcast<RenderText>(current); |
| 1127 |
result.uniteIfNonZero(renderText.linesVisualOverflowBoundingBox()); |
1128 |
result.uniteIfNonZero(renderText.linesVisualOverflowBoundingBox()); |
| 1128 |
} |
1129 |
} |
| 1129 |
} |
1130 |
} |
|
Lines 1458-1481
void RenderInline::dirtyLineBoxes(bool fullLayout)
a/Source/WebCore/rendering/RenderInline.cpp_sec9
|
| 1458 |
|
1459 |
|
| 1459 |
if (!alwaysCreateLineBoxes()) { |
1460 |
if (!alwaysCreateLineBoxes()) { |
| 1460 |
// We have to grovel into our children in order to dirty the appropriate lines. |
1461 |
// We have to grovel into our children in order to dirty the appropriate lines. |
| 1461 |
for (RenderObject* current = firstChild(); current; current = current->nextSibling()) { |
1462 |
for (auto& current : childrenOfType<RenderObject>(*this)) { |
| 1462 |
if (current->isFloatingOrOutOfFlowPositioned()) |
1463 |
if (current.isFloatingOrOutOfFlowPositioned()) |
| 1463 |
continue; |
1464 |
continue; |
| 1464 |
if (is<RenderBox>(*current) && !current->needsLayout()) { |
1465 |
if (is<RenderBox>(current) && !current.needsLayout()) { |
| 1465 |
RenderBox& renderBox = downcast<RenderBox>(*current); |
1466 |
auto& renderBox = downcast<RenderBox>(current); |
| 1466 |
if (renderBox.inlineBoxWrapper()) |
1467 |
if (renderBox.inlineBoxWrapper()) |
| 1467 |
renderBox.inlineBoxWrapper()->root().markDirty(); |
1468 |
renderBox.inlineBoxWrapper()->root().markDirty(); |
| 1468 |
} else if (!current->selfNeedsLayout()) { |
1469 |
} else if (!current.selfNeedsLayout()) { |
| 1469 |
if (is<RenderInline>(*current)) { |
1470 |
if (is<RenderInline>(current)) { |
| 1470 |
RenderInline& renderInline = downcast<RenderInline>(*current); |
1471 |
auto& renderInline = downcast<RenderInline>(current); |
| 1471 |
for (InlineFlowBox* childLine = renderInline.firstLineBox(); childLine; childLine = childLine->nextLineBox()) |
1472 |
for (InlineFlowBox* childLine = renderInline.firstLineBox(); childLine; childLine = childLine->nextLineBox()) |
| 1472 |
childLine->root().markDirty(); |
1473 |
childLine->root().markDirty(); |
| 1473 |
} else if (is<RenderText>(*current)) { |
1474 |
} else if (is<RenderText>(current)) { |
| 1474 |
RenderText& renderText = downcast<RenderText>(*current); |
1475 |
auto& renderText = downcast<RenderText>(current); |
| 1475 |
for (InlineTextBox* childText = renderText.firstTextBox(); childText; childText = childText->nextTextBox()) |
1476 |
for (InlineTextBox* childText = renderText.firstTextBox(); childText; childText = childText->nextTextBox()) |
| 1476 |
childText->root().markDirty(); |
1477 |
childText->root().markDirty(); |
| 1477 |
} else if (is<RenderLineBreak>(*current)) { |
1478 |
} else if (is<RenderLineBreak>(current)) { |
| 1478 |
RenderLineBreak& renderBR = downcast<RenderLineBreak>(*current); |
1479 |
auto& renderBR = downcast<RenderLineBreak>(current); |
| 1479 |
if (renderBR.inlineBoxWrapper()) |
1480 |
if (renderBR.inlineBoxWrapper()) |
| 1480 |
renderBR.inlineBoxWrapper()->root().markDirty(); |
1481 |
renderBR.inlineBoxWrapper()->root().markDirty(); |
| 1481 |
} |
1482 |
} |