chromium/third_party/blink/renderer/core/html/track/vtt/vtt_cue_layout_algorithm.cc

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/html/track/vtt/vtt_cue_layout_algorithm.h"

#include <math.h>

#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/html/track/vtt/vtt_cue.h"
#include "third_party/blink/renderer/core/html/track/vtt/vtt_cue_box.h"
#include "third_party/blink/renderer/core/layout/inline/inline_cursor.h"
#include "third_party/blink/renderer/core/layout/layout_inline.h"

namespace blink {

namespace {

// We use this helper to make sure all (bounding) boxes used for comparisons
// are relative to the same coordinate space. If we didn't the (bounding) boxes
// could be affect by transforms on an ancestor et.c, which could yield
// incorrect results.
gfx::Rect BorderBoxRelativeToAncestor(const LayoutBox& box,
                                      const LayoutBoxModelObject& ancestor) {}

gfx::Rect ComputeControlsRect(const LayoutObject& container) {}

}  // namespace

VttCueLayoutAlgorithm::VttCueLayoutAlgorithm(VTTCueBox& cue)
    :{}

void VttCueLayoutAlgorithm::Layout() {}

// static
PhysicalSize VttCueLayoutAlgorithm::FirstInlineBoxSize(
    const LayoutBox& cue_box) {}

LayoutUnit VttCueLayoutAlgorithm::ComputeInitialPositionAdjustment(
    LayoutUnit max_dimension,
    const gfx::Rect& controls_rect) {}

// CueBoundingBox() does not return the geometry from LayoutBox as is because
// the resultant rectangle should be:
// - Based on the latest adjusted position even before the box is laid out.
// - Based on the initial position without adjustment if the function is
//   called just after style-recalc.
//
// static
gfx::Rect VttCueLayoutAlgorithm::CueBoundingBox(const LayoutBox& cue_box) {}

bool VttCueLayoutAlgorithm::IsOutside(const gfx::Rect& title_area) const {}

bool VttCueLayoutAlgorithm::IsOverlapping(
    const gfx::Rect& controls_rect) const {}

bool VttCueLayoutAlgorithm::ShouldSwitchDirection(
    LayoutUnit cue_block_position,
    LayoutUnit cue_block_size,
    LayoutUnit full_dimension) const {}

void VttCueLayoutAlgorithm::AdjustPositionWithSnapToLines() {}

void VttCueLayoutAlgorithm::AdjustPositionWithoutSnapToLines() {}

}  // namespace blink