Re: [csswg-drafts] [resize-observer] Add layoutBox property to constructor

A few comments:

We should use an enum to define the value space of layoutBox, so that what happens when we pass in an invalid value is handled in a way consistent with other APIs.  So something like:

```
enum ResizeObserverLayoutBox {
    "padding-box",
    "border-box",
    "content-box"
};
```

and then use that instead of DOMString in all places.  The result will be that an exception is thrown when invalid values are passed in.

Then we should make the ResizeObserver constructor argument have a default value, so:

```
[Constructor(ResizeObserverCallback callback, ResizeObserverLayoutBox layoutBox = "content-box")]
```

so then we don't need to do anything in the prose for the constructor to handle a missing/default value either.

The header for the prose section describing the ResizeObserver constructor should be updated to have the layoutBox argument.

The layoutBox declaration itself should be `readonly attribute ResizeObserverLayoutBox layoutBox;`.

The prose description of `new ResizeObserverEntry(target)` talks about this.layoutBox, but there's no layoutBox on ResizeObserverEntry.

-- 
GitHub Notification of comment by heycam
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3238#issuecomment-432204655 using your GitHub account

Received on Tuesday, 23 October 2018 11:14:29 UTC