Bug 1471894 Part 2: Add a web-platform-test to check computed margin values on auto margin blocks. draft
authorBrad Werth <bwerth@mozilla.com>
Thu, 12 Jul 2018 11:55:32 -0700
changeset 822243 334b7e80faf52ce0f6abbd9aeaaf7502edf25e49
parent 822242 cc9e0ef12f52ec6ab93d2f53999827b2dc0c5019
child 822244 04dac84000978632bad8f279bbc90ff8ab75a6f6
push id117323
push userbwerth@mozilla.com
push dateTue, 24 Jul 2018 23:15:37 +0000
bugs1471894
milestone63.0a1
Bug 1471894 Part 2: Add a web-platform-test to check computed margin values on auto margin blocks. MozReview-Commit-ID: KbSZzhoX5mu
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/css/cssom/computed-style-005.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -184506,16 +184506,28 @@
       [
        "/svg/linking/reftests/use-descendant-combinator-ref.html",
        "=="
       ]
      ],
      {}
     ]
    ],
+   "svg/linking/reftests/use-descendant-combinator-003.html": [
+    [
+     "/svg/linking/reftests/use-descendant-combinator-003.html",
+     [
+      [
+       "/svg/linking/reftests/use-descendant-combinator-ref.html",
+       "=="
+      ]
+     ],
+     {}
+    ]
+   ],
    "svg/painting/currentColor-override-pserver-fallback.svg": [
     [
      "/svg/painting/currentColor-override-pserver-fallback.svg",
      [
       [
        "/svg/painting/currentColor-override-pserver-fallback-ref.svg",
        "=="
       ]
@@ -184542,28 +184554,16 @@
       [
        "/svg/painting/currentColor-override-pserver-stroke-ref.svg",
        "=="
       ]
      ],
      {}
     ]
    ],
-   "svg/linking/reftests/use-descendant-combinator-003.html": [
-    [
-     "/svg/linking/reftests/use-descendant-combinator-003.html",
-     [
-      [
-       "/svg/linking/reftests/use-descendant-combinator-ref.html",
-       "=="
-      ]
-     ],
-     {}
-    ]
-   ],
    "svg/painting/reftests/paint-context-001.svg": [
     [
      "/svg/painting/reftests/paint-context-001.svg",
      [
       [
        "/svg/painting/reftests/paint-context-001-ref.svg",
        "=="
       ]
@@ -325271,16 +325271,22 @@
     ]
    ],
    "css/cssom/computed-style-004.html": [
     [
      "/css/cssom/computed-style-004.html",
      {}
     ]
    ],
+   "css/cssom/computed-style-005.html": [
+    [
+     "/css/cssom/computed-style-005.html",
+     {}
+    ]
+   ],
    "css/cssom/computed-style-set-property.html": [
     [
      "/css/cssom/computed-style-set-property.html",
      {}
     ]
    ],
    "css/cssom/css-style-attr-decl-block.html": [
     [
@@ -439003,17 +439009,17 @@
    "ff8d1c26701d15164bcb549d42937825e1f0edd0",
    "testharness"
   ],
   "content-security-policy/securitypolicyviolation/idl.html": [
    "266180135d8167bc47d6c7a73798e87aa1082bee",
    "testharness"
   ],
   "content-security-policy/securitypolicyviolation/img-src-redirect-upgrade-reporting.https.html": [
-   "e338e94ea726419db64ed5b98c95b862c394409e",
+   "f6623c80b2b4be3fd9dd0f5dc0a6417652f1b797",
    "testharness"
   ],
   "content-security-policy/securitypolicyviolation/img-src-redirect-upgrade-reporting.https.html.headers": [
    "960ee8a9f7ccf33ea435890e2eae0e68399f32ed",
    "support"
   ],
   "content-security-policy/securitypolicyviolation/inside-dedicated-worker.html": [
    "46d18c97d554716b714856c00bdc49388d211868",
@@ -439055,17 +439061,17 @@
    "b2d6d11fc189d78f5ea623c52e1d1f64fe53a772",
    "testharness"
   ],
   "content-security-policy/securitypolicyviolation/style-sample.html": [
    "e570217f560f6e7a8917e79266ac9d2e8ea078f6",
    "testharness"
   ],
   "content-security-policy/securitypolicyviolation/support/inside-worker.sub.js": [
-   "f425a7ae6c167bfe9857f08f460897e16bf6ca95",
+   "d94662579190653a3b3e9d076b79d7b0f01f2dc7",
    "support"
   ],
   "content-security-policy/securitypolicyviolation/support/inside-worker.sub.js.headers": [
    "ac19897e2693ba3228640d03c770cd5a33c51381",
    "support"
   ],
   "content-security-policy/securitypolicyviolation/support/testharness-helper.sub.js": [
    "71244cc74fa8f8ee8082c876264e053348905fbd",
@@ -552046,16 +552052,20 @@
   "css/cssom/computed-style-003.html": [
    "aece414b89e0fdea1030e4ca9011ab7d22f1b275",
    "testharness"
   ],
   "css/cssom/computed-style-004.html": [
    "55010cf90dc7fc2ef8ec6cbd13d1ec947a823aed",
    "testharness"
   ],
+  "css/cssom/computed-style-005.html": [
+   "690ce1465de338f19b1e7282b4a221e7fe374a12",
+   "testharness"
+  ],
   "css/cssom/computed-style-set-property.html": [
    "cb05ff525eb659d43bf234d932fd860795959c9e",
    "testharness"
   ],
   "css/cssom/css-style-attr-decl-block.html": [
    "1d68a3fd1560308c0d2f3478864d84f4361e4ab9",
    "testharness"
   ],
@@ -619078,16 +619088,20 @@
   "svg/linking/reftests/use-descendant-combinator-001.html": [
    "323fde648ee2d065bfd945a2c4d5be86f1c308ff",
    "reftest"
   ],
   "svg/linking/reftests/use-descendant-combinator-002.html": [
    "3d51ca0fc007d52147e7ea03493cac7ee1bb7903",
    "reftest"
   ],
+  "svg/linking/reftests/use-descendant-combinator-003.html": [
+   "d9155d3b92ecf0735f82ed9a0f2a8fd3fc380d55",
+   "reftest"
+  ],
   "svg/linking/reftests/use-descendant-combinator-ref.html": [
    "fb8aec792684b97151d2964b85d1e70829e141ad",
    "support"
   ],
   "svg/linking/scripted/href-animate-element.html": [
    "c224f6b609079f31c256625417e4677b21b5f71a",
    "testharness"
   ],
@@ -622183,17 +622197,17 @@
    "c95130e1f0226d18fcdd9dc9d5795395d6de586f",
    "support"
   ],
   "webaudio/README.md": [
    "230684ec60fd2e408f9b6014417f3eddfe2dc95a",
    "support"
   ],
   "webaudio/historical.html": [
-   "93068df297042344669093ce899f0230c87ebf54",
+   "c6e3c7d6751731c708edfb0f4e32df8a6a3b80b0",
    "testharness"
   ],
   "webaudio/idlharness.https.html": [
    "0403de985b3346240ba1d4b465a8e0838f3860bc",
    "testharness"
   ],
   "webaudio/js/buffer-loader.js": [
    "4d564eae0b3d7d1045626d1f144cd2638dba64e5",
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/cssom/computed-style-005.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+ <head>
+  <title>CSS Test: getComputedStyle on blocks with auto margins</title>
+  <link rel="author" title="Brad Werth" href="mailto:bwerth@mozilla.com">
+  <link rel="help" href="https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle" />
+  <meta name="assert" content="getComputedStyle produces pixel values for margin: auto blocks">
+  <script src="/resources/testharness.js" type="text/javascript"></script>
+  <script src="/resources/testharnessreport.js" type="text/javascript"></script>
+  <style>
+    x {
+      display: block;
+      position: relative;
+      background: grey;
+      width: 60px;
+      height: 10px;
+    }
+    y {
+      display: block;
+      background: blue;
+      width: 40px;
+      height: 10px;
+      margin: auto;
+    }
+
+    #absolute {
+      position: absolute;
+      left: 0;
+      right: 0;
+    }
+    #relative {
+      position: relative;
+    }
+  </style>
+ </head>
+ <body>
+ <div id="log"></div>
+ <x><y id="absolute"></y></x>
+ <x><y id="relative"></y></x>
+ <script type="text/javascript">
+   let idsToTest = [
+     "absolute",
+     "relative",
+   ];
+
+   for (let id of idsToTest) {
+     let elem = document.getElementById(id);
+     let elemStyle = window.getComputedStyle(elem);
+
+     test(function() {
+       assert_equals(elemStyle.getPropertyValue("margin-left"), "10px");
+       assert_equals(elemStyle.getPropertyValue("margin-right"), "10px");
+     }, id + "_computed_margins", {
+       assert: id + "-positioned element's auto margins should be resolved to 10px."
+     });
+
+     test(function() {
+       assert_equals(elemStyle.getPropertyValue("left"), "0px");
+       assert_equals(elemStyle.getPropertyValue("right"), "0px");
+     }, id + "_computed_left_and_right", {
+       assert: id + "-positioned element should have a left and right of 0px (as authored)."
+     });
+   }
+ </script>
+ </body>
+</html>