chromium/third_party/blink/public/mojom/frame/viewport_intersection_state.mojom

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

module blink.mojom;

import "ui/gfx/geometry/mojom/geometry.mojom";
import "ui/gfx/mojom/transform.mojom";

// Indicates whether a child frame is occluded or visually altered (e.g., with
// CSS opacity or transform) by content or styles in the parent frame.
enum FrameOcclusionState {
  // No occlusion determination was made.
  kUnknown = 0,
  // The frame *may* be occluded or visually altered.
  kPossiblyOccluded = 1,
  // The frame is definitely not occluded or visually altered.
  kGuaranteedNotOccluded = 2,
};

// Communicates information about the position and visibility of a child frame
// within the viewport of the top-level main frame.
struct ViewportIntersectionState {
  // Portion of the child frame which is within the main frame's scrolling
  gfx.mojom.Rect viewport_intersection;

  // Same as viewport_intersection, but without applying the main frame's
  // document-level overflow clip.
  gfx.mojom.Rect main_frame_intersection;

  // Area of the child frame that needs to be rastered, in physical pixels.
  gfx.mojom.Rect compositor_visible_rect;

  // Occlusion state, as described above.
  FrameOcclusionState occlusion_state = FrameOcclusionState.kUnknown;

  // Outermost main frame's size. Is not affected by
  // pinch-zoom/visual-viewport.
  gfx.mojom.Size outermost_main_frame_size;

  // Outermost main frame's scroll position. Is not affected by
  // pinch-zoom/visual-viewport.
  gfx.mojom.Point outermost_main_frame_scroll_position;

  // Child frame's transform to the coordinate system of the main frame.
  gfx.mojom.Transform main_frame_transform;
};