| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 return nullptr; | 130 return nullptr; |
| 131 } | 131 } |
| 132 if (object) { | 132 if (object) { |
| 133 // |object->parent()| can be null if the object is not yet attached | 133 // |object->parent()| can be null if the object is not yet attached |
| 134 // to |parent|. | 134 // to |parent|. |
| 135 if (LayoutObject* parent = object->parent()) { | 135 if (LayoutObject* parent = object->parent()) { |
| 136 LayoutBlock* containingBlock = object->containingBlock(); | 136 LayoutBlock* containingBlock = object->containingBlock(); |
| 137 ASSERT(containingBlock); | 137 ASSERT(containingBlock); |
| 138 // Since we are moving the |object| to a new parent |fullscreenLayou
tObject|, | 138 // Since we are moving the |object| to a new parent |fullscreenLayou
tObject|, |
| 139 // the line box tree underneath our |containingBlock| is not longer
valid. | 139 // the line box tree underneath our |containingBlock| is not longer
valid. |
| 140 containingBlock->deleteLineBoxTree(); | 140 if (containingBlock->isLayoutBlockFlow()) |
| 141 toLayoutBlockFlow(containingBlock)->deleteLineBoxTree(); |
| 141 | 142 |
| 142 parent->addChildWithWritingModeOfParent(fullscreenLayoutObject, obje
ct); | 143 parent->addChildWithWritingModeOfParent(fullscreenLayoutObject, obje
ct); |
| 143 object->remove(); | 144 object->remove(); |
| 144 | 145 |
| 145 // Always just do a full layout to ensure that line boxes get delete
d properly. | 146 // Always just do a full layout to ensure that line boxes get delete
d properly. |
| 146 // Because objects moved from |parent| to |fullscreenLayoutObject|,
we want to | 147 // Because objects moved from |parent| to |fullscreenLayoutObject|,
we want to |
| 147 // make new line boxes instead of leaving the old ones around. | 148 // make new line boxes instead of leaving the old ones around. |
| 148 parent->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(La
youtInvalidationReason::Fullscreen); | 149 parent->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(La
youtInvalidationReason::Fullscreen); |
| 149 containingBlock->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvali
dation(LayoutInvalidationReason::Fullscreen); | 150 containingBlock->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvali
dation(LayoutInvalidationReason::Fullscreen); |
| 150 } | 151 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 m_placeholder->setStyleWithWritingModeOfParent(style); | 194 m_placeholder->setStyleWithWritingModeOfParent(style); |
| 194 if (parent()) { | 195 if (parent()) { |
| 195 parent()->addChildWithWritingModeOfParent(m_placeholder, this); | 196 parent()->addChildWithWritingModeOfParent(m_placeholder, this); |
| 196 parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(
LayoutInvalidationReason::Fullscreen); | 197 parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(
LayoutInvalidationReason::Fullscreen); |
| 197 } | 198 } |
| 198 } else { | 199 } else { |
| 199 m_placeholder->setStyle(style); | 200 m_placeholder->setStyle(style); |
| 200 m_placeholder->setStyleWithWritingModeOfParent(style); | 201 m_placeholder->setStyleWithWritingModeOfParent(style); |
| 201 } | 202 } |
| 202 } | 203 } |
| OLD | NEW |