-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
LibWeb: Add synthetic height for contenteditable elements #6670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mikiubo
wants to merge
1
commit into
LadybirdBrowser:master
Choose a base branch
from
mikiubo:content_editable
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+89
−50
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
100 changes: 50 additions & 50 deletions
100
Tests/LibWeb/Layout/expected/empty-editable-shows-cursor.txt
This file contains hidden or 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 |
|---|---|---|
| @@ -1,86 +1,86 @@ | ||
| Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] children: not-inline | ||
| BlockContainer <html> at [0,0] [0+0+0 800 0+0+0] [0+0+0 52 0+0+0] [BFC] children: not-inline | ||
| BlockContainer <html> at [0,0] [0+0+0 800 0+0+0] [0+0+0 70 0+0+0] [BFC] children: not-inline | ||
| BlockContainer <(anonymous)> at [0,0] [0+0+0 800 0+0+0] [0+0+0 0 0+0+0] children: inline | ||
| TextNode <#text> (not painted) | ||
| BlockContainer <body> at [8,8] [8+0+0 784 0+0+8] [8+0+0 36 0+0+8] children: not-inline | ||
| BlockContainer <body> at [8,8] [8+0+0 784 0+0+8] [8+0+0 54 0+0+8] children: not-inline | ||
| BlockContainer <(anonymous)> at [8,8] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline | ||
| TextNode <#text> (not painted) | ||
| BlockContainer <div> at [8,8] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: not-inline | ||
| BlockContainer <(anonymous)> at [8,8] [0+0+0 784 0+0+0] [0+0+0 36 0+0+0] children: inline | ||
| frag 0 from BlockContainer start: 0, length: 0, rect: [9,9 200x20] baseline: 14.796875 | ||
| frag 1 from TextNode start: 0, length: 1, rect: [210,9 8x18] baseline: 13.796875 | ||
| BlockContainer <div> at [8,8] [0+0+0 784 0+0+0] [0+0+0 18 0+0+0] children: not-inline | ||
| BlockContainer <(anonymous)> at [8,26] [0+0+0 784 0+0+0] [0+0+0 36 0+0+0] children: inline | ||
| frag 0 from BlockContainer start: 0, length: 0, rect: [9,27 200x20] baseline: 14.796875 | ||
| frag 1 from TextNode start: 0, length: 1, rect: [210,27 8x18] baseline: 13.796875 | ||
| " " | ||
| frag 2 from BlockContainer start: 0, length: 0, rect: [221,11 160x30] baseline: 14.390625 | ||
| frag 3 from TextNode start: 0, length: 1, rect: [384,9 8x18] baseline: 13.796875 | ||
| frag 2 from BlockContainer start: 0, length: 0, rect: [221,29 160x30] baseline: 14.390625 | ||
| frag 3 from TextNode start: 0, length: 1, rect: [384,27 8x18] baseline: 13.796875 | ||
| " " | ||
| frag 4 from BlockContainer start: 0, length: 0, rect: [393,9 200x20] baseline: 14.796875 | ||
| frag 5 from TextNode start: 0, length: 1, rect: [594,9 8x18] baseline: 13.796875 | ||
| frag 4 from BlockContainer start: 0, length: 0, rect: [393,27 200x20] baseline: 14.796875 | ||
| frag 5 from TextNode start: 0, length: 1, rect: [594,27 8x18] baseline: 13.796875 | ||
| " " | ||
| frag 6 from BlockContainer start: 0, length: 0, rect: [605,11 160x30] baseline: 14.390625 | ||
| frag 6 from BlockContainer start: 0, length: 0, rect: [605,29 160x30] baseline: 14.390625 | ||
| TextNode <#text> (not painted) | ||
| BlockContainer <input> at [9,9] inline-block [0+1+0 200 0+1+0] [0+1+0 20 0+1+0] [BFC] children: not-inline | ||
| Box <div> at [11,10] flex-container(row) [0+0+2 196 2+0+0] [0+0+1 18 1+0+0] [FFC] children: not-inline | ||
| BlockContainer <div> at [11,10] flex-item [0+0+0 0 0+0+0] [0+0+0 18 0+0+0] [BFC] children: inline | ||
| frag 0 from TextNode start: 0, length: 0, rect: [11,10 0x18] baseline: 13.796875 | ||
| BlockContainer <input> at [9,27] inline-block [0+1+0 200 0+1+0] [0+1+0 20 0+1+0] [BFC] children: not-inline | ||
| Box <div> at [11,28] flex-container(row) [0+0+2 196 2+0+0] [0+0+1 18 1+0+0] [FFC] children: not-inline | ||
| BlockContainer <div> at [11,28] flex-item [0+0+0 0 0+0+0] [0+0+0 18 0+0+0] [BFC] children: inline | ||
| frag 0 from TextNode start: 0, length: 0, rect: [11,28 0x18] baseline: 13.796875 | ||
| TextNode <#text> (not painted) | ||
| BlockContainer <div> at [11,10] flex-item [0+0+0 196 0+0+0] [0+0+0 18 0+0+0] [BFC] children: inline | ||
| frag 0 from TextNode start: 0, length: 5, rect: [11,10 36.84375x18] baseline: 13.796875 | ||
| BlockContainer <div> at [11,28] flex-item [0+0+0 196 0+0+0] [0+0+0 18 0+0+0] [BFC] children: inline | ||
| frag 0 from TextNode start: 0, length: 5, rect: [11,28 36.84375x18] baseline: 13.796875 | ||
| "hello" | ||
| TextNode <#text> (not painted) | ||
| TextNode <#text> (not painted) | ||
| BlockContainer <textarea> at [221,11] inline-block [0+1+2 160 2+1+0] [0+1+2 30 2+1+0] [BFC] children: not-inline | ||
| BlockContainer <div> at [221,11] [0+0+0 160 0+0+0] [0+0+0 15 0+0+0] children: inline | ||
| InlineNode <div> at [221,11] [0+0+0 0 0+0+0] [0+0+0 15 0+0+0] | ||
| frag 0 from TextNode start: 0, length: 0, rect: [221,11 0x15] baseline: 11.390625 | ||
| BlockContainer <textarea> at [221,29] inline-block [0+1+2 160 2+1+0] [0+1+2 30 2+1+0] [BFC] children: not-inline | ||
| BlockContainer <div> at [221,29] [0+0+0 160 0+0+0] [0+0+0 15 0+0+0] children: inline | ||
| InlineNode <div> at [221,29] [0+0+0 0 0+0+0] [0+0+0 15 0+0+0] | ||
| frag 0 from TextNode start: 0, length: 0, rect: [221,29 0x15] baseline: 11.390625 | ||
| TextNode <#text> (not painted) | ||
| InlineNode <div> at [221,11] [0+0+0 29.921875 0+0+0] [0+0+0 15 0+0+0] | ||
| frag 0 from TextNode start: 0, length: 5, rect: [221,11 29.921875x15] baseline: 11.390625 | ||
| InlineNode <div> at [221,29] [0+0+0 29.921875 0+0+0] [0+0+0 15 0+0+0] | ||
| frag 0 from TextNode start: 0, length: 5, rect: [221,29 29.921875x15] baseline: 11.390625 | ||
| "hello" | ||
| TextNode <#text> (not painted) | ||
| TextNode <#text> (not painted) | ||
| BlockContainer <input> at [393,9] inline-block [0+1+0 200 0+1+0] [0+1+0 20 0+1+0] [BFC] children: not-inline | ||
| Box <div> at [395,10] flex-container(row) [0+0+2 196 2+0+0] [0+0+1 18 1+0+0] [FFC] children: not-inline | ||
| BlockContainer <div> at [395,10] flex-item [0+0+0 196 0+0+0] [0+0+0 18 0+0+0] [BFC] children: inline | ||
| frag 0 from TextNode start: 0, length: 0, rect: [395,10 0x18] baseline: 13.796875 | ||
| BlockContainer <input> at [393,27] inline-block [0+1+0 200 0+1+0] [0+1+0 20 0+1+0] [BFC] children: not-inline | ||
| Box <div> at [395,28] flex-container(row) [0+0+2 196 2+0+0] [0+0+1 18 1+0+0] [FFC] children: not-inline | ||
| BlockContainer <div> at [395,28] flex-item [0+0+0 196 0+0+0] [0+0+0 18 0+0+0] [BFC] children: inline | ||
| frag 0 from TextNode start: 0, length: 0, rect: [395,28 0x18] baseline: 13.796875 | ||
| TextNode <#text> (not painted) | ||
| TextNode <#text> (not painted) | ||
| BlockContainer <textarea> at [605,11] inline-block [0+1+2 160 2+1+0] [0+1+2 30 2+1+0] [BFC] children: not-inline | ||
| BlockContainer <div> at [605,11] [0+0+0 160 0+0+0] [0+0+0 15 0+0+0] children: not-inline | ||
| BlockContainer <div> at [605,11] [0+0+0 160 0+0+0] [0+0+0 15 0+0+0] children: inline | ||
| frag 0 from TextNode start: 0, length: 0, rect: [605,11 0x15] baseline: 11.390625 | ||
| BlockContainer <textarea> at [605,29] inline-block [0+1+2 160 2+1+0] [0+1+2 30 2+1+0] [BFC] children: not-inline | ||
| BlockContainer <div> at [605,29] [0+0+0 160 0+0+0] [0+0+0 15 0+0+0] children: not-inline | ||
| BlockContainer <div> at [605,29] [0+0+0 160 0+0+0] [0+0+0 15 0+0+0] children: inline | ||
| frag 0 from TextNode start: 0, length: 0, rect: [605,29 0x15] baseline: 11.390625 | ||
| TextNode <#text> (not painted) | ||
| TextNode <#text> (not painted) | ||
|
|
||
| ViewportPaintable (Viewport<#document>) [0,0 800x600] | ||
| PaintableWithLines (BlockContainer<HTML>) [0,0 800x52] | ||
| PaintableWithLines (BlockContainer<HTML>) [0,0 800x70] | ||
| PaintableWithLines (BlockContainer(anonymous)) [0,0 800x0] | ||
| PaintableWithLines (BlockContainer<BODY>) [8,8 784x36] | ||
| PaintableWithLines (BlockContainer<BODY>) [8,8 784x54] | ||
| PaintableWithLines (BlockContainer(anonymous)) [8,8 784x0] | ||
| PaintableWithLines (BlockContainer<DIV>) [8,8 784x0] | ||
| PaintableWithLines (BlockContainer(anonymous)) [8,8 784x36] | ||
| PaintableWithLines (BlockContainer<INPUT>) [8,8 202x22] | ||
| PaintableBox (Box<DIV>) [9,9 200x20] | ||
| PaintableWithLines (BlockContainer<DIV>) [11,10 0x18] | ||
| PaintableWithLines (BlockContainer<DIV>) [8,8 784x18] | ||
| PaintableWithLines (BlockContainer(anonymous)) [8,26 784x36] | ||
| PaintableWithLines (BlockContainer<INPUT>) [8,26 202x22] | ||
| PaintableBox (Box<DIV>) [9,27 200x20] | ||
| PaintableWithLines (BlockContainer<DIV>) [11,28 0x18] | ||
| TextPaintable (TextNode<#text>) | ||
| PaintableWithLines (BlockContainer<DIV>) [11,10 196x18] | ||
| PaintableWithLines (BlockContainer<DIV>) [11,28 196x18] | ||
| TextPaintable (TextNode<#text>) | ||
| TextPaintable (TextNode<#text>) | ||
| PaintableWithLines (BlockContainer<TEXTAREA>) [218,8 166x36] | ||
| PaintableWithLines (BlockContainer<DIV>) [221,11 160x15] | ||
| PaintableWithLines (InlineNode<DIV>) [221,11 0x15] | ||
| PaintableWithLines (BlockContainer<TEXTAREA>) [218,26 166x36] | ||
| PaintableWithLines (BlockContainer<DIV>) [221,29 160x15] | ||
| PaintableWithLines (InlineNode<DIV>) [221,29 0x15] | ||
| TextPaintable (TextNode<#text>) | ||
| PaintableWithLines (InlineNode<DIV>) [221,11 29.921875x15] | ||
| PaintableWithLines (InlineNode<DIV>) [221,29 29.921875x15] | ||
| TextPaintable (TextNode<#text>) | ||
| TextPaintable (TextNode<#text>) | ||
| PaintableWithLines (BlockContainer<INPUT>) [392,8 202x22] | ||
| PaintableBox (Box<DIV>) [393,9 200x20] | ||
| PaintableWithLines (BlockContainer<DIV>) [395,10 196x18] | ||
| PaintableWithLines (BlockContainer<INPUT>) [392,26 202x22] | ||
| PaintableBox (Box<DIV>) [393,27 200x20] | ||
| PaintableWithLines (BlockContainer<DIV>) [395,28 196x18] | ||
| TextPaintable (TextNode<#text>) | ||
| TextPaintable (TextNode<#text>) | ||
| PaintableWithLines (BlockContainer<TEXTAREA>) [602,8 166x36] | ||
| PaintableWithLines (BlockContainer<DIV>) [605,11 160x15] | ||
| PaintableWithLines (BlockContainer<DIV>) [605,11 160x15] | ||
| PaintableWithLines (BlockContainer<TEXTAREA>) [602,26 166x36] | ||
| PaintableWithLines (BlockContainer<DIV>) [605,29 160x15] | ||
| PaintableWithLines (BlockContainer<DIV>) [605,29 160x15] | ||
| TextPaintable (TextNode<#text>) | ||
|
|
||
| SC for Viewport<#document> [0,0 800x600] [children: 1] (z-index: auto) | ||
| SC for BlockContainer<HTML> [0,0 800x52] [children: 0] (z-index: auto) | ||
| SC for BlockContainer<HTML> [0,0 800x70] [children: 0] (z-index: auto) |
9 changes: 9 additions & 0 deletions
9
Tests/LibWeb/Ref/expected/wpt-import/contenteditable/synthetic-height-ref.html
This file contains hidden or 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,9 @@ | ||
| <!doctype html> | ||
| <title>CSS test reference</title> | ||
| <style> | ||
| div { background: green; border: 1px solid; } | ||
| </style> | ||
| <div><br></div> | ||
| <div><br></div> | ||
| <div><br></div> | ||
| <div><br></div> |
21 changes: 21 additions & 0 deletions
21
Tests/LibWeb/Ref/input/wpt-import/contenteditable/synthetic-height.html
This file contains hidden or 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,21 @@ | ||
| <!doctype html> | ||
| <title>contenteditable causes blocks to have a synthesized height</title> | ||
| <link rel="author" href="mailto:[email protected]" title="Emilio Cobos Álvarez"> | ||
| <link rel="author" href="https://mozilla.org" title="Mozilla"> | ||
| <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1098151"> | ||
| <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1634543"> | ||
| <link rel="help" href="https://github.com/w3c/editing/issues/70"> | ||
| <link rel="match" href="../../../expected/wpt-import/contenteditable/synthetic-height-ref.html"> | ||
| <style> | ||
| div { background: green; border: 1px solid; } | ||
| .pseudo::before { | ||
| content: ""; | ||
| } | ||
| .abspos-pseudo::before { | ||
| position: absolute; | ||
| } | ||
| </style> | ||
| <div contenteditable></div> | ||
| <div contenteditable><span style="position: absolute"></span></div> | ||
| <div contenteditable class="pseudo"></div> | ||
| <div contenteditable class="pseudo abspos-pseudo"></div> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.