Remove the concept of document.documentElement

Now documents can have many element children, all created equal.

R=esprehn@chromium.org, ojan@chromium.org

Review URL: https://codereview.chromium.org/928393003
This commit is contained in:
Adam Barth
2015-02-17 16:20:07 -08:00
parent 04cd457d91
commit 576f0eb04a
12 changed files with 73 additions and 83 deletions

View File

@@ -1,10 +1,9 @@
layer at (0,0) size 800x600
RenderView {#document} at (0,0) size 800x600
layer at (0,0) size 800x238
RenderBlock {sky} at (0,0) size 800x238
RenderParagraph (anonymous) at (0,0) size 800x38
RenderText {#text} at (0,0) size 778x38
text run at (0,0) width 778: "Test passes if the image below shows nested green, blue and yellow squares with a dotted black"
text run at (0,19) width 59: "border."
RenderBlock {div} at (0,38) size 200x200 [border: (25px dotted #000000)]
RenderBlock {sky} at (0,0) size 800x238
RenderParagraph (anonymous) at (0,0) size 800x38
RenderText {#text} at (0,0) size 778x38
text run at (0,0) width 778: "Test passes if the image below shows nested green, blue and yellow squares with a dotted black"
text run at (0,19) width 59: "border."
RenderBlock {div} at (0,38) size 200x200 [border: (25px dotted #000000)]

View File

@@ -1,24 +1,23 @@
layer at (0,0) size 800x600
RenderView {#document} at (0,0) size 800x600
layer at (0,0) size 800x353
RenderBlock {sky} at (0,0) size 800x353
RenderBlock {h3} at (0,0) size 800x19
RenderParagraph (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 92x19
text run at (0,0) width 92: "It passes if:"
RenderBlock {ul} at (0,19) size 800x57
RenderBlock {li} at (0,0) size 800x19
RenderBlock {sky} at (0,0) size 800x353
RenderBlock {h3} at (0,0) size 800x19
RenderParagraph (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 511x19
text run at (0,0) width 511: "the canvas content has rounded corners (top-left and top-right)"
RenderBlock {li} at (0,19) size 800x19
RenderParagraph (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 457x19
text run at (0,0) width 457: "the 10px red border is visible around the canvas content"
RenderBlock {li} at (0,38) size 800x19
RenderParagraph (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 200x19
text run at (0,0) width 200: "gray border is not visible"
RenderText {#text} at (0,0) size 92x19
text run at (0,0) width 92: "It passes if:"
RenderBlock {ul} at (0,19) size 800x57
RenderBlock {li} at (0,0) size 800x19
RenderParagraph (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 511x19
text run at (0,0) width 511: "the canvas content has rounded corners (top-left and top-right)"
RenderBlock {li} at (0,19) size 800x19
RenderParagraph (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 457x19
text run at (0,0) width 457: "the 10px red border is visible around the canvas content"
RenderBlock {li} at (0,38) size 800x19
RenderParagraph (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 200x19
text run at (0,0) width 200: "gray border is not visible"
layer at (0,76) size 277x277
RenderHTMLCanvas {canvas} at (0,76) size 277x277 [bgcolor=#808080] [border: (10px solid #FF0000)]

View File

@@ -1,13 +1,12 @@
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
RenderParagraph {span} at (0,0) size 800x19
RenderBlock (inline-block) {div} at (0,0) size 25.22x19
RenderParagraph (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"
RenderBlock {sky} at (0,0) size 800x19
RenderBlock {div} at (0,0) size 800x19
RenderParagraph {span} at (0,0) size 800x19
RenderBlock (inline-block) {div} at (0,0) size 25.22x19
RenderParagraph (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

@@ -1,7 +1,6 @@
layer at (0,0) size 800x600
RenderView {#document} at (0,0) size 800x600
layer at (0,0) size 800x94
RenderBlock {sky} at (0,0) size 800x94
RenderBlock {sky} at (0,0) size 800x94
layer at (0,0) size 56x69 clip at (3,3) size 50x63
RenderBlock {div} at (0,0) size 56x69 [border: (3px solid #0000FF)]
RenderParagraph (anonymous) at (3,3) size 50x19

View File

@@ -1,6 +1,5 @@
layer at (0,0) size 800x600
RenderView {#document} at (0,0) size 800x600
layer at (0,0) size 800x50
RenderBlock {sky} at (0,0) size 800x50
RenderBlock {div} at (0,0) size 50x50 [bgcolor=#FFC0CB]
RenderBlock {sky} at (0,0) size 800x50
RenderBlock {div} at (0,0) size 50x50 [bgcolor=#FFC0CB]

View File

@@ -9,7 +9,7 @@ void main () {
initUnit();
test('should have various casing', () {
expect(document.documentElement.tagName, equals('CamelCase'));
expect(document.firstElementChild.tagName, equals('CamelCase'));
var element = document.createElement('CamelCase');
expect(element.tagName, equals('CamelCase'));

View File

@@ -1,8 +1,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
RenderParagraph (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 99x19
text run at (0,0) width 99: "Hello World!"
RenderBlock {foo} at (0,0) size 800x19
RenderParagraph (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 99x19
text run at (0,0) width 99: "Hello World!"

View File

@@ -1,13 +1,12 @@
layer at (0,0) size 800x600
RenderView {#document} at (0,0) size 800x600
layer at (0,0) size 800x137
RenderBlock {div} at (0,0) size 800x137
RenderBlock {div} at (32,32) size 736x38
RenderParagraph (anonymous) at (0,0) size 736x38
RenderText {#text} at (0,0) size 191x38
text run at (0,0) width 191: "about:blank"
RenderBlock {div} at (16,110) size 768x19 [color=#BCD8F5]
RenderParagraph (anonymous) at (0,0) size 768x19
RenderText {#text} at (0,0) size 152x19
text run at (0,0) width 152: "Welcome to Sky!"
RenderBlock {div} at (0,0) size 800x137
RenderBlock {div} at (32,32) size 736x38
RenderParagraph (anonymous) at (0,0) size 736x38
RenderText {#text} at (0,0) size 191x38
text run at (0,0) width 191: "about:blank"
RenderBlock {div} at (16,110) size 768x19 [color=#BCD8F5]
RenderParagraph (anonymous) at (0,0) size 768x19
RenderText {#text} at (0,0) size 152x19
text run at (0,0) width 152: "Welcome to Sky!"

View File

@@ -1,25 +1,24 @@
layer at (0,0) size 800x600
RenderView {#document} at (0,0) size 800x600
layer at (0,0) size 800x506
RenderBlock {sky} at (0,0) size 800x506
RenderBlock {div} at (0,0) size 800x228
RenderParagraph (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 76x19
text run at (0,0) width 76: "This is an"
RenderParagraph (anonymous) at (0,209) size 800x19
RenderText {#text} at (0,0) size 72x19
text run at (0,0) width 72: "element."
RenderBlock {div} at (0,228) size 800x200
RenderParagraph (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
RenderParagraph (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 218x19
text run at (0,0) width 218: "Small iframe should render"
RenderParagraph (anonymous) at (0,59) size 800x19
RenderText {#text} at (0,0) size 76x19
text run at (0,0) width 76: "correctly."
RenderBlock {sky} at (0,0) size 800x506
RenderBlock {div} at (0,0) size 800x228
RenderParagraph (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 76x19
text run at (0,0) width 76: "This is an"
RenderParagraph (anonymous) at (0,209) size 800x19
RenderText {#text} at (0,0) size 72x19
text run at (0,0) width 72: "element."
RenderBlock {div} at (0,228) size 800x200
RenderParagraph (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
RenderParagraph (anonymous) at (0,0) size 800x19
RenderText {#text} at (0,0) size 218x19
text run at (0,0) width 218: "Small iframe should render"
RenderParagraph (anonymous) at (0,59) size 800x19
RenderText {#text} at (0,0) size 76x19
text run at (0,0) width 76: "correctly."
layer at (0,19) size 340x190
RenderReplaced {iframe} at (0,19) size 340x190 [border: (20px solid #000000)]
layer at (0,447) size 300x40

View File

@@ -1,7 +1,6 @@
layer at (0,0) size 800x600
RenderView {#document} at (0,0) size 800x600
layer at (0,0) size 800x89
RenderBlock {foo} at (0,0) size 800x89
RenderImage {img} at (0,0) size 256x64
RenderImage {img} at (0,64) size 100x25
RenderBlock {foo} at (0,0) size 800x89
RenderImage {img} at (0,0) size 256x64
RenderImage {img} at (0,64) size 100x25

View File

@@ -9,7 +9,7 @@ element.setAttribute("as", "hello");
element.addEventListener("load", function() {
document.getElementById("result1").textContent = "PASS: Load event fired.";
});
document.documentElement.appendChild(element);
document.firstElementChild.appendChild(element);
</script>
<script>
document.getElementById("result2").textContent = hello;

View File

@@ -13,8 +13,7 @@ void main() {
initUnit();
test('should be able to send events', () {
var sky = document.querySelector('sky');
sky.addEventListener('keypress', expectAsync((event) {
document.addEventListener('keypress', expectAsync((event) {
expect(event.type, equals('keypress'));
expect(event.key, equals(0));
expect(event.charCode, equals(0x41));