#include "third_party/blink/renderer/core/layout/svg/layout_svg_resource_container.h"
#include "third_party/blink/renderer/core/layout/svg/svg_layout_info.h"
#include "third_party/blink/renderer/core/layout/svg/svg_resources.h"
#include "third_party/blink/renderer/core/style/reference_clip_path_operation.h"
#include "third_party/blink/renderer/core/style/style_mask_source_image.h"
#include "third_party/blink/renderer/core/svg/svg_element.h"
#include "third_party/blink/renderer/core/svg/svg_length.h"
#include "third_party/blink/renderer/core/svg/svg_length_context.h"
#include "third_party/blink/renderer/core/svg/svg_resource.h"
#include "third_party/blink/renderer/core/svg/svg_tree_scope_resources.h"
#include "third_party/blink/renderer/platform/geometry/length_functions.h"
namespace blink {
namespace {
LocalSVGResource* ResourceForContainer(
const LayoutSVGResourceContainer& resource_container) { … }
float ObjectBoundingBoxUnitToUserUnits(const Length& length,
float ref_dimension) { … }
}
LayoutSVGResourceContainer::LayoutSVGResourceContainer(SVGElement* node)
: … { … }
LayoutSVGResourceContainer::~LayoutSVGResourceContainer() = default;
SVGLayoutResult LayoutSVGResourceContainer::UpdateSVGLayout(
const SVGLayoutInfo& layout_info) { … }
gfx::RectF LayoutSVGResourceContainer::ResolveRectangle(
const SVGViewportResolver& viewport_resolver,
const SVGLengthConversionData& conversion_data,
SVGUnitTypes::SVGUnitType type,
const gfx::RectF& reference_box,
const SVGLength& x,
const SVGLength& y,
const SVGLength& width,
const SVGLength& height,
const std::optional<gfx::SizeF>& override_viewport) { … }
gfx::RectF LayoutSVGResourceContainer::ResolveRectangle(
const SVGElement& context_element,
SVGUnitTypes::SVGUnitType type,
const gfx::RectF& reference_box,
const SVGLength& x,
const SVGLength& y,
const SVGLength& width,
const SVGLength& height,
const std::optional<gfx::SizeF>& override_viewport) { … }
gfx::RectF LayoutSVGResourceContainer::ResolveRectangle(
SVGUnitTypes::SVGUnitType type,
const gfx::RectF& reference_box,
const SVGLength& x,
const SVGLength& y,
const SVGLength& width,
const SVGLength& height) const { … }
void LayoutSVGResourceContainer::InvalidateClientsIfActiveResource() { … }
void LayoutSVGResourceContainer::WillBeDestroyed() { … }
void LayoutSVGResourceContainer::StyleDidChange(
StyleDifference diff,
const ComputedStyle* old_style) { … }
bool LayoutSVGResourceContainer::FindCycle() const { … }
static HeapVector<Member<SVGResource>> CollectResources(
const LayoutObject& layout_object) { … }
bool LayoutSVGResourceContainer::FindCycleInResources(
const LayoutObject& layout_object) { … }
bool LayoutSVGResourceContainer::FindCycleFromSelf() const { … }
bool LayoutSVGResourceContainer::FindCycleInDescendants(
const LayoutObject& root) { … }
bool LayoutSVGResourceContainer::FindCycleInSubtree(
const LayoutObject& root) { … }
void LayoutSVGResourceContainer::MarkAllClientsForInvalidation(
InvalidationModeMask invalidation_mask) { … }
void LayoutSVGResourceContainer::InvalidateCache() { … }
static inline void RemoveFromCacheAndInvalidateDependencies(
LayoutObject& object,
bool needs_layout) { … }
void LayoutSVGResourceContainer::InvalidateDependentElements(
LayoutObject& object,
bool needs_layout) { … }
void LayoutSVGResourceContainer::InvalidateAncestorChainResources(
LayoutObject& object,
bool needs_layout) { … }
void LayoutSVGResourceContainer::MarkForLayoutAndParentResourceInvalidation(
LayoutObject& object,
bool needs_layout) { … }
static inline bool IsLayoutObjectOfResourceContainer(
const LayoutObject& layout_object) { … }
void LayoutSVGResourceContainer::StyleChanged(LayoutObject& object,
StyleDifference diff) { … }
}