First step at getting rid of anonymous blocks and continuations.

-Add RenderParagraph and display:paragraph. This is the only
render type that's allowed to contain inlines or text.
-If you put text nodes directly in a non-paragraph, wrap them
in an anonymous paragraph. This may not be the place we want
to end up, but it's a good stopgap to make it so we don't
crash in this case.
-Make StyleAdjuster force that non-paragraph blocks only contain
RenderBlock subclasses and that paragraphs and inlines only contain
inlines.
-Considerably simplify addChildIgnoringAnonymousColumnBlocks
now that we only create anonymous blocks for the case of
text nodes in non-paragraphs. Also get rid of the behavior
where we try to group multiple nodes into a single
anonymous block.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/729693003
This commit is contained in:
Ojan Vafai
2014-11-17 18:39:52 -08:00
parent 15336e278c
commit 8de17678c0
6 changed files with 75 additions and 34 deletions

View File

@@ -0,0 +1,13 @@
layer at (0,0) size 800x600
RenderView {#document} at (0,0) size 800x600
layer at (0,0) size 800x19
RenderBlock {sky} at (0,0) size 800x19
RenderBlock {div} at (0,0) size 800x19
RenderBlock {span} at (0,0) size 800x19
RenderBlock {div} at (0,0) size 25.22x19
RenderBlock (anonymous) at (0,0) size 25.22x19
RenderText {#text} at (0,0) size 26x19
text run at (0,0) width 26: "foo"
RenderText {#text} at (25,0) size 27x19
text run at (25,0) width 27: "bar"

View File

@@ -0,0 +1,4 @@
<sky>
<import src="../resources/dump-as-render-tree.sky" />
<div><span style="display: paragraph"><div>foo</div>bar</span></div>
</sky>

View File

@@ -19,6 +19,13 @@ body {
background-size: cover;
}
.line,
.link,
.name,
.photograph-credit {
display: paragraph;
}
.photograph-credit {
position: absolute;
right: 0;

View File

@@ -2,6 +2,7 @@ layer at (0,0) size 800x600
RenderView {#document} at (0,0) size 800x600
layer at (0,0) size 800x19
RenderBlock {foo} at (0,0) size 800x19
RenderText {#text} at (0,0) size 99x19
text run at (0,0) width 99: "Hello World!"
RenderBlock (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 99x19
text run at (0,0) width 99: "Hello World!"

View File

@@ -10,8 +10,9 @@ layer at (0,0) size 800x506
RenderText {#text} at (0,0) size 72x19
text run at (0,0) width 72: "element."
RenderBlock {div} at (0,228) size 800x200
RenderText {#text} at (0,0) size 99x19
text run at (0,0) width 99: "Placeholder."
RenderBlock (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 99x19
text run at (0,0) width 99: "Placeholder."
RenderBlock {div} at (0,428) size 800x78
RenderBlock (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 218x19

View File

@@ -5,48 +5,63 @@ layer at (0,0) size 800x400
layer at (0,0) size 800x400 scrollHeight 1500
RenderBlock {scroller} at (0,0) size 800x400
RenderBlock {div} at (0,0) size 800x100
RenderText {#text} at (0,0) size 10x19
text run at (0,0) width 10: "a"
RenderBlock (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 10x19
text run at (0,0) width 10: "a"
RenderBlock {div} at (0,100) size 800x100
RenderText {#text} at (0,0) size 11x19
text run at (0,0) width 11: "b"
RenderBlock (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 11x19
text run at (0,0) width 11: "b"
RenderBlock {div} at (0,200) size 800x100
RenderText {#text} at (0,0) size 9x19
text run at (0,0) width 9: "c"
RenderBlock (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 9x19
text run at (0,0) width 9: "c"
RenderBlock {div} at (0,300) size 800x100
RenderText {#text} at (0,0) size 11x19
text run at (0,0) width 11: "d"
RenderBlock (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 11x19
text run at (0,0) width 11: "d"
RenderBlock {div} at (0,400) size 800x100
RenderText {#text} at (0,0) size 10x19
text run at (0,0) width 10: "e"
RenderBlock (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 10x19
text run at (0,0) width 10: "e"
RenderBlock {div} at (0,500) size 800x100
RenderText {#text} at (0,0) size 6x19
text run at (0,0) width 6: "f"
RenderBlock (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 6x19
text run at (0,0) width 6: "f"
RenderBlock {div} at (0,600) size 800x100
RenderText {#text} at (0,0) size 11x19
text run at (0,0) width 11: "g"
RenderBlock (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 11x19
text run at (0,0) width 11: "g"
RenderBlock {div} at (0,700) size 800x100
RenderText {#text} at (0,0) size 11x19
text run at (0,0) width 11: "h"
RenderBlock (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 11x19
text run at (0,0) width 11: "h"
RenderBlock {div} at (0,800) size 800x100
RenderText {#text} at (0,0) size 5x19
text run at (0,0) width 5: "i"
RenderBlock (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 5x19
text run at (0,0) width 5: "i"
RenderBlock {div} at (0,900) size 800x100
RenderText {#text} at (0,0) size 5x19
text run at (0,0) width 5: "j"
RenderBlock (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 5x19
text run at (0,0) width 5: "j"
RenderBlock {div} at (0,1000) size 800x100
RenderText {#text} at (0,0) size 10x19
text run at (0,0) width 10: "k"
RenderBlock (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 10x19
text run at (0,0) width 10: "k"
RenderBlock {div} at (0,1100) size 800x100
RenderText {#text} at (0,0) size 5x19
text run at (0,0) width 5: "l"
RenderBlock (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 5x19
text run at (0,0) width 5: "l"
RenderBlock {div} at (0,1200) size 800x100
RenderText {#text} at (0,0) size 16x19
text run at (0,0) width 16: "m"
RenderBlock (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 16x19
text run at (0,0) width 16: "m"
RenderBlock {div} at (0,1300) size 800x100
RenderText {#text} at (0,0) size 11x19
text run at (0,0) width 11: "n"
RenderBlock (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 11x19
text run at (0,0) width 11: "n"
RenderBlock {div} at (0,1400) size 800x100
RenderText {#text} at (0,0) size 10x19
text run at (0,0) width 10: "o"
RenderBlock (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 10x19
text run at (0,0) width 10: "o"