Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge 4896: [block-in-inline] Fix when inserting inline in the middle…
… of blocks When inserting an inline child in the middle of blocks-in- inline, the |LayoutObject| tree must be adjusted. For example: ``` LayoutInline LayoutBlockFlow (anonymous) LayoutBlockFlow DIV LayoutBlockFlow DIV ``` should become: ``` LayoutInline LayoutBlockFlow (anonymous) LayoutBlockFlow DIV LayoutInline LayoutBlockFlow (anonymous) LayoutBlockFlow DIV ``` To do this, this patch moves |SplitAnonymousBoxesAroundChild| from |LayoutBox| to |LayoutBoxModelObject|, and changes it to work with |LayoutInline|. (cherry picked from commit 07d9345) Bug: 1301982 Change-Id: I680748159d50826f152b0bf6c46d11bb33563c40 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3499975 Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Original-Commit-Position: refs/heads/main@{#978136} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3507084 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Cr-Commit-Position: refs/branch-heads/4896@{#386} Cr-Branched-From: 1f63ff4-refs/heads/main@{#972766}
- Loading branch information
Showing
9 changed files
with
154 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...rty/blink/web_tests/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-019-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<body> | ||
<section> | ||
<div>1</div> | ||
<span>2</span> | ||
<div class="before">3</div> | ||
</section> | ||
<section> | ||
<span>2</span> | ||
<div class="before">3</div> | ||
<div>4</div> | ||
</section> | ||
<section style="columns: 1"> | ||
<div>1</div> | ||
<span>2</span> | ||
<div class="before">3</div> | ||
</section> | ||
</body> |
37 changes: 37 additions & 0 deletions
37
...d_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-019.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
<meta name="assert" content="Test inserting an inline child in the middle of blocks-in-inline"> | ||
<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level" /> | ||
<link rel="author" title="Koji Ishii" href="mailto:kojii@chromium.org" /> | ||
<body> | ||
<!-- Insert a span in the middle of blocks-in-inline --> | ||
<section> | ||
<span> | ||
<div>1</div> | ||
<div class="before">3</div> | ||
</span> | ||
</section> | ||
<!-- Insert a span before a block-in-inline --> | ||
<section> | ||
<span> | ||
<div class="before">3</div> | ||
<div>4</div> | ||
</span> | ||
</section> | ||
<!-- Check it works in multicol container --> | ||
<section style="columns: 1"> | ||
<span> | ||
<div>1</div> | ||
<div class="before">3</div> | ||
</span> | ||
</section> | ||
<script> | ||
(function () { | ||
document.body.offsetTop; | ||
for (const before of document.getElementsByClassName('before')) { | ||
const span = document.createElement('span'); | ||
span.textContent = '2'; | ||
before.before(span); | ||
} | ||
})(); | ||
</script> | ||
</body> |
15 changes: 15 additions & 0 deletions
15
...rty/blink/web_tests/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-020-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<body> | ||
<section> | ||
<div>1</div> | ||
<span>2</span> | ||
<div class="before" style="position: absolute">3</div> | ||
<div> </div> | ||
</section> | ||
<section> | ||
<div>1</div> | ||
<span>2</span> | ||
<div class="before" style="position: absolute">3</div> | ||
<div class="beforeoof"> </div> | ||
</section> | ||
</body> |
39 changes: 39 additions & 0 deletions
39
...d_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-020.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!DOCTYPE html> | ||
<meta name="assert" content="Test inserting an inline child before an OOF in blocks-in-inline"> | ||
<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level" /> | ||
<link rel="author" title="Koji Ishii" href="mailto:kojii@chromium.org" /> | ||
<body> | ||
<section> | ||
<span> | ||
<div>1</div> | ||
<div class="before" style="position: absolute">3</div> | ||
<div> </div> | ||
</span> | ||
</section> | ||
<!-- The OOF was inserted dynamically --> | ||
<section> | ||
<span> | ||
<div>1</div> | ||
<div class="beforeoof"> </div> | ||
</span> | ||
</section> | ||
<script> | ||
(function () { | ||
document.body.offsetTop; | ||
for (const before of document.getElementsByClassName('beforeoof')) { | ||
const oof = document.createElement('div'); | ||
oof.classList.add('before') | ||
oof.style.position = 'absolute'; | ||
oof.textContent = '3'; | ||
before.before(oof); | ||
} | ||
|
||
document.body.offsetTop; | ||
for (const before of document.getElementsByClassName('before')) { | ||
const span = document.createElement('span'); | ||
span.textContent = '2'; | ||
before.before(span); | ||
} | ||
})(); | ||
</script> | ||
</body> |