Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Table cells, rows, sections or column (groups) don't support margins
Table cells, rows, sections or column (groups) don't support margins
https://bugs.webkit.org/show_bug.cgi?id=251100
rdar://problem/104876500

Reviewed by Alan Baradlay.

Merge - https://src.chromium.org/viewvc/blink?revision=197770&view=revision

This patch removes FIXME related 'if' clause and replaces with ASSERT in RenderBox.cpp and also
remove computation for margins on table since table does not support margins from layout function.

* Source/WebCore/rendering/RenderTableRow.cpp:
(RenderTableRow::layout): Remove 'computeAndSetBlockDirectionMargins' since table does not support margins
* Source/WebCore/rendering/RenderBox.cpp:
(RenderBox::availableLogicalHeightUsing): Remove FIXME and related code and change with ASSERT

Canonical link: https://commits.webkit.org/259955@main
  • Loading branch information
Ahmad-S792 authored and Ahmad Saleem committed Feb 7, 2023
1 parent f96ecde commit 2c73302
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
15 changes: 7 additions & 8 deletions Source/WebCore/rendering/RenderBox.cpp
Expand Up @@ -3,7 +3,8 @@
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
* (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
* Copyright (C) 2005-2010, 2015 Apple Inc. All rights reserved.
* Copyright (C) 2005-2023 Apple Inc. All rights reserved.
* Copyright (C) 2015 Google Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
Expand Down Expand Up @@ -3688,13 +3689,11 @@ LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h, AvailableLogi

void RenderBox::computeBlockDirectionMargins(const RenderBlock& containingBlock, LayoutUnit& marginBefore, LayoutUnit& marginAfter) const
{
if (isTableCell()) {
// FIXME: Not right if we allow cells to have different directionality than the table. If we do allow this, though,
// we may just do it with an extra anonymous block inside the cell.
marginBefore = 0;
marginAfter = 0;
return;
}
// First assert that we're not calling this method on box types that don't support margins.
ASSERT(!isTableCell());
ASSERT(!isTableRow());
ASSERT(!isTableSection());
ASSERT(!isRenderTableCol());

// Margins are calculated with respect to the logical width of
// the containing block (8.3)
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/rendering/RenderTableRow.cpp
Expand Up @@ -4,7 +4,8 @@
* (C) 1998 Waldo Bastian (bastian@kde.org)
* (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2003-2023 Apple Inc. All rights reserved.
* Copyright (C) 2015 Google Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
Expand Down Expand Up @@ -148,7 +149,6 @@ void RenderTableRow::layout()
cell->setChildNeedsLayout(MarkOnlyThis);

if (cell->needsLayout()) {
cell->computeAndSetBlockDirectionMargins(*table());
cell->layout();
}
}
Expand Down

0 comments on commit 2c73302

Please sign in to comment.