Skip to content

Commit

Permalink
Resolve text-indent percentages to 0 for intrinsic sizing.
Browse files Browse the repository at this point in the history
Percentages must be ignored when calculating min/max intrinsic /
preferred inline sizes, since the inline size is by definition unknown
at that point.

This fixes the problem both in the legacy engine and in LayoutNG.

Bug: 906663
Change-Id: Ib29a66ee3d6146e72e6f9ec3283293af48e633a0
Reviewed-on: https://chromium-review.googlesource.com/c/1344090
Reviewed-by: Koji Ishii <[email protected]>
Reviewed-by: Christian Biesinger <[email protected]>
Commit-Queue: Morten Stenshorne <[email protected]>
Cr-Commit-Position: refs/heads/master@{#609734}
  • Loading branch information
mstensho authored and chromium-wpt-export-bot committed Nov 20, 2018
1 parent 99e9e99 commit 1f7b7e4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions css/css-text/text-indent/percentage-value-intrinsic-size.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="[email protected]">
<link rel="help" href="https://www.w3.org/TR/css-text-3/#text-indent-property">
<meta name="assert" content="Percentages should be ignored when calculating min/max intrinsic sizes.">
<p>Test passes if there is a filled green square.</p>
<div id="container" data-expected-width="50" style="position:relative; float:left; height:100px; background:green;">
<div id="foo">
<div data-offset-x="50" data-expected-width="50" style="display:inline-block; width:50px; height:100px; background:green;"></div>
<div style="width:50px;"></div>
</div>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script>
document.body.offsetTop;
foo.style.textIndent = "100%";
checkLayout("#container");
</script>

0 comments on commit 1f7b7e4

Please sign in to comment.