15c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)/*
253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * Copyright (C) 2012 Google Inc.
453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * All rights reserved.
55c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
65c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Redistribution and use in source and binary forms, with or without
75c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * modification, are permitted provided that the following conditions
85c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * are met:
95c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 1. Redistributions of source code must retain the above copyright
105c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *    notice, this list of conditions and the following disclaimer.
115c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 2. Redistributions in binary form must reproduce the above copyright
125c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *    notice, this list of conditions and the following disclaimer in the
135c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *    documentation and/or other materials provided with the distribution.
145c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
155c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
165c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
175c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
185c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
195c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
205c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
215c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
225c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
235c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
245c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
255c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
265c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) */
275c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
285c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#include "config.h"
295c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
3053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#include "core/rendering/RenderMediaControlElements.h"
3153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
3209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)#include "core/frame/DeprecatedScheduleStyleRecalcDuringLayout.h"
3353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#include "core/rendering/RenderView.h"
345c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
355c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)namespace WebCore {
365c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
3753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)RenderTextTrackContainerElement::RenderTextTrackContainerElement(Element* element)
388abfc5808a4e34d6e03867af8bc440dee641886fTorne (Richard Coles)    : RenderBlockFlow(element)
3953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles){
4053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)}
4153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
4253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)void RenderTextTrackContainerElement::layout()
435c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles){
4409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    RenderBlockFlow::layout();
4553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    if (style()->display() == NONE)
465c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)        return;
475c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
4853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    ASSERT(mediaControlElementType(node()) == MediaTextTrackDisplayContainer);
4953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
5009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    DeprecatedScheduleStyleRecalcDuringLayout marker(node()->document().lifecycle());
5109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)
525d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)    ForceHorriblySlowRectMapping slowRectMapping(*this);
5353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    static_cast<MediaControlTextTrackContainerElement*>(node())->updateSizes();
545c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)}
555c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
565c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)} // namespace WebCore
57