chromium/third_party/blink/renderer/core/layout/layout_multi_column_flow_thread.cc

/*
 * Copyright (C) 2012 Apple Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS IN..0TERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include "third_party/blink/renderer/core/layout/layout_multi_column_flow_thread.h"

#include "base/not_fatal_until.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"
#include "third_party/blink/renderer/core/layout/fragmentation_utils.h"
#include "third_party/blink/renderer/core/layout/geometry/writing_mode_converter.h"
#include "third_party/blink/renderer/core/layout/layout_multi_column_set.h"
#include "third_party/blink/renderer/core/layout/layout_multi_column_spanner_placeholder.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/layout/multi_column_fragmentainer_group.h"
#include "third_party/blink/renderer/core/layout/physical_box_fragment.h"

namespace blink {

#if DCHECK_IS_ON()
const LayoutBoxModelObject* LayoutMultiColumnFlowThread::style_changed_object_;
#endif
bool LayoutMultiColumnFlowThread::could_contain_spanners_;
bool LayoutMultiColumnFlowThread::toggle_spanners_if_needed_;

LayoutMultiColumnFlowThread::LayoutMultiColumnFlowThread()
    :{}

LayoutMultiColumnFlowThread::~LayoutMultiColumnFlowThread() = default;

void LayoutMultiColumnFlowThread::Trace(Visitor* visitor) const {}

LayoutMultiColumnFlowThread* LayoutMultiColumnFlowThread::CreateAnonymous(
    Document& document,
    const ComputedStyle& parent_style) {}

LayoutMultiColumnSet* LayoutMultiColumnFlowThread::FirstMultiColumnSet() const {}

LayoutMultiColumnSet* LayoutMultiColumnFlowThread::LastMultiColumnSet() const {}

static inline bool IsMultiColumnContainer(const LayoutObject& object) {}

// Return true if there's nothing that prevents the specified object from being
// in the ancestor chain between some column spanner and its containing multicol
// container. A column spanner needs the multicol container to be its containing
// block, so that the spanner is able to escape the flow thread. (Everything
// contained by the flow thread is split into columns, but this is precisely
// what shouldn't be done to a spanner, since it's supposed to span all
// columns.)
//
// We require that the parent of the spanner participate in the block formatting
// context established by the multicol container (i.e. that there are no BFCs or
// other formatting contexts in-between). We also require that there be no
// transforms, since transforms insist on being in the containing block chain
// for everything inside it, which conflicts with a spanners's need to have the
// multicol container as its direct containing block. A transform is supposed to
// be a containing block for everything inside, including fixed-positioned
// elements. Letting spanners escape this containment seems strange. See
// https://github.com/w3c/csswg-drafts/issues/6805
// Finally, we may also not put spanners inside objects that don't support
// fragmentation.
bool LayoutMultiColumnFlowThread::CanContainSpannerInParentFragmentationContext(
    const LayoutObject& object) const {}

static inline bool HasAnyColumnSpanners(
    const LayoutMultiColumnFlowThread& flow_thread) {}

// Find the next layout object that has the multicol container in its containing
// block chain, skipping nested multicol containers.
static LayoutObject* NextInPreOrderAfterChildrenSkippingOutOfFlow(
    LayoutMultiColumnFlowThread* flow_thread,
    LayoutObject* descendant) {}

// Find the previous layout object that has the multicol container in its
// containing block chain, skipping nested multicol containers.
static LayoutObject* PreviousInPreOrderSkippingOutOfFlow(
    LayoutMultiColumnFlowThread* flow_thread,
    LayoutObject* descendant) {}

static LayoutObject* FirstLayoutObjectInSet(
    LayoutMultiColumnSet* multicol_set) {}

static LayoutObject* LastLayoutObjectInSet(LayoutMultiColumnSet* multicol_set) {}

LayoutMultiColumnSet* LayoutMultiColumnFlowThread::MapDescendantToColumnSet(
    LayoutObject* layout_object) const {}

LayoutMultiColumnSpannerPlaceholder*
LayoutMultiColumnFlowThread::ContainingColumnSpannerPlaceholder(
    const LayoutObject* descendant) const {}

void LayoutMultiColumnFlowThread::Populate() {}

void LayoutMultiColumnFlowThread::EvacuateAndDestroy() {}

PhysicalOffset LayoutMultiColumnFlowThread::ColumnOffset(
    const PhysicalOffset& point) const {}

bool LayoutMultiColumnFlowThread::IsPageLogicalHeightKnown() const {}

PhysicalOffset LayoutMultiColumnFlowThread::FlowThreadTranslationAtOffset(
    LayoutUnit offset_in_flow_thread,
    PageBoundaryRule rule) const {}

PhysicalOffset LayoutMultiColumnFlowThread::FlowThreadTranslationAtPoint(
    const PhysicalOffset& flow_thread_point) const {}

PhysicalOffset LayoutMultiColumnFlowThread::VisualPointToFlowThreadPoint(
    const PhysicalOffset& visual_point) const {}

LayoutMultiColumnSet* LayoutMultiColumnFlowThread::ColumnSetAtBlockOffset(
    LayoutUnit offset,
    PageBoundaryRule page_boundary_rule) const {}

void LayoutMultiColumnFlowThread::ColumnRuleStyleDidChange() {}

bool LayoutMultiColumnFlowThread::RemoveSpannerPlaceholderIfNoLongerValid(
    LayoutBox* spanner_object_in_flow_thread) {}

LayoutMultiColumnFlowThread* LayoutMultiColumnFlowThread::EnclosingFlowThread(
    AncestorSearchConstraint constraint) const {}

void LayoutMultiColumnFlowThread::SetColumnCountFromNG(unsigned column_count) {}

void LayoutMultiColumnFlowThread::FinishLayoutFromNG(
    LayoutUnit flow_thread_offset) {}

void LayoutMultiColumnFlowThread::CreateAndInsertMultiColumnSet(
    LayoutBox* insert_before) {}

void LayoutMultiColumnFlowThread::CreateAndInsertSpannerPlaceholder(
    LayoutBox* spanner_object_in_flow_thread,
    LayoutObject* inserted_before_in_flow_thread) {}

void LayoutMultiColumnFlowThread::DestroySpannerPlaceholder(
    LayoutMultiColumnSpannerPlaceholder* placeholder) {}

bool LayoutMultiColumnFlowThread::DescendantIsValidColumnSpanner(
    LayoutObject* descendant) const {}

void LayoutMultiColumnFlowThread::AddColumnSetToThread(
    LayoutMultiColumnSet* column_set) {}

void LayoutMultiColumnFlowThread::WillBeRemovedFromTree() {}

// When processing layout objects to remove or when processing layout objects
// that have just been inserted, certain types of objects should be skipped.
static bool ShouldSkipInsertedOrRemovedChild(
    LayoutMultiColumnFlowThread* flow_thread,
    const LayoutObject& child) {}

void LayoutMultiColumnFlowThread::FlowThreadDescendantWasInserted(
    LayoutObject* descendant) {}

void LayoutMultiColumnFlowThread::FlowThreadDescendantWillBeRemoved(
    LayoutObject* descendant) {}

static inline bool NeedsToReinsertIntoFlowThread(
    const LayoutBoxModelObject& object,
    const ComputedStyle& old_style,
    const ComputedStyle& new_style) {}

static inline bool NeedsToRemoveFromFlowThread(
    const LayoutBoxModelObject& object,
    const ComputedStyle& old_style,
    const ComputedStyle& new_style) {}

static inline bool NeedsToInsertIntoFlowThread(
    const LayoutMultiColumnFlowThread* flow_thread,
    const LayoutBoxModelObject* descendant,
    const ComputedStyle& old_style,
    const ComputedStyle& new_style) {}

void LayoutMultiColumnFlowThread::FlowThreadDescendantStyleWillChange(
    LayoutBoxModelObject* descendant,
    StyleDifference diff,
    const ComputedStyle& new_style) {}

void LayoutMultiColumnFlowThread::FlowThreadDescendantStyleDidChange(
    LayoutBoxModelObject* descendant,
    StyleDifference diff,
    const ComputedStyle& old_style) {}

void LayoutMultiColumnFlowThread::ToggleSpannersInSubtree(
    LayoutBoxModelObject* descendant) {}

LayoutPoint LayoutMultiColumnFlowThread::LocationInternal() const {}

PhysicalSize LayoutMultiColumnFlowThread::Size() const {}

void LayoutMultiColumnFlowThread::UpdateGeometry() {}

}  // namespace blink