Changeset 278194 in webkit


Ignore:
Timestamp:
May 28, 2021 4:35:54 AM (14 months ago)
Author:
commit-queue@webkit.org
Message:

Webkit doesn't calculate padding-top/-bottom in % correctly when parent has padding
https://bugs.webkit.org/show_bug.cgi?id=221202

Patch by Rob Buis <rbuis@igalia.com> on 2021-05-28
Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

Add test for this.

  • web-platform-tests/css/css-position/position-absolute-padding-percentage-expected.txt: Added.
  • web-platform-tests/css/css-position/position-absolute-padding-percentage.html: Added.

Source/WebCore:

Absolute positioned elements should resolve %-ge padding against containing block padding-edge:
https://drafts.csswg.org/css-position-3/#absolute-positioning-containing-block

Test: imported/w3c/web-platform-tests/css/css-position/position-absolute-padding-percentage.html

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::containingBlockLogicalWidthForContent const):

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r278193 r278194  
     12021-05-28  Rob Buis  <rbuis@igalia.com>
     2
     3        Webkit doesn't calculate padding-top/-bottom in % correctly when parent has padding
     4        https://bugs.webkit.org/show_bug.cgi?id=221202
     5
     6        Reviewed by Manuel Rego Casasnovas.
     7
     8        Add test for this.
     9
     10        * web-platform-tests/css/css-position/position-absolute-padding-percentage-expected.txt: Added.
     11        * web-platform-tests/css/css-position/position-absolute-padding-percentage.html: Added.
     12
    1132021-05-28  Martin Robinson  <mrobinson@webkit.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r278193 r278194  
     12021-05-28  Rob Buis  <rbuis@igalia.com>
     2
     3        Webkit doesn't calculate padding-top/-bottom in % correctly when parent has padding
     4        https://bugs.webkit.org/show_bug.cgi?id=221202
     5
     6        Reviewed by Manuel Rego Casasnovas.
     7
     8        Absolute positioned elements should resolve %-ge padding against containing block padding-edge:
     9        https://drafts.csswg.org/css-position-3/#absolute-positioning-containing-block
     10
     11        Test: imported/w3c/web-platform-tests/css/css-position/position-absolute-padding-percentage.html
     12
     13        * rendering/RenderBox.cpp:
     14        (WebCore::RenderBox::containingBlockLogicalWidthForContent const):
     15
    1162021-05-28  Martin Robinson  <mrobinson@webkit.org>
    217
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r278185 r278194  
    20462046        return overridingContainingBlockContentLogicalWidth().value_or(0_lu);
    20472047
    2048     if (RenderBlock* cb = containingBlock())
     2048    if (RenderBlock* cb = containingBlock()) {
     2049        if (isOutOfFlowPositioned())
     2050            return cb->clientLogicalWidth();
    20492051        return cb->availableLogicalWidth();
     2052    }
    20502053    return 0_lu;
    20512054}
Note: See TracChangeset for help on using the changeset viewer.