| OLD | NEW |
| 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 4337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4348 ASSERT(childrenInline()); | 4348 ASSERT(childrenInline()); |
| 4349 ListHashSet<RootInlineBox*> lineBoxes; | 4349 ListHashSet<RootInlineBox*> lineBoxes; |
| 4350 for (InlineWalker walker(LineLayoutBlockFlow(this)); !walker.atEnd(); | 4350 for (InlineWalker walker(LineLayoutBlockFlow(this)); !walker.atEnd(); |
| 4351 walker.advance()) { | 4351 walker.advance()) { |
| 4352 LayoutObject* o = walker.current().layoutObject(); | 4352 LayoutObject* o = walker.current().layoutObject(); |
| 4353 if (!o->isOutOfFlowPositioned() && | 4353 if (!o->isOutOfFlowPositioned() && |
| 4354 (o->isAtomicInlineLevel() || o->isFloating())) { | 4354 (o->isAtomicInlineLevel() || o->isFloating())) { |
| 4355 o->layoutIfNeeded(); | 4355 o->layoutIfNeeded(); |
| 4356 if (toLayoutBox(o)->inlineBoxWrapper()) { | 4356 if (toLayoutBox(o)->inlineBoxWrapper()) { |
| 4357 RootInlineBox& box = toLayoutBox(o)->inlineBoxWrapper()->root(); | 4357 RootInlineBox& box = toLayoutBox(o)->inlineBoxWrapper()->root(); |
| 4358 lineBoxes.add(&box); | 4358 lineBoxes.insert(&box); |
| 4359 } | 4359 } |
| 4360 } else if (o->isText() || | 4360 } else if (o->isText() || |
| 4361 (o->isLayoutInline() && !walker.atEndOfInline())) { | 4361 (o->isLayoutInline() && !walker.atEndOfInline())) { |
| 4362 o->clearNeedsLayout(); | 4362 o->clearNeedsLayout(); |
| 4363 } | 4363 } |
| 4364 } | 4364 } |
| 4365 | 4365 |
| 4366 // FIXME: Glyph overflow will get lost in this case, but not really a big | 4366 // FIXME: Glyph overflow will get lost in this case, but not really a big |
| 4367 // deal. | 4367 // deal. |
| 4368 GlyphOverflowAndFallbackFontsMap textBoxDataMap; | 4368 GlyphOverflowAndFallbackFontsMap textBoxDataMap; |
| 4369 for (ListHashSet<RootInlineBox*>::const_iterator it = lineBoxes.begin(); | 4369 for (ListHashSet<RootInlineBox*>::const_iterator it = lineBoxes.begin(); |
| 4370 it != lineBoxes.end(); ++it) { | 4370 it != lineBoxes.end(); ++it) { |
| 4371 RootInlineBox* box = *it; | 4371 RootInlineBox* box = *it; |
| 4372 box->computeOverflow(box->lineTop(), box->lineBottom(), textBoxDataMap); | 4372 box->computeOverflow(box->lineTop(), box->lineBottom(), textBoxDataMap); |
| 4373 } | 4373 } |
| 4374 } | 4374 } |
| 4375 | 4375 |
| 4376 bool LayoutBlockFlow::recalcInlineChildrenOverflowAfterStyleChange() { | 4376 bool LayoutBlockFlow::recalcInlineChildrenOverflowAfterStyleChange() { |
| 4377 ASSERT(childrenInline()); | 4377 ASSERT(childrenInline()); |
| 4378 bool childrenOverflowChanged = false; | 4378 bool childrenOverflowChanged = false; |
| 4379 ListHashSet<RootInlineBox*> lineBoxes; | 4379 ListHashSet<RootInlineBox*> lineBoxes; |
| 4380 for (InlineWalker walker(LineLayoutBlockFlow(this)); !walker.atEnd(); | 4380 for (InlineWalker walker(LineLayoutBlockFlow(this)); !walker.atEnd(); |
| 4381 walker.advance()) { | 4381 walker.advance()) { |
| 4382 LayoutObject* layoutObject = walker.current().layoutObject(); | 4382 LayoutObject* layoutObject = walker.current().layoutObject(); |
| 4383 if (recalcNormalFlowChildOverflowIfNeeded(layoutObject)) { | 4383 if (recalcNormalFlowChildOverflowIfNeeded(layoutObject)) { |
| 4384 childrenOverflowChanged = true; | 4384 childrenOverflowChanged = true; |
| 4385 if (InlineBox* inlineBoxWrapper = | 4385 if (InlineBox* inlineBoxWrapper = |
| 4386 toLayoutBlock(layoutObject)->inlineBoxWrapper()) | 4386 toLayoutBlock(layoutObject)->inlineBoxWrapper()) |
| 4387 lineBoxes.add(&inlineBoxWrapper->root()); | 4387 lineBoxes.insert(&inlineBoxWrapper->root()); |
| 4388 } | 4388 } |
| 4389 } | 4389 } |
| 4390 | 4390 |
| 4391 // FIXME: Glyph overflow will get lost in this case, but not really a big | 4391 // FIXME: Glyph overflow will get lost in this case, but not really a big |
| 4392 // deal. | 4392 // deal. |
| 4393 GlyphOverflowAndFallbackFontsMap textBoxDataMap; | 4393 GlyphOverflowAndFallbackFontsMap textBoxDataMap; |
| 4394 for (ListHashSet<RootInlineBox*>::const_iterator it = lineBoxes.begin(); | 4394 for (ListHashSet<RootInlineBox*>::const_iterator it = lineBoxes.begin(); |
| 4395 it != lineBoxes.end(); ++it) { | 4395 it != lineBoxes.end(); ++it) { |
| 4396 RootInlineBox* box = *it; | 4396 RootInlineBox* box = *it; |
| 4397 box->clearKnownToHaveNoOverflow(); | 4397 box->clearKnownToHaveNoOverflow(); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4605 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); | 4605 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); |
| 4606 } | 4606 } |
| 4607 | 4607 |
| 4608 void LayoutBlockFlow::invalidateDisplayItemClients( | 4608 void LayoutBlockFlow::invalidateDisplayItemClients( |
| 4609 PaintInvalidationReason invalidationReason) const { | 4609 PaintInvalidationReason invalidationReason) const { |
| 4610 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( | 4610 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( |
| 4611 invalidationReason); | 4611 invalidationReason); |
| 4612 } | 4612 } |
| 4613 | 4613 |
| 4614 } // namespace blink | 4614 } // namespace blink |
| OLD | NEW |