[webkit-changes] [WebKit/WebKit] 9ab136: [Cleanup] Remove RenderBox::hasOverridingLogicalWidth

Alan Baradlay noreply at github.com
Thu May 9 10:41:03 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9ab13687c0801c8e3ce57db96b9e7645a2a59b2b
      https://github.com/WebKit/WebKit/commit/9ab13687c0801c8e3ce57db96b9e7645a2a59b2b
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2024-05-09 (Thu, 09 May 2024)

  Changed paths:
    M Source/WebCore/rendering/AutoTableLayout.cpp
    M Source/WebCore/rendering/RenderBox.cpp
    M Source/WebCore/rendering/RenderBox.h
    M Source/WebCore/rendering/RenderBoxInlines.h
    M Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
    M Source/WebCore/rendering/RenderFlexibleBox.cpp
    M Source/WebCore/rendering/RenderReplaced.cpp
    M Source/WebCore/rendering/RenderTable.cpp

  Log Message:
  -----------
  [Cleanup] Remove RenderBox::hasOverridingLogicalWidth
https://bugs.webkit.org/show_bug.cgi?id=273887

Reviewed by Simon Fraser.

This patch eliminates a redundant hash lookup by
1. removing RenderBox:: hasOverridingLogicalWidth and
2. changing the return type of RenderBox::overridingLogicalWidth from LayoutUnit to std::optional<LayoutUnit>

so that the following (highly common) pattern
  if (hasOverridingLogicalWidth())
    ... + overridingLogicalWidth() + ...

can be turned into
  if (auto overridingLogicalWidth = this->overridingLogicalWidth())
    ... + *overridingLogicalWidth + ...

* Source/WebCore/rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::applyPreferredLogicalWidthQuirks const):
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::overridingLogicalWidth const):
(WebCore::RenderBox::computeLogicalWidthInFragment const):
(WebCore::RenderBox::hasOverridingLogicalWidth const): Deleted.
* Source/WebCore/rendering/RenderBox.h:
* Source/WebCore/rendering/RenderBoxInlines.h:
(WebCore::RenderBox::overridingContentLogicalHeight const):
(WebCore::RenderBox::overridingContentLogicalWidth const): Deleted.
* Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::widthForChild):
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::OverridingSizesScope::OverridingSizesScope):
* Source/WebCore/rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint):
* Source/WebCore/rendering/RenderTable.cpp:
(WebCore::RenderTable::updateLogicalWidth):
(WebCore::RenderTable::computePreferredLogicalWidths):

Canonical link: https://commits.webkit.org/278575@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list