Skip to content

Commit

Permalink
Remove InlineFormattingContextIntegrationEnabled setting
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=271052

Reviewed by Antti Koivisto.

Legacy inline layout is no longer functional.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForLineLayout):
(WebCore::LayoutIntegration::canUseForChild): Deleted.
(WebCore::LayoutIntegration::canUseForLineLayoutWithReason): Deleted.
* Source/WebCore/layout/integration/LayoutIntegrationCoverage.h:
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::canUseFor):
(WebCore::LayoutIntegration::LineLayout::canUseForPreferredWidthComputation):
(WebCore::LayoutIntegration::LineLayout::shouldInvalidateLineLayoutPathAfterContentChange):
(WebCore::LayoutIntegration::LineLayout::shouldInvalidateLineLayoutPathAfterTreeMutation):
(WebCore::LayoutIntegration::LineLayout::releaseCaches):
(WebCore::LayoutIntegration::LineLayout::isEnabled): Deleted.
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.h:

Canonical link: https://commits.webkit.org/276157@main
  • Loading branch information
alanbaradlay committed Mar 15, 2024
1 parent 6518b4a commit 6bdbfc3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 82 deletions.
14 changes: 0 additions & 14 deletions Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3352,20 +3352,6 @@ IndexedDBAPIEnabled:
WebCore:
default: true

InlineFormattingContextIntegrationEnabled:
type: bool
status: stable
category: css
humanReadableName: "Next-generation inline layout (IFC)"
humanReadableDescription: "Enable next-generation inline layout (IFC)"
defaultValue:
WebKitLegacy:
default: true
WebKit:
default: true
WebCore:
default: true

InlineMediaPlaybackRequiresPlaysInlineAttribute:
type: bool
status: embedder
Expand Down
53 changes: 5 additions & 48 deletions Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,62 +53,19 @@
namespace WebCore {
namespace LayoutIntegration {

static std::optional<AvoidanceReason> canUseForChild(const RenderObject& child)
{
if (is<RenderText>(child)) {
if (child.isRenderSVGInlineText())
return AvoidanceReason::ContentIsSVG;
return { };
}

if (is<RenderLineBreak>(child))
return { };

auto& renderer = downcast<RenderElement>(child);
if (is<RenderBlockFlow>(renderer)
|| is<RenderGrid>(renderer)
|| is<RenderFrameSet>(renderer)
|| is<RenderFlexibleBox>(renderer)
|| is<RenderDeprecatedFlexibleBox>(renderer)
|| is<RenderReplaced>(renderer)
|| is<RenderListItem>(renderer)
|| is<RenderTable>(renderer)
#if ENABLE(MATHML)
|| is<RenderMathMLBlock>(renderer)
#endif
|| is<RenderListMarker>(renderer))
return { };

if (is<RenderInline>(renderer)) {
if (renderer.isRenderSVGInline())
return AvoidanceReason::ContentIsSVG;
return { };
}

ASSERT_NOT_REACHED();
return { };
}

static std::optional<AvoidanceReason> canUseForLineLayoutWithReason(const RenderBlockFlow& flow)
bool canUseForLineLayout(const RenderBlockFlow& flow)
{
if (!flow.document().settings().inlineFormattingContextIntegrationEnabled())
return AvoidanceReason::FeatureIsDisabled;
if (!flow.firstChild()) {
// Non-SVG code does not call into layoutInlineChildren with no children anymore.
ASSERT(is<RenderSVGBlock>(flow));
return AvoidanceReason::ContentIsSVG;
return false;
}
for (auto walker = InlineWalker(flow); !walker.atEnd(); walker.advance()) {
auto& child = *walker.current();
if (auto childReason = canUseForChild(child))
return *childReason;
if (child.isRenderSVGInlineText() || child.isRenderSVGInline())
return false;
}
return { };
}

bool canUseForLineLayout(const RenderBlockFlow& flow)
{
return !canUseForLineLayoutWithReason(flow);
return true;
}

bool canUseForPreferredWidthComputation(const RenderBlockFlow& blockContainer)
Expand Down
5 changes: 0 additions & 5 deletions Source/WebCore/layout/integration/LayoutIntegrationCoverage.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ class RenderObject;
namespace LayoutIntegration {
class LineLayout;

enum class AvoidanceReason : uint8_t {
ContentIsSVG,
FeatureIsDisabled
};

bool canUseForLineLayout(const RenderBlockFlow&);
bool canUseForPreferredWidthComputation(const RenderBlockFlow&);
enum class TypeOfChangeForInvalidation : uint8_t {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,34 +204,23 @@ const LineLayout* LineLayout::containing(const RenderObject& renderer)
return containing(const_cast<RenderObject&>(renderer));
}

bool LineLayout::isEnabled(const Document& document)
{
return document.settings().inlineFormattingContextIntegrationEnabled();
}

bool LineLayout::canUseFor(const RenderBlockFlow& flow)
{
if (!isEnabled(flow.document()))
return false;

return canUseForLineLayout(flow);
}

bool LineLayout::canUseForPreferredWidthComputation(const RenderBlockFlow& flow)
{
ASSERT(isEnabled(flow.document()));
return LayoutIntegration::canUseForPreferredWidthComputation(flow);
}

bool LineLayout::shouldInvalidateLineLayoutPathAfterContentChange(const RenderBlockFlow& parent, const RenderObject& rendererWithNewContent, const LineLayout& lineLayout)
{
ASSERT(isEnabled(parent.document()));
return shouldInvalidateLineLayoutPathAfterChangeFor(parent, rendererWithNewContent, lineLayout, TypeOfChangeForInvalidation::NodeMutation);
}

bool LineLayout::shouldInvalidateLineLayoutPathAfterTreeMutation(const RenderBlockFlow& parent, const RenderObject& renderer, const LineLayout& lineLayout, bool isRemoval)
{
ASSERT(isEnabled(parent.document()));
return shouldInvalidateLineLayoutPathAfterChangeFor(parent, renderer, lineLayout, isRemoval ? TypeOfChangeForInvalidation::NodeRemoval : TypeOfChangeForInvalidation::NodeInsertion);
}

Expand Down Expand Up @@ -1113,9 +1102,6 @@ bool LineLayout::updateTextContent(const RenderText& textRenderer, size_t offset

void LineLayout::releaseCaches(RenderView& view)
{
if (!isEnabled(view.document()))
return;

for (auto& renderer : descendantsOfType<RenderBlockFlow>(view)) {
if (auto* lineLayout = renderer.modernLineLayout())
lineLayout->releaseCaches();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class LineLayout : public CanMakeCheckedPtr {
static LineLayout* containing(RenderObject&);
static const LineLayout* containing(const RenderObject&);

static bool isEnabled(const Document&);
static bool canUseFor(const RenderBlockFlow&);
static bool canUseForPreferredWidthComputation(const RenderBlockFlow&);
static bool shouldInvalidateLineLayoutPathAfterContentChange(const RenderBlockFlow& parent, const RenderObject& rendererWithNewContent, const LineLayout&);
Expand Down

0 comments on commit 6bdbfc3

Please sign in to comment.