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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlow.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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3173 matching lines...) Expand 10 before | Expand all | Expand 10 after
3184 3184
3185 void LayoutBlockFlow::showLineTreeAndMark(const InlineBox* markedBox1, const cha r* markedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const La youtObject* obj) const 3185 void LayoutBlockFlow::showLineTreeAndMark(const InlineBox* markedBox1, const cha r* markedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const La youtObject* obj) const
3186 { 3186 {
3187 showLayoutObject(); 3187 showLayoutObject();
3188 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 3188 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
3189 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 3189 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
3190 } 3190 }
3191 3191
3192 #endif 3192 #endif
3193 3193
3194 void LayoutBlockFlow::addOutlineRects(Vector<LayoutRect>& rects, const LayoutPoi nt& additionalOffset, IncludeBlockVisualOverflowOrNot includeBlockOverflows) con st
3195 {
3196 // For blocks inside inlines, we go ahead and include margins so that we run right up to the
3197 // inline boxes above and below us (thus getting merged with them to form a single irregular
3198 // shape).
3199 const LayoutInline* inlineElementContinuation = this->inlineElementContinuat ion();
3200 if (inlineElementContinuation) {
3201 // FIXME: This check really isn't accurate.
3202 bool nextInlineHasLineBox = inlineElementContinuation->firstLineBox();
3203 // FIXME: This is wrong. The principal layoutObject may not be the conti nuation preceding this block.
3204 // FIXME: This is wrong for vertical writing-modes.
3205 // https://bugs.webkit.org/show_bug.cgi?id=46781
3206 bool prevInlineHasLineBox = toLayoutInline(inlineElementContinuation->no de()->layoutObject())->firstLineBox();
3207 LayoutUnit topMargin = prevInlineHasLineBox ? collapsedMarginBefore() : LayoutUnit();
3208 LayoutUnit bottomMargin = nextInlineHasLineBox ? collapsedMarginAfter() : LayoutUnit();
3209 if (topMargin || bottomMargin) {
3210 LayoutRect rect(additionalOffset, size());
3211 rect.expandEdges(topMargin, LayoutUnit(), bottomMargin, LayoutUnit() );
3212 rects.append(rect);
3213 }
3214 }
3215
3216 LayoutBlock::addOutlineRects(rects, additionalOffset, includeBlockOverflows) ;
3217
3218 if (includeBlockOverflows == IncludeBlockVisualOverflow && !hasOverflowClip( ) && !hasControlClip()) {
3219 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBo x()) {
3220 LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top());
3221 LayoutUnit bottom = std::min<LayoutUnit>(curr->lineBottom(), curr->t op() + curr->height());
3222 LayoutRect rect(additionalOffset.x() + curr->x(), additionalOffset.y () + top, curr->width(), bottom - top);
3223 if (!rect.isEmpty())
3224 rects.append(rect);
3225 }
3226 }
3227
3228 if (inlineElementContinuation)
3229 inlineElementContinuation->addOutlineRects(rects, additionalOffset + (in lineElementContinuation->containingBlock()->location() - location()), includeBlo ckOverflows);
3230 }
3231
3194 } // namespace blink 3232 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698