| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Google Inc. | 3 * Copyright (C) 2012 Google Inc. |
| 4 * All rights reserved. | 4 * All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #include "config.h" | 28 #include "config.h" |
| 29 | 29 |
| 30 #include "core/layout/LayoutTextTrackContainer.h" | 30 #include "core/layout/LayoutTextTrackContainer.h" |
| 31 | 31 |
| 32 #include "core/frame/DeprecatedScheduleStyleRecalcDuringLayout.h" | 32 #include "core/frame/DeprecatedScheduleStyleRecalcDuringLayout.h" |
| 33 #include "core/html/HTMLMediaElement.h" | |
| 34 #include "core/html/track/TextTrackContainer.h" | 33 #include "core/html/track/TextTrackContainer.h" |
| 35 | 34 |
| 36 namespace blink { | 35 namespace blink { |
| 37 | 36 |
| 38 LayoutTextTrackContainer::LayoutTextTrackContainer(Element* element) | 37 LayoutTextTrackContainer::LayoutTextTrackContainer(Element* element) |
| 39 : LayoutBlockFlow(element) | 38 : LayoutBlockFlow(element) |
| 40 { | 39 { |
| 41 } | 40 } |
| 42 | 41 |
| 43 void LayoutTextTrackContainer::layout() | 42 void LayoutTextTrackContainer::layout() |
| 44 { | 43 { |
| 45 LayoutBlockFlow::layout(); | 44 LayoutBlockFlow::layout(); |
| 46 if (style()->display() == NONE) | |
| 47 return; | |
| 48 | 45 |
| 49 DeprecatedScheduleStyleRecalcDuringLayout marker(node()->document().lifecycl
e()); | 46 DeprecatedScheduleStyleRecalcDuringLayout marker(node()->document().lifecycl
e()); |
| 50 | 47 |
| 51 TextTrackContainer* textTrackContainer = toTextTrackContainer(node()); | 48 TextTrackContainer* textTrackContainer = toTextTrackContainer(node()); |
| 52 HTMLMediaElement* mediaElement = toHTMLMediaElement(parent()->node()); | 49 ASSERT(textTrackContainer); |
| 53 ASSERT(textTrackContainer && mediaElement); | 50 LayoutSize size = contentBoxRect().size(); |
| 54 textTrackContainer->updateSizes(*mediaElement); | 51 textTrackContainer->updateSizes(size); |
| 55 } | 52 } |
| 56 | 53 |
| 57 } // namespace blink | 54 } // namespace blink |
| OLD | NEW |