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

Side by Side Diff: third_party/WebKit/Source/core/layout/line/LineBoxList.cpp

Issue 1550513003: Skip dirtying lines when attaching children prior to attaching oneself (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Skip dirtying lines when attaching children prior to attaching oneself Created 4 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 return false; 228 return false;
229 } 229 }
230 230
231 void LineBoxList::dirtyLinesFromChangedChild(LineLayoutItem container, LineLayou tItem child) 231 void LineBoxList::dirtyLinesFromChangedChild(LineLayoutItem container, LineLayou tItem child)
232 { 232 {
233 if (!container.parent() || (container.isLayoutBlock() && (container.selfNeed sLayout() || !container.isLayoutBlockFlow()))) 233 if (!container.parent() || (container.isLayoutBlock() && (container.selfNeed sLayout() || !container.isLayoutBlockFlow())))
234 return; 234 return;
235 235
236 LineLayoutInline inlineContainer = container.isLayoutInline() ? LineLayoutIn line(container) : LineLayoutInline(); 236 LineLayoutInline inlineContainer = container.isLayoutInline() ? LineLayoutIn line(container) : LineLayoutInline();
237
238 // If we are attaching children dirtying lines is unnecessary as we will do a full layout
239 // of the inline's contents anyway.
240 if (inlineContainer && inlineContainer.node() && inlineContainer.node()->nee dsAttach())
241 return;
242
237 InlineBox* firstBox = inlineContainer ? inlineContainer.firstLineBoxIncludin gCulling() : firstLineBox(); 243 InlineBox* firstBox = inlineContainer ? inlineContainer.firstLineBoxIncludin gCulling() : firstLineBox();
238 244
239 // If we have no first line box, then just bail early. 245 // If we have no first line box, then just bail early.
240 if (!firstBox) { 246 if (!firstBox) {
241 // For an empty inline, go ahead and propagate the check up to our paren t, unless the parent 247 // For an empty inline, go ahead and propagate the check up to our paren t, unless the parent
242 // is already dirty. 248 // is already dirty.
243 if (container.isInline() && !container.ancestorLineBoxDirty()) { 249 if (container.isInline() && !container.ancestorLineBoxDirty()) {
244 container.parent().dirtyLinesFromChangedChild(container); 250 container.parent().dirtyLinesFromChangedChild(container);
245 container.setAncestorLineBoxDirty(); // Mark the container to avoid dirtying the same lines again across multiple destroy() calls of the same subtre e. 251 container.setAncestorLineBoxDirty(); // Mark the container to avoid dirtying the same lines again across multiple destroy() calls of the same subtre e.
246 } 252 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 ASSERT(child->prevLineBox() == prev); 324 ASSERT(child->prevLineBox() == prev);
319 prev = child; 325 prev = child;
320 } 326 }
321 ASSERT(prev == m_lastLineBox); 327 ASSERT(prev == m_lastLineBox);
322 #endif 328 #endif
323 } 329 }
324 330
325 #endif 331 #endif
326 332
327 } // namespace blink 333 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698