| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 void setStyle(PassRefPtr<ComputedStyle>) = delete; | 47 void setStyle(PassRefPtr<ComputedStyle>) = delete; |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 bool isOfType(LayoutObjectType type) const override { return type == LayoutO
bjectLayoutFullScreenPlaceholder || LayoutBlockFlow::isOfType(type); } | 50 bool isOfType(LayoutObjectType type) const override { return type == LayoutO
bjectLayoutFullScreenPlaceholder || LayoutBlockFlow::isOfType(type); } |
| 51 void willBeDestroyed() override; | 51 void willBeDestroyed() override; |
| 52 LayoutFullScreen* m_owner; | 52 LayoutFullScreen* m_owner; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 void LayoutFullScreenPlaceholder::willBeDestroyed() | 55 void LayoutFullScreenPlaceholder::willBeDestroyed() |
| 56 { | 56 { |
| 57 m_owner->setPlaceholder(nullptr); | 57 m_owner->resetPlaceholder(); |
| 58 LayoutBlockFlow::willBeDestroyed(); | 58 LayoutBlockFlow::willBeDestroyed(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 LayoutFullScreen::LayoutFullScreen() | 61 LayoutFullScreen::LayoutFullScreen() |
| 62 : LayoutFlexibleBox(nullptr) | 62 : LayoutFlexibleBox(nullptr) |
| 63 , m_placeholder(nullptr) | 63 , m_placeholder(nullptr) |
| 64 { | 64 { |
| 65 setIsAtomicInlineLevel(false); | 65 setIsAtomicInlineLevel(false); |
| 66 } | 66 } |
| 67 | 67 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 parent()->addChild(child, this); | 174 parent()->addChild(child, this); |
| 175 parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(
LayoutInvalidationReason::Fullscreen); | 175 parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(
LayoutInvalidationReason::Fullscreen); |
| 176 } | 176 } |
| 177 } | 177 } |
| 178 if (placeholder()) | 178 if (placeholder()) |
| 179 placeholder()->remove(); | 179 placeholder()->remove(); |
| 180 remove(); | 180 remove(); |
| 181 destroy(); | 181 destroy(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void LayoutFullScreen::setPlaceholder(LayoutBlock* placeholder) | |
| 185 { | |
| 186 m_placeholder = placeholder; | |
| 187 } | |
| 188 | |
| 189 void LayoutFullScreen::createPlaceholder(PassRefPtr<ComputedStyle> style, const
LayoutRect& frameRect) | 184 void LayoutFullScreen::createPlaceholder(PassRefPtr<ComputedStyle> style, const
LayoutRect& frameRect) |
| 190 { | 185 { |
| 191 if (style->width().isAuto()) | 186 if (style->width().isAuto()) |
| 192 style->setWidth(Length(frameRect.width(), Fixed)); | 187 style->setWidth(Length(frameRect.width(), Fixed)); |
| 193 if (style->height().isAuto()) | 188 if (style->height().isAuto()) |
| 194 style->setHeight(Length(frameRect.height(), Fixed)); | 189 style->setHeight(Length(frameRect.height(), Fixed)); |
| 195 | 190 |
| 196 if (!m_placeholder) { | 191 if (!m_placeholder) { |
| 197 m_placeholder = new LayoutFullScreenPlaceholder(this); | 192 m_placeholder = new LayoutFullScreenPlaceholder(this); |
| 198 m_placeholder->setStyleWithWritingModeOfParent(style); | 193 m_placeholder->setStyleWithWritingModeOfParent(style); |
| 199 if (parent()) { | 194 if (parent()) { |
| 200 parent()->addChildWithWritingModeOfParent(m_placeholder, this); | 195 parent()->addChildWithWritingModeOfParent(m_placeholder, this); |
| 201 parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(
LayoutInvalidationReason::Fullscreen); | 196 parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(
LayoutInvalidationReason::Fullscreen); |
| 202 } | 197 } |
| 203 } else { | 198 } else { |
| 204 m_placeholder->setStyle(style); | 199 m_placeholder->setStyle(style); |
| 205 m_placeholder->setStyleWithWritingModeOfParent(style); | 200 m_placeholder->setStyleWithWritingModeOfParent(style); |
| 206 } | 201 } |
| 207 } | 202 } |
| OLD | NEW |