Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(613)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlock.cpp

Issue 1959623002: Move line-specific parts of addOutlineRects() into LayoutBlockFlow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutBlockFlow.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutBlock.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
index d6f52fd0b0c271ec706d1afb9f2cfae2aa32b1f1..9dc1e328895813bfd4f710bace5692aa108fe813 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
@@ -2280,46 +2280,16 @@ LayoutRect LayoutBlock::localCaretRect(InlineBox* inlineBox, int caretOffset, La
void LayoutBlock::addOutlineRects(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset, IncludeBlockVisualOverflowOrNot includeBlockOverflows) const
{
- // For blocks inside inlines, we go ahead and include margins so that we run right up to the
- // inline boxes above and below us (thus getting merged with them to form a single irregular
- // shape).
- const LayoutInline* inlineElementContinuation = this->inlineElementContinuation();
- if (inlineElementContinuation) {
- // FIXME: This check really isn't accurate.
- bool nextInlineHasLineBox = inlineElementContinuation->firstLineBox();
- // FIXME: This is wrong. The principal layoutObject may not be the continuation preceding this block.
- // FIXME: This is wrong for vertical writing-modes.
- // https://bugs.webkit.org/show_bug.cgi?id=46781
- bool prevInlineHasLineBox = toLayoutInline(inlineElementContinuation->node()->layoutObject())->firstLineBox();
- LayoutUnit topMargin = prevInlineHasLineBox ? collapsedMarginBefore() : LayoutUnit();
- LayoutUnit bottomMargin = nextInlineHasLineBox ? collapsedMarginAfter() : LayoutUnit();
- if (topMargin || bottomMargin) {
- LayoutRect rect(additionalOffset, size());
- rect.expandEdges(topMargin, LayoutUnit(), bottomMargin, LayoutUnit());
- rects.append(rect);
- }
- } else if (!isAnonymous()) { // For anonymous blocks, the children add outline rects.
+ if (!isAnonymous()) // For anonymous blocks, the children add outline rects.
rects.append(LayoutRect(additionalOffset, size()));
- }
if (includeBlockOverflows == IncludeBlockVisualOverflow && !hasOverflowClip() && !hasControlClip()) {
- for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
- LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top());
- LayoutUnit bottom = std::min<LayoutUnit>(curr->lineBottom(), curr->top() + curr->height());
- LayoutRect rect(additionalOffset.x() + curr->x(), additionalOffset.y() + top, curr->width(), bottom - top);
- if (!rect.isEmpty())
- rects.append(rect);
- }
-
addOutlineRectsForNormalChildren(rects, additionalOffset, includeBlockOverflows);
if (TrackedLayoutBoxListHashSet* positionedObjects = this->positionedObjects()) {
for (auto* box : *positionedObjects)
addOutlineRectsForDescendant(*box, rects, additionalOffset, includeBlockOverflows);
}
}
-
- if (inlineElementContinuation)
- inlineElementContinuation->addOutlineRects(rects, additionalOffset + (inlineElementContinuation->containingBlock()->location() - location()), includeBlockOverflows);
}
LayoutBox* LayoutBlock::createAnonymousBoxWithSameTypeAs(const LayoutObject* parent) const
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutBlockFlow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698