Gracefully handle inability to compute subject size.

Different elements require different strategies for computing the
bounding box. Presently we handle box elements as well as various
inline and SVG elements. The <br> element slipped through the cracks.
To prevent a crash for an unhandled element type, we instead handle a
nullopt size and allow CalculateOffsets to fail to compute offsets. If
no offsets are produced, then the timeline simply becomes inactive.

Bug: 1470522
Change-Id: Iaaef5241fb6ceb450ad6992c1c75619a0a672183
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4759905
Reviewed-by: Mustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1182154}
diff --git a/scroll-animations/view-timelines/subject-br-crash.html b/scroll-animations/view-timelines/subject-br-crash.html
new file mode 100644
index 0000000..36627db
--- /dev/null
+++ b/scroll-animations/view-timelines/subject-br-crash.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<link rel="help" href="https://www.w3.org/TR/scroll-animations-1/#viewtimeline-interface">
+<html>
+<!-- crbug.com/1470522 --->
+<script>
+    function main() {
+        var b = document.createElement("br");
+        document.body.append(b);
+        new ViewTimeline({ subject: b });
+    }
+</script>
+<body onload=main()>
+</body>
+</html>