Commit 99473049 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Fieldset NG: Fix inline offsets of children in RTL

NGFieldsetLayoutAlgorithm::CreateConstraintSpaceFor*() should set
TextDirection.

Bug: 1130174
Change-Id: I2f763c5b24b22f1ebe836f6a7a548a63577184e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2422059
Commit-Queue: Kent Tamura <tkent@chromium.org>
Auto-Submit: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809152}
parent b697fd00
...@@ -418,6 +418,7 @@ NGFieldsetLayoutAlgorithm::CreateConstraintSpaceForFieldsetContent( ...@@ -418,6 +418,7 @@ NGFieldsetLayoutAlgorithm::CreateConstraintSpaceForFieldsetContent(
NGConstraintSpaceBuilder builder(ConstraintSpace(), NGConstraintSpaceBuilder builder(ConstraintSpace(),
ConstraintSpace().GetWritingMode(), ConstraintSpace().GetWritingMode(),
/* is_new_fc */ true); /* is_new_fc */ true);
builder.SetTextDirection(fieldset_content.Style().Direction());
builder.SetAvailableSize(padding_box_size); builder.SetAvailableSize(padding_box_size);
builder.SetPercentageResolutionSize( builder.SetPercentageResolutionSize(
ConstraintSpace().PercentageResolutionSize()); ConstraintSpace().PercentageResolutionSize());
......
<!DOCTYPE html>
<html dir="rtl">
<head>
<meta charset="utf-8">
<style>
.control {
background: blue;
width: 200px;
height: 1em;
}
.container {
border: 2px groove ThreeDFace;
margin: 0;
padding: 1em;
}
</style>
</head>
<body>
<div class="container">
<label>Label</label>
<div class="control" id="ctrl-d"></div>
</div>
</body>
</html>
<!DOCTYPE html>
<html dir="rtl">
<head>
<meta charset="utf-8">
<title>crbug.com/1130174; Non-auto-width block should be right-aligned in an RTL fieldset</title>
<link rel="match" href="fieldset-content-rtl-ref.html">
<style>
.control {
background: blue;
width: 200px;
height: 1em;
}
fieldset {
border: 2px groove ThreeDFace;
margin: 0;
padding: 1em;
}
</style>
</head>
<body>
<fieldset>
<label>Label</label>
<div class="control"></div>
</fieldset>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment