Commit 119fa825 authored by Ian Kilpatrick's avatar Ian Kilpatrick Committed by Commit Bot

[css-layout-api] Move all css-layout-api classes into layout/ng/custom

This also removes LayoutBox from the code, instead preferring
NGLayoutInputNode.

There should be no behaviour change.

Bug: 726125
Change-Id: I532c5078806151f6336523f742bf62e76a374bcd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761067Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688188}
parent a71bad8b
......@@ -1312,7 +1312,6 @@ jumbo_source_set("unit_tests") {
"intersection_observer/intersection_observer_test.cc",
"layout/api/selection_state_test.cc",
"layout/collapsed_border_value_test.cc",
"layout/custom/layout_worklet_test.cc",
"layout/force_legacy_layout_test.cc",
"layout/geometry/logical_offset_test.cc",
"layout/geometry/logical_rect_test.cc",
......@@ -1354,6 +1353,7 @@ jumbo_source_set("unit_tests") {
"layout/map_coordinates_test.cc",
"layout/min_max_size_test.cc",
"layout/multi_column_fragmentainer_group_test.cc",
"layout/ng/custom/layout_worklet_test.cc",
"layout/ng/exclusions/ng_exclusion_space_test.cc",
"layout/ng/geometry/ng_box_strut_test.cc",
"layout/ng/geometry/ng_static_position_test.cc",
......
......@@ -310,10 +310,10 @@ core_idl_files =
"intersection_observer/intersection_observer.idl",
"intersection_observer/intersection_observer_entry.idl",
"invisible_dom/activate_invisible_event.idl",
"layout/custom/layout_constraints.idl",
"layout/custom/layout_fragment.idl",
"layout/custom/layout_child.idl",
"layout/custom/layout_worklet_global_scope.idl",
"layout/ng/custom/layout_constraints.idl",
"layout/ng/custom/layout_fragment.idl",
"layout/ng/custom/layout_child.idl",
"layout/ng/custom/layout_worklet_global_scope.idl",
"loader/appcache/application_cache.idl",
"messaging/message_channel.idl",
"messaging/message_port.idl",
......@@ -558,7 +558,7 @@ core_dependency_idl_files =
"fullscreen/element_fullscreen.idl",
"html/html_hyperlink_element_utils.idl",
"html/portal/window_portal_host.idl",
"layout/custom/css_layout_worklet.idl",
"layout/ng/custom/css_layout_worklet.idl",
"svg/svg_document.idl",
"svg/svg_filter_primitive_standard_attributes.idl",
"svg/svg_fit_to_view_box.idl",
......@@ -677,8 +677,8 @@ core_dictionary_idl_files =
"input/input_device_capabilities_init.idl",
"input/touch_init.idl",
"intersection_observer/intersection_observer_init.idl",
"layout/custom/custom_layout_constraints_options.idl",
"layout/custom/fragment_result_options.idl",
"layout/ng/custom/custom_layout_constraints_options.idl",
"layout/ng/custom/fragment_result_options.idl",
"messaging/post_message_options.idl",
"mojo/mojo_create_data_pipe_options.idl",
"mojo/mojo_create_data_pipe_result.idl",
......
......@@ -39,30 +39,6 @@ blink_core_sources("layout") {
"content_change_type.h",
"counter_node.cc",
"counter_node.h",
"custom/css_layout_definition.cc",
"custom/css_layout_definition.h",
"custom/css_layout_worklet.cc",
"custom/css_layout_worklet.h",
"custom/custom_layout_child.cc",
"custom/custom_layout_child.h",
"custom/custom_layout_constraints.cc",
"custom/custom_layout_constraints.h",
"custom/custom_layout_fragment.cc",
"custom/custom_layout_fragment.h",
"custom/custom_layout_scope.cc",
"custom/custom_layout_scope.h",
"custom/custom_layout_work_task.cc",
"custom/custom_layout_work_task.h",
"custom/document_layout_definition.cc",
"custom/document_layout_definition.h",
"custom/layout_worklet.cc",
"custom/layout_worklet.h",
"custom/layout_worklet_global_scope.cc",
"custom/layout_worklet_global_scope.h",
"custom/layout_worklet_global_scope_proxy.cc",
"custom/layout_worklet_global_scope_proxy.h",
"custom/pending_layout_registry.cc",
"custom/pending_layout_registry.h",
"depth_ordered_layout_object_list.cc",
"depth_ordered_layout_object_list.h",
"flexible_box_algorithm.cc",
......@@ -299,10 +275,34 @@ blink_core_sources("layout") {
"min_max_size.h",
"multi_column_fragmentainer_group.cc",
"multi_column_fragmentainer_group.h",
"ng/custom/css_layout_definition.cc",
"ng/custom/css_layout_definition.h",
"ng/custom/css_layout_worklet.cc",
"ng/custom/css_layout_worklet.h",
"ng/custom/custom_layout_child.cc",
"ng/custom/custom_layout_child.h",
"ng/custom/custom_layout_constraints.cc",
"ng/custom/custom_layout_constraints.h",
"ng/custom/custom_layout_fragment.cc",
"ng/custom/custom_layout_fragment.h",
"ng/custom/custom_layout_scope.cc",
"ng/custom/custom_layout_scope.h",
"ng/custom/custom_layout_work_task.cc",
"ng/custom/custom_layout_work_task.h",
"ng/custom/document_layout_definition.cc",
"ng/custom/document_layout_definition.h",
"ng/custom/layout_ng_custom.cc",
"ng/custom/layout_ng_custom.h",
"ng/custom/layout_worklet.cc",
"ng/custom/layout_worklet.h",
"ng/custom/layout_worklet_global_scope.cc",
"ng/custom/layout_worklet_global_scope.h",
"ng/custom/layout_worklet_global_scope_proxy.cc",
"ng/custom/layout_worklet_global_scope_proxy.h",
"ng/custom/ng_custom_layout_algorithm.cc",
"ng/custom/ng_custom_layout_algorithm.h",
"ng/custom/pending_layout_registry.cc",
"ng/custom/pending_layout_registry.h",
"ng/exclusions/ng_exclusion.cc",
"ng/exclusions/ng_exclusion.h",
"ng/exclusions/ng_exclusion_space.cc",
......
......@@ -47,8 +47,6 @@
#include "third_party/blink/renderer/core/layout/api/line_layout_block_flow.h"
#include "third_party/blink/renderer/core/layout/api/line_layout_box.h"
#include "third_party/blink/renderer/core/layout/box_layout_extra_input.h"
#include "third_party/blink/renderer/core/layout/custom/layout_worklet.h"
#include "third_party/blink/renderer/core/layout/custom/layout_worklet_global_scope_proxy.h"
#include "third_party/blink/renderer/core/layout/hit_test_result.h"
#include "third_party/blink/renderer/core/layout/layout_analyzer.h"
#include "third_party/blink/renderer/core/layout/layout_deprecated_flexible_box.h"
......@@ -62,7 +60,10 @@
#include "third_party/blink/renderer/core/layout/layout_multi_column_spanner_placeholder.h"
#include "third_party/blink/renderer/core/layout/layout_table_cell.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_child.h"
#include "third_party/blink/renderer/core/layout/ng/custom/layout_ng_custom.h"
#include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet.h"
#include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet_global_scope_proxy.h"
#include "third_party/blink/renderer/core/layout/ng/geometry/ng_box_strut.h"
#include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h"
#include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h"
......@@ -120,6 +121,19 @@ BoxLayoutExtraInput::~BoxLayoutExtraInput() {
box.SetBoxLayoutExtraInput(nullptr);
}
LayoutBoxRareData::LayoutBoxRareData()
: spanner_placeholder_(nullptr),
override_logical_width_(-1),
override_logical_height_(-1),
// TODO(rego): We should store these based on physical direction.
has_override_containing_block_content_logical_width_(false),
has_override_containing_block_content_logical_height_(false),
has_override_percentage_resolution_block_size_(false),
has_previous_content_box_rect_and_layout_overflow_rect_(false),
percent_height_container_(nullptr),
snap_container_(nullptr),
snap_areas_(nullptr) {}
LayoutBox::LayoutBox(ContainerNode* node)
: LayoutBoxModelObject(node),
intrinsic_content_logical_height_(-1),
......@@ -6230,7 +6244,7 @@ void LayoutBox::AddCustomLayoutChildIfNeeded() {
return;
EnsureRareData().layout_child_ =
MakeGarbageCollected<CustomLayoutChild>(*definition, this);
MakeGarbageCollected<CustomLayoutChild>(*definition, NGBlockNode(this));
}
void LayoutBox::ClearCustomLayoutChild() {
......@@ -6238,7 +6252,7 @@ void LayoutBox::ClearCustomLayoutChild() {
return;
if (rare_data_->layout_child_)
rare_data_->layout_child_->ClearLayoutBox();
rare_data_->layout_child_->ClearLayoutNode();
rare_data_->layout_child_ = nullptr;
}
......
......@@ -27,7 +27,6 @@
#include "base/macros.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/layout/custom/custom_layout_child.h"
#include "third_party/blink/renderer/core/layout/layout_box_model_object.h"
#include "third_party/blink/renderer/core/layout/min_max_size.h"
#include "third_party/blink/renderer/core/layout/overflow_model.h"
......@@ -35,6 +34,7 @@
namespace blink {
class CustomLayoutChild;
class EventHandler;
class LayoutBlockFlow;
class LayoutMultiColumnSpannerPlaceholder;
......@@ -69,18 +69,7 @@ struct LayoutBoxRareData {
USING_FAST_MALLOC(LayoutBoxRareData);
public:
LayoutBoxRareData()
: spanner_placeholder_(nullptr),
override_logical_width_(-1),
override_logical_height_(-1),
// TODO(rego): We should store these based on physical direction.
has_override_containing_block_content_logical_width_(false),
has_override_containing_block_content_logical_height_(false),
has_override_percentage_resolution_block_size_(false),
has_previous_content_box_rect_and_layout_overflow_rect_(false),
percent_height_container_(nullptr),
snap_container_(nullptr),
snap_areas_(nullptr) {}
LayoutBoxRareData();
// For spanners, the spanner placeholder that lays us out within the multicol
// container.
......
......@@ -2,7 +2,7 @@
// 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/layout/custom/css_layout_definition.h"
#include "third_party/blink/renderer/core/layout/ng/custom/css_layout_definition.h"
#include <memory>
......@@ -18,10 +18,11 @@
#include "third_party/blink/renderer/core/css/cssom/prepopulated_computed_style_property_map.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/layout/custom/custom_layout_constraints.h"
#include "third_party/blink/renderer/core/layout/custom/custom_layout_fragment.h"
#include "third_party/blink/renderer/core/layout/custom/custom_layout_scope.h"
#include "third_party/blink/renderer/core/layout/custom/fragment_result_options.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_child.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_constraints.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_fragment.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_scope.h"
#include "third_party/blink/renderer/core/layout/ng/custom/fragment_result_options.h"
#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h"
#include "third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h"
#include "third_party/blink/renderer/platform/bindings/microtask.h"
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CSS_LAYOUT_DEFINITION_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CSS_LAYOUT_DEFINITION_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CSS_LAYOUT_DEFINITION_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CSS_LAYOUT_DEFINITION_H_
#include "third_party/blink/renderer/core/css/css_property_names.h"
#include "third_party/blink/renderer/core/css/cssom/css_style_value.h"
......@@ -117,4 +117,4 @@ class CSSLayoutDefinition final
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CSS_LAYOUT_DEFINITION_H_
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CSS_LAYOUT_DEFINITION_H_
......@@ -2,11 +2,11 @@
// 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/layout/custom/css_layout_worklet.h"
#include "third_party/blink/renderer/core/layout/ng/custom/css_layout_worklet.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/layout/custom/layout_worklet.h"
#include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
namespace blink {
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CSS_LAYOUT_WORKLET_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CSS_LAYOUT_WORKLET_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CSS_LAYOUT_WORKLET_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CSS_LAYOUT_WORKLET_H_
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
......@@ -22,4 +22,4 @@ class CORE_EXPORT CSSLayoutWorklet {
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CSS_LAYOUT_WORKLET_H_
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CSS_LAYOUT_WORKLET_H_
......@@ -2,25 +2,24 @@
// 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/layout/custom/custom_layout_child.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_child.h"
#include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h"
#include "third_party/blink/renderer/core/css/cssom/prepopulated_computed_style_property_map.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/layout/custom/css_layout_definition.h"
#include "third_party/blink/renderer/core/layout/custom/custom_layout_fragment.h"
#include "third_party/blink/renderer/core/layout/custom/custom_layout_scope.h"
#include "third_party/blink/renderer/core/layout/custom/custom_layout_work_task.h"
#include "third_party/blink/renderer/core/layout/layout_box.h"
#include "third_party/blink/renderer/core/layout/ng/custom/css_layout_definition.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_fragment.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_scope.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_work_task.h"
namespace blink {
CustomLayoutChild::CustomLayoutChild(const CSSLayoutDefinition& definition,
LayoutBox* box)
: box_(box),
NGLayoutInputNode node)
: node_(node),
style_map_(MakeGarbageCollected<PrepopulatedComputedStylePropertyMap>(
box->GetDocument(),
box->StyleRef(),
node.GetDocument(),
node.Style(),
definition.ChildNativeInvalidationProperties(),
definition.ChildCustomInvalidationProperties())) {}
......@@ -31,7 +30,7 @@ ScriptPromise CustomLayoutChild::layoutNextFragment(
// A layout child may be invalid if it has been removed from the tree (it is
// possible for a web developer to hold onto a LayoutChild object after its
// underlying LayoutObject has been destroyed).
if (!box_ || !token_->IsValid()) {
if (!node_ || !token_->IsValid()) {
return ScriptPromise::RejectWithDOMException(
script_state,
MakeGarbageCollected<DOMException>(DOMExceptionCode::kInvalidStateError,
......
......@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CUSTOM_LAYOUT_CHILD_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CUSTOM_LAYOUT_CHILD_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CUSTOM_LAYOUT_CHILD_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CUSTOM_LAYOUT_CHILD_H_
#include "third_party/blink/renderer/bindings/core/v8/script_promise.h"
#include "third_party/blink/renderer/core/css/cssom/prepopulated_computed_style_property_map.h"
#include "third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
......@@ -15,7 +16,6 @@ namespace blink {
class CSSLayoutDefinition;
class CustomLayoutConstraintsOptions;
class CustomLayoutToken;
class LayoutBox;
// Represents a "CSS box" for use by a web developer. This is passed into the
// web developer defined layout and intrinsicSizes functions so that they can
......@@ -27,7 +27,7 @@ class CustomLayoutChild : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
CustomLayoutChild(const CSSLayoutDefinition&, LayoutBox*);
CustomLayoutChild(const CSSLayoutDefinition&, NGLayoutInputNode);
~CustomLayoutChild() override = default;
// LayoutChild.idl
......@@ -36,18 +36,18 @@ class CustomLayoutChild : public ScriptWrappable {
const CustomLayoutConstraintsOptions*,
ExceptionState&);
LayoutBox* GetLayoutBox() const {
DCHECK(box_);
return box_;
const NGLayoutInputNode& GetLayoutNode() const {
DCHECK(node_);
return node_;
}
void ClearLayoutBox() { box_ = nullptr; }
void ClearLayoutNode() { node_ = nullptr; }
void SetCustomLayoutToken(CustomLayoutToken* token) { token_ = token; }
void Trace(blink::Visitor*) override;
private:
LayoutBox* box_;
NGLayoutInputNode node_;
Member<PrepopulatedComputedStylePropertyMap> style_map_;
Member<CustomLayoutToken> token_;
......@@ -56,4 +56,4 @@ class CustomLayoutChild : public ScriptWrappable {
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CUSTOM_LAYOUT_CHILD_H_
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CUSTOM_LAYOUT_CHILD_H_
......@@ -2,7 +2,7 @@
// 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/layout/custom/custom_layout_constraints.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_constraints.h"
#include "third_party/blink/renderer/bindings/core/v8/script_value.h"
#include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h"
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CUSTOM_LAYOUT_CONSTRAINTS_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CUSTOM_LAYOUT_CONSTRAINTS_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CUSTOM_LAYOUT_CONSTRAINTS_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CUSTOM_LAYOUT_CONSTRAINTS_H_
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/bindings/trace_wrapper_v8_reference.h"
......@@ -44,4 +44,4 @@ class CustomLayoutConstraints : public ScriptWrappable {
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CUSTOM_LAYOUT_CONSTRAINTS_H_
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CUSTOM_LAYOUT_CONSTRAINTS_H_
......@@ -2,10 +2,10 @@
// 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/layout/custom/custom_layout_fragment.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_fragment.h"
#include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h"
#include "third_party/blink/renderer/core/layout/layout_box.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_child.h"
#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h"
namespace blink {
......@@ -32,8 +32,8 @@ const NGLayoutResult& CustomLayoutFragment::GetLayoutResult() const {
return *layout_result_;
}
LayoutBox* CustomLayoutFragment::GetLayoutBox() const {
return child_->GetLayoutBox();
const NGLayoutInputNode& CustomLayoutFragment::GetLayoutNode() const {
return child_->GetLayoutNode();
}
ScriptValue CustomLayoutFragment::data(ScriptState* script_state) const {
......
......@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CUSTOM_LAYOUT_FRAGMENT_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CUSTOM_LAYOUT_FRAGMENT_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CUSTOM_LAYOUT_FRAGMENT_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CUSTOM_LAYOUT_FRAGMENT_H_
#include "third_party/blink/renderer/core/layout/custom/custom_layout_scope.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_scope.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/bindings/trace_wrapper_v8_reference.h"
#include "third_party/blink/renderer/platform/geometry/layout_unit.h"
......@@ -13,6 +13,7 @@
namespace blink {
class NGLayoutInputNode;
class CustomLayoutChild;
class LayoutBox;
struct LogicalSize;
......@@ -53,7 +54,7 @@ class CustomLayoutFragment : public ScriptWrappable {
ScriptValue data(ScriptState*) const;
const NGLayoutResult& GetLayoutResult() const;
LayoutBox* GetLayoutBox() const;
const NGLayoutInputNode& GetLayoutNode() const;
bool IsValid() const { return token_->IsValid(); }
......@@ -94,4 +95,4 @@ class CustomLayoutFragment : public ScriptWrappable {
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CUSTOM_LAYOUT_FRAGMENT_H_
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CUSTOM_LAYOUT_FRAGMENT_H_
......@@ -2,7 +2,7 @@
// 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/layout/custom/custom_layout_scope.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_scope.h"
namespace blink {
......
......@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CUSTOM_LAYOUT_SCOPE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CUSTOM_LAYOUT_SCOPE_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CUSTOM_LAYOUT_SCOPE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CUSTOM_LAYOUT_SCOPE_H_
#include "third_party/blink/renderer/core/layout/custom/custom_layout_work_task.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_work_task.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
namespace blink {
......@@ -73,4 +73,4 @@ inline bool CustomLayoutToken::IsValid() const {
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CUSTOM_LAYOUT_SCOPE_H_
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CUSTOM_LAYOUT_SCOPE_H_
......@@ -2,14 +2,12 @@
// 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/layout/custom/custom_layout_work_task.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_work_task.h"
#include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h"
#include "third_party/blink/renderer/core/layout/custom/custom_layout_child.h"
#include "third_party/blink/renderer/core/layout/custom/custom_layout_constraints_options.h"
#include "third_party/blink/renderer/core/layout/custom/custom_layout_fragment.h"
#include "third_party/blink/renderer/core/layout/layout_block.h"
#include "third_party/blink/renderer/core/layout/layout_box.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_child.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_constraints_options.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_fragment.h"
#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h"
#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h"
#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h"
......@@ -34,7 +32,7 @@ CustomLayoutWorkTask::~CustomLayoutWorkTask() = default;
void CustomLayoutWorkTask::Run(const NGConstraintSpace& parent_space,
const ComputedStyle& parent_style) {
DCHECK(token_->IsValid());
NGBlockNode node(child_->GetLayoutBox());
NGLayoutInputNode node = child_->GetLayoutNode();
NGConstraintSpaceBuilder builder(parent_space, node.Style().GetWritingMode(),
/* is_new_fc */ true);
SetOrthogonalFallbackInlineSizeIfNeeded(parent_style, node, &builder);
......
......@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CUSTOM_LAYOUT_WORK_TASK_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CUSTOM_LAYOUT_WORK_TASK_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CUSTOM_LAYOUT_WORK_TASK_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CUSTOM_LAYOUT_WORK_TASK_H_
#include "third_party/blink/renderer/core/layout/custom/custom_layout_constraints_options.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_constraints_options.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
......@@ -43,4 +43,4 @@ class CustomLayoutWorkTask {
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_CUSTOM_LAYOUT_WORK_TASK_H_
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CUSTOM_LAYOUT_WORK_TASK_H_
......@@ -2,7 +2,7 @@
// 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/layout/custom/document_layout_definition.h"
#include "third_party/blink/renderer/core/layout/ng/custom/document_layout_definition.h"
namespace blink {
......
......@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_DOCUMENT_LAYOUT_DEFINITION_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_DOCUMENT_LAYOUT_DEFINITION_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_DOCUMENT_LAYOUT_DEFINITION_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_DOCUMENT_LAYOUT_DEFINITION_H_
#include "third_party/blink/renderer/core/layout/custom/css_layout_definition.h"
#include "third_party/blink/renderer/core/layout/ng/custom/css_layout_definition.h"
namespace blink {
......@@ -48,4 +48,4 @@ class DocumentLayoutDefinition final
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_DOCUMENT_LAYOUT_DEFINITION_H_
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_DOCUMENT_LAYOUT_DEFINITION_H_
......@@ -6,7 +6,7 @@
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/layout/custom/layout_worklet.h"
#include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet.h"
namespace blink {
......
......@@ -2,15 +2,15 @@
// 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/layout/custom/layout_worklet.h"
#include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/layout/custom/document_layout_definition.h"
#include "third_party/blink/renderer/core/layout/custom/layout_worklet_global_scope_proxy.h"
#include "third_party/blink/renderer/core/layout/custom/pending_layout_registry.h"
#include "third_party/blink/renderer/core/layout/ng/custom/document_layout_definition.h"
#include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet_global_scope_proxy.h"
#include "third_party/blink/renderer/core/layout/ng/custom/pending_layout_registry.h"
namespace blink {
......
......@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_LAYOUT_WORKLET_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_LAYOUT_WORKLET_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_LAYOUT_WORKLET_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_LAYOUT_WORKLET_H_
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/layout/custom/document_layout_definition.h"
#include "third_party/blink/renderer/core/layout/custom/pending_layout_registry.h"
#include "third_party/blink/renderer/core/layout/ng/custom/document_layout_definition.h"
#include "third_party/blink/renderer/core/layout/ng/custom/pending_layout_registry.h"
#include "third_party/blink/renderer/core/workers/worklet.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
......@@ -67,4 +67,4 @@ class CORE_EXPORT LayoutWorklet : public Worklet,
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_LAYOUT_WORKLET_H_
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_LAYOUT_WORKLET_H_
......@@ -2,7 +2,7 @@
// 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/layout/custom/layout_worklet_global_scope.h"
#include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet_global_scope.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_function.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_layout_callback.h"
......@@ -15,9 +15,9 @@
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/inspector/main_thread_debugger.h"
#include "third_party/blink/renderer/core/layout/custom/css_layout_definition.h"
#include "third_party/blink/renderer/core/layout/custom/document_layout_definition.h"
#include "third_party/blink/renderer/core/layout/custom/layout_worklet.h"
#include "third_party/blink/renderer/core/layout/ng/custom/css_layout_definition.h"
#include "third_party/blink/renderer/core/layout/ng/custom/document_layout_definition.h"
#include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet.h"
#include "third_party/blink/renderer/core/origin_trials/origin_trial_context.h"
#include "third_party/blink/renderer/core/workers/global_scope_creation_params.h"
#include "third_party/blink/renderer/platform/bindings/callback_method_retriever.h"
......
......@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_LAYOUT_WORKLET_GLOBAL_SCOPE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_LAYOUT_WORKLET_GLOBAL_SCOPE_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_LAYOUT_WORKLET_GLOBAL_SCOPE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_LAYOUT_WORKLET_GLOBAL_SCOPE_H_
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/layout/custom/pending_layout_registry.h"
#include "third_party/blink/renderer/core/layout/ng/custom/pending_layout_registry.h"
#include "third_party/blink/renderer/core/workers/worklet_global_scope.h"
#include "third_party/blink/renderer/platform/wtf/casting.h"
......@@ -63,4 +63,4 @@ struct DowncastTraits<LayoutWorkletGlobalScope> {
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_LAYOUT_WORKLET_GLOBAL_SCOPE_H_
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_LAYOUT_WORKLET_GLOBAL_SCOPE_H_
......@@ -2,7 +2,7 @@
// 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/layout/custom/layout_worklet_global_scope_proxy.h"
#include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet_global_scope_proxy.h"
#include "third_party/blink/public/mojom/script/script_type.mojom-blink.h"
#include "third_party/blink/renderer/bindings/core/v8/script_source_code.h"
......
......@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_LAYOUT_WORKLET_GLOBAL_SCOPE_PROXY_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_LAYOUT_WORKLET_GLOBAL_SCOPE_PROXY_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_LAYOUT_WORKLET_GLOBAL_SCOPE_PROXY_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_LAYOUT_WORKLET_GLOBAL_SCOPE_PROXY_H_
#include "base/single_thread_task_runner.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/layout/custom/layout_worklet_global_scope.h"
#include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet_global_scope.h"
#include "third_party/blink/renderer/core/workers/main_thread_worklet_reporting_proxy.h"
#include "third_party/blink/renderer/core/workers/worklet_global_scope_proxy.h"
......@@ -55,4 +55,4 @@ class CORE_EXPORT LayoutWorkletGlobalScopeProxy
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_LAYOUT_WORKLET_GLOBAL_SCOPE_PROXY_H_
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_LAYOUT_WORKLET_GLOBAL_SCOPE_PROXY_H_
......@@ -2,7 +2,7 @@
// 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/layout/custom/layout_worklet.h"
#include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet.h"
#include <memory>
#include "testing/gtest/include/gtest/gtest.h"
......@@ -11,9 +11,9 @@
#include "third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/layout/custom/css_layout_definition.h"
#include "third_party/blink/renderer/core/layout/custom/layout_worklet_global_scope.h"
#include "third_party/blink/renderer/core/layout/custom/layout_worklet_global_scope_proxy.h"
#include "third_party/blink/renderer/core/layout/ng/custom/css_layout_definition.h"
#include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet_global_scope.h"
#include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet_global_scope_proxy.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"
namespace blink {
......
......@@ -7,11 +7,11 @@
#include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/layout/custom/custom_layout_fragment.h"
#include "third_party/blink/renderer/core/layout/custom/custom_layout_scope.h"
#include "third_party/blink/renderer/core/layout/custom/fragment_result_options.h"
#include "third_party/blink/renderer/core/layout/custom/layout_worklet.h"
#include "third_party/blink/renderer/core/layout/custom/layout_worklet_global_scope_proxy.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_fragment.h"
#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_scope.h"
#include "third_party/blink/renderer/core/layout/ng/custom/fragment_result_options.h"
#include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet.h"
#include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet_global_scope_proxy.h"
#include "third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.h"
#include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h"
#include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h"
......@@ -86,7 +86,7 @@ scoped_refptr<const NGLayoutResult> NGCustomLayoutAlgorithm::Layout() {
// TODO(ikilpatrick): Implement paint order. This should abort this loop,
// and go into a "slow" loop which allows developers to control the paint
// order of the children.
if (!child || child.GetLayoutBox() != fragment->GetLayoutBox()) {
if (!child || child != fragment->GetLayoutNode()) {
// TODO(ikilpatrick): Report this error to the developer.
return FallbackLayout();
}
......
......@@ -2,7 +2,7 @@
// 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/layout/custom/pending_layout_registry.h"
#include "third_party/blink/renderer/core/layout/ng/custom/pending_layout_registry.h"
#include "third_party/blink/renderer/core/css/style_change_reason.h"
#include "third_party/blink/renderer/core/dom/node.h"
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_PENDING_LAYOUT_REGISTRY_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_PENDING_LAYOUT_REGISTRY_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_PENDING_LAYOUT_REGISTRY_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_PENDING_LAYOUT_REGISTRY_H_
#include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
......@@ -43,4 +43,4 @@ class PendingLayoutRegistry : public GarbageCollected<PendingLayoutRegistry> {
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_PENDING_LAYOUT_REGISTRY_H_
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_PENDING_LAYOUT_REGISTRY_H_
......@@ -40,8 +40,8 @@
#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/layout/custom/layout_worklet.h"
#include "third_party/blink/renderer/core/layout/layout_theme.h"
#include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet.h"
#include "third_party/blink/renderer/core/layout/text_autosizer.h"
#include "third_party/blink/renderer/core/style/applied_text_decoration.h"
#include "third_party/blink/renderer/core/style/border_edge.h"
......
......@@ -11,6 +11,7 @@
#include "third_party/blink/renderer/bindings/core/v8/v8_gc_controller.h"
#include "third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.h"
#include "third_party/blink/renderer/core/css/css_syntax_definition.h"
#include "third_party/blink/renderer/core/css/cssom/prepopulated_computed_style_property_map.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment