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

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

Issue 2486423003: Dirty lineboxes when adding floats to a nested empty inline (Closed)
Patch Set: Created 4 years, 1 month 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 container.setAncestorLineBoxDirty(); 284 container.setAncestorLineBoxDirty();
285 } 285 }
286 return; 286 return;
287 } 287 }
288 288
289 // Try to figure out which line box we belong in. First try to find a previous 289 // Try to figure out which line box we belong in. First try to find a previous
290 // line box by examining our siblings. If we are a float inside an inline then 290 // line box by examining our siblings. If we are a float inside an inline then
291 // check the siblings of our inline parent. If we didn't find a line box, then 291 // check the siblings of our inline parent. If we didn't find a line box, then
292 // use our parent's first line box. 292 // use our parent's first line box.
293 RootInlineBox* box = nullptr; 293 RootInlineBox* box = nullptr;
294 LineLayoutItem curr = child.isFloating() && !child.previousSibling() && 294 LineLayoutItem curr = child.previousSibling();
295 child.parent() && 295 if (child.isFloating() && !curr) {
296 child.parent().isLayoutInline() 296 LineLayoutItem parent = child.parent();
297 ? child.parent().previousSibling() 297 while (parent && parent.isLayoutInline() && !parent.previousSibling())
298 : child.previousSibling(); 298 parent = parent.parent();
299 if (parent)
300 curr = parent.previousSibling();
301 }
302
299 for (; curr; curr = curr.previousSibling()) { 303 for (; curr; curr = curr.previousSibling()) {
300 if (curr.isFloatingOrOutOfFlowPositioned()) 304 if (curr.isFloatingOrOutOfFlowPositioned())
301 continue; 305 continue;
302 306
303 if (curr.isAtomicInlineLevel()) { 307 if (curr.isAtomicInlineLevel()) {
304 InlineBox* wrapper = LineLayoutBox(curr).inlineBoxWrapper(); 308 InlineBox* wrapper = LineLayoutBox(curr).inlineBoxWrapper();
305 if (wrapper) 309 if (wrapper)
306 box = &wrapper->root(); 310 box = &wrapper->root();
307 } else if (curr.isText()) { 311 } else if (curr.isText()) {
308 InlineTextBox* textBox = LineLayoutText(curr).lastTextBox(); 312 InlineTextBox* textBox = LineLayoutText(curr).lastTextBox();
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 ASSERT(child->prevLineBox() == prev); 373 ASSERT(child->prevLineBox() == prev);
370 prev = child; 374 prev = child;
371 } 375 }
372 ASSERT(prev == m_lastLineBox); 376 ASSERT(prev == m_lastLineBox);
373 #endif 377 #endif
374 } 378 }
375 379
376 #endif 380 #endif
377 381
378 } // namespace blink 382 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/block/float/float-should-dirty-line-when-adjacent-to-line-breaks-2-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698